[rrd-users] Re: Help on RRDTOO monitoring cpu loadavg needed!
"CHEW YEW CHOONG"
055919 at mis.nagaokaut.ac.jp
Sat Sep 3 11:31:10 MEST 2005
Hi Alex,
Thanks for the comment and suggestion. As im very to rrdtool and perl, it will take me sometimes to learn how to print those figure to file with timestamp and the computing part.
Anyway, i have add a few lines into the script:
my $total = $min1 + $min5 + $min15;
print "$min1 $min5 $min15\n";
print "$total\n";
print "$min1";
print "$min5";
print "$min15";
print "update database\n";
RRDs::update "$rrd/cpu.rrd",
#"-t", "1min:5min:15min",
"N:$min1:$min5:$min15";
The result show on screes:
0.33 <---- this 3 lines from
0.49 <---- print "$min1 $min5 $min15\n";
0.48 <---- strange on the line break and space.
1.3 <---- from print "$total\n";
0.33 <---- from print "$min1";
0.49 <---- from print "$min5";
0.48 <---- from print "$min15";
Output from rrdtool info cpu.rrd:
filename = "cpu.rrd"
rrd_version = "0003"
step = 60
last_update = 1125738720
ds[1min].type = "GAUGE"
ds[1min].minimal_heartbeat = 600
ds[1min].min = 0.0000000000e+00
ds[1min].max = NaN
ds[1min].last_ds = "UNKN"
ds[1min].value = 0.0000000000e+00
ds[1min].unknown_sec = 0
ds[5min].type = "GAUGE"
ds[5min].minimal_heartbeat = 600
ds[5min].min = 0.0000000000e+00
ds[5min].max = NaN
ds[5min].last_ds = "UNKN"
ds[5min].value = 0.0000000000e+00
ds[5min].unknown_sec = 0
ds[15min].type = "GAUGE"
ds[15min].minimal_heartbeat = 600
ds[15min].min = 0.0000000000e+00
ds[15min].max = NaN
ds[15min].last_ds = "UNKN"
ds[15min].value = 0.0000000000e+00
ds[15min].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 576
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0
rra[0].cdp_prep[1].value = NaN
rra[0].cdp_prep[1].unknown_datapoints = 0
rra[0].cdp_prep[2].value = NaN
rra[0].cdp_prep[2].unknown_datapoints = 0
rra[1].cf = "AVERAGE"
rra[1].rows = 672
rra[1].pdp_per_row = 10
rra[1].xff = 5.0000000000e-01
rra[1].cdp_prep[0].value = NaN
rra[1].cdp_prep[0].unknown_datapoints = 2
rra[1].cdp_prep[1].value = NaN
rra[1].cdp_prep[1].unknown_datapoints = 2
rra[1].cdp_prep[2].value = NaN
rra[1].cdp_prep[2].unknown_datapoints = 2
rra[2].cf = "AVERAGE"
rra[2].rows = 732
rra[2].pdp_per_row = 60
rra[2].xff = 5.0000000000e-01
rra[2].cdp_prep[0].value = 0.0000000000e+00
rra[2].cdp_prep[0].unknown_datapoints = 12
rra[2].cdp_prep[1].value = 0.0000000000e+00
rra[2].cdp_prep[1].unknown_datapoints = 12
rra[2].cdp_prep[2].value = 0.0000000000e+00
rra[2].cdp_prep[2].unknown_datapoints = 12
rra[3].cf = "AVERAGE"
rra[3].rows = 1460
rra[3].pdp_per_row = 1440
rra[3].xff = 5.0000000000e-01
rra[3].cdp_prep[0].value = 0.0000000000e+00
rra[3].cdp_prep[0].unknown_datapoints = 532
rra[3].cdp_prep[1].value = 0.0000000000e+00
rra[3].cdp_prep[1].unknown_datapoints = 532
rra[3].cdp_prep[2].value = 0.0000000000e+00
rra[3].cdp_prep[2].unknown_datapoints = 532
I dont understand why all value is either 0 or NaN or UNKN. This must be the reason why lines are not drawing.
And when i do a rrdtool dump cpu.rrd, most of the lines display on screen are as below:
<!-- 2005-08-08 09:00:00 JST / 1123459200 --> <row><v> NaN </v><v> NaN </v><v> NaN </v></row>
<!-- 2005-08-09 09:00:00 JST / 1123545600 --> <row><v> NaN </v><v> NaN </v><v> NaN </v></row>
<!-- 2005-08-10 09:00:00 JST / 1123632000 --> <row><v> NaN </v><v> NaN </v><v> NaN </v></row>
<!-- 2005-08-11 09:00:00 JST / 1123718400 --> <row><v> NaN </v><v> NaN </v><v> NaN </v></row>
Please help. Thanks.
Alex van den Bogaerdt wrote:
> On Sat, Sep 03, 2005 at 08:19:09AM +0900, "CHEW縲YEW縲CHOONG" wrote:
>
>
> > Im learning perl and rrdtool now. I try to make
> > rrdtool to monitoring cpu loadavg. Everythings seems
> > working (rrd db created, updated, rrd images created,
> > updated. i check with doing a ls -l and compare the
> > timestamp on those files).
> > However, the is only one problem that screw the whole
> > things -- the graph is blank wiht no line :(
>
> When a RRD is updated, it could be that you updated with the "NaN"
> (or: Unknown) value. That would show up as an empty "line".
> However, since you are using GAUGE that is unlikely.
>
> > > "DS:1min:GAUGE:600:U:U",
> > > "DS:5min:GAUGE:600:U:U",
> > > "DS:15min:GAUGE:600:U:U",
>
> You set your heartbeat to 600 seconds. That's ten minutes. This is
> OK, provided that you update multiple times, each no more than 600
> seconds apart. Your step time was 300 seconds so your plan is to
> update every 300 seconds. Those updates are expected to be 300
> seconds apart but MUST NOT be more than 600 seconds apart.
>
> > > RRDs::update "$rrd/cpu.rrd",
> > > "-t", "1min:5min:15min",
> > > "N:$min1:$min5:$min15";
>
> That `` "-t", "1min:5min:15min", '' is OK but redundant.
>
>
> You should add some debugging to your script and do the computations
> you expect RRDtool to make by hand. Print those values you are going
> to give to RRDtool into a file, together with current time (in seconds
> since unix epoch would be best for easy monitoring).
> Perhaps "$min1", "$min5" and/or "$min15" are not what you think.
>
> Use other available commands to help you figure out what is going on.
> "rrdtool info" and "rrdtool dump" may be of help here.
>
> Alex
>
> --
> Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
> Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
> Archive http://lists.ee.ethz.ch/rrd-users
> WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
>
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-users
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the rrd-users
mailing list