[rrd-users] Cant quite get data sample correct.

This is a discussion on [rrd-users] Cant quite get data sample correct. within the RRD Users forums, part of the Networking and Network Related category; Peeps, Am starting to write some rrdtool files manually again, and am pretty sure Im donig something stupid. The following ...


Go Back   Usenet Forums > Networking and Network Related > RRD Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-12-2007
Martin Rheumer
 
Posts: n/a
Default [rrd-users] Cant quite get data sample correct.

Peeps,

Am starting to write some rrdtool files manually again, and
am pretty sure Im donig something stupid. The following script
was borrowed from archives and retrieves a set of values from
a mysql database and creates an rrd file for each ATM trunk
we have.
Please ignore the code ( its perl but changed to protect the
innocent coder )


my $STEP = 300;

my $START = "19970101";

my @options = ("-b", $START, "-s", $STEP,
"DS:ds0:GAUGE:300:U:U",
"DS:ds1:GAUGE:300:U:U",
"RRA:AVERAGE:0.5:1:999",
"RRA:AVERAGE:0.5:6:800",
"RRA:AVERAGE:0.5:24:800",
"RRA:AVERAGE:0.5:288:800",
"RRA:MIN:0.5:1:999",
"RRA:MIN:0.5:6:800",
"RRA:MIN:0.5:24:800",
"RRA:MIN:0.5:288:800",
"RRA:MAX:0.5:1:999",
"RRA:MAX:0.5:6:800",
"RRA:MAX:0.5:24:800",
"RRA:MAX:0.5:288:800");

print "* Creating RRD $RRD1 starting at e.\n\n";
RRDs::create $RRD1, @options;

my $ERROR = RRDs::error;
ok("create A", !$ERROR); # 2
if ($ERROR)
{
die "$0: unable to create `$RRD1': $ERROR\n";
}

print "* Filling $RRD1 with values. One moment please ...\n";

while %hash2-Query("select unix_timestamp(run_date) as
Unixtime_run_date, totald from trunk where name =
'tsv_cn_1.bne_cs_2.tot_cells.in")
{
$t = $hash2{Unixtime_run_date};
$data1 = $hash2{totaldata};
print "\n$RRD1 \t $t:$data1:$data1\n";
RRDs::update $RRD1, "$t:$data1:$data1";
if ($ERROR = RRDs::error)
{
die "$0: unable to update `$RRD1': $ERROR\n";
}
}

The outout looks like this.

/usr/local/mrtg/htdocs/atm_stats/tsv_cn_1.bne_cs_2.tot_cells.in.rrd
1171253700:439670:439670
/usr/local/mrtg/htdocs/atm_stats/tsv_cn_1.bne_cs_2.tot_cells.in.rrd
1171254000:176465:176465
/usr/local/mrtg/htdocs/atm_stats/tsv_cn_1.bne_cs_2.tot_cells.in.rrd
1171254300:188213:188213



Now when I go and query the tsv_cn_1.bne_cs_2.tot_cells.in with rrdtool
fetch I get

rrdtool fetch tsv_cn_1.bne_cs_2.tot_cells.in.rrd -s 1171253700 -e +10h AVERAGE
ds0 ds1

1171324800: nan nan

The graphs are also very blocky and appear in 30 minute samples, where I
clearly have
5 minute data samples for the past 24 hours.

Can someone see what I have / am doing wrong.

This has driven me mad all day today..

Thanks again
Martin





_______________________________________________
rrd-users mailing list
rrd-users@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:35 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0