[rrd-users] counting errors in rrd

mathew anderson snotling at gmail.com
Thu Mar 3 17:40:17 CET 2011


Hello -

I have a single RRD file that has the value 100 in places.  Whenever my
monitoring sees an error (probes every 5 mins), it pushes a 100 into an rrd
file.  I am trying to figure out how many times this value is in a given
time range.

For example:

rrdtool graph images/error.gif -a PNG --start $start --end $end
DEF:yellowhours=$yellowrrd:data:AVERAGE
CDEF:YELLOWNone=yellowhours,0,0,LIMIT,UN,UNKN,INF,IF
AREA:yellowhours#FFFF44:"Errors "

Shows a nice graph, with a few yellow strips.  I can then overlay this on,
response times, or anything else.
But to count up the number of errors, I seem to not be able to do.  Any help
would be great.

I have tried doing a few things with CDEF and VDEF to get the count, like:

CDEF:foo=yellowhours,yellowhours,/ <-- to get the the values in the array
set to one. - should make adding up the array easy.

VDEF:max=foo,TOTAL <-- hopefully to get the total of everything in the foo
array.. after reading what TOTAL is, this did not work. I thought I might do
something like max=foo,TOTAL,<stepsize>,/  and divide the value by the
stepsize, but I get :  Unknown function string 'TOTAL,180,/

I was thinking about use Sort on the array and when I see a 0, Push up a
count - but I am not sure how many values will be in the array.

Thanks for any advise on how to proceed.

-mathew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20110303/75aaef54/attachment.htm 


More information about the rrd-users mailing list