[rrd-users] Re: Printing some calculated current values on a graph?
Stephan Harren
sh at abovenet.de
Tue Aug 12 14:31:37 MEST 2003
> OK, but how? Using GPRINT:user_p:AVERAGE:"Current CPU\: %.2lf user, "
>
> Gives ERROR: the RRD does not contain an RRA matching the chosen CF
Hmmm, the above should work. Here's an example how I do it:
$rrd_all -u 100 -l 0 -t \"CPU Usage $1\" -v \"Use Percentage\"
DEF:up=/home/sh/rrd-files/$_[0]_$field_in.rrd:up:LAST
DEF:down=/home/sh/rrd-files/$_[0]_$field_in.rrd:down:LAST
CDEF:notmon=up,UN,100,0,IF CDEF:calc=up,down,+
AREA:down#FF0000:\"CRITICAL\\n\" AREA:up#00FF00:\"OK\\n\"
AREA:notmon#000000:\"Not Monitored\\n\" COMMENT:\"\\n\" $upper
GPRINT:calc:AVERAGE:\"Average Usage \\: %3.2lf %%\\n\"
GPRINT:calc:MAX:\"Max Usage \\: %3.2lf %%\\n\" $percentage[12]
Try to use no underscore (user_p), I think I remember that there was a problem
with it, just a guess ....
> > BTW, if you use GAUGE and AVERAGE to store your data, you automatically
> > store percentage as the linux raw values are hundredth of seconds ...
>
> I think I'm doing that, but in my opinion, a value such as 744674 is
> not a percentage. And lets keep it on the list, if you don't mind.
Use rrdtool dump to see what is stored inside the rrd-file. You give it the
744674 but it calculates the difference to the last entry, so that you might
get 3000 hundredth of seconds. If you do the measurement every 5 minutes (300
seconds) the average usage during this timeframe will be 10 100th of seconds,
which will be 10 % as 3000 hundredth of seconds are 10 % of 30000
(300seconds/100) hundredth of seconds.
Best regards,
Stephan
--
Stephan Harren
Manager Site Operations
MFN-IS
-------------------------------
Phone +49 69 90554 153
Fax +49 69 90554 111
Cell +49 173 7011126
--
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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the rrd-users
mailing list