[rrd-users] LAST always returning zero

Wes wespvp at msg.bt.com
Fri Mar 7 01:42:02 CET 2008


I have a data source defined as a GAUGE that is fairly static - it is always
a zero or a one, and does not change frequently.  It represents the state of
a queue - disabled or enabled.  When I graph it, the graph is always
correct.  GPRINT MAX is always right.  However, LAST usually, but not always
shows zero.

Data points are generated every 10 seconds.

The definition (removing multiple queue definitions) is:

/usr/local/rrdtool/bin/rrdtool create /var/log/queues --start 1204404266 -s
10 \
    DS:queue1_depth:GAUGE:20:0:U \
    DS:queue1_added:DERIVE:20:0:U \
    DS:queue1_removed:DERIVE:20:0:U \
    DS:queue1_enabled:GAUGE:20:0:U \
    RRA:AVERAGE:0.5:1:60480 \
    RRA:MAX:0.5:1:8640 \
    RRA:AVERAGE:0.5:6:44640 \
    RRA:MAX:0.5:6:44640\
    RRA:AVERAGE:0.5:12:267840 \
    RRA:MAX:0.5:12:267840

The value of ³_enabled² is 0 for disabled and 1 for enabled.  I want the
graph to be non-zero if the queue is disabled.I call the graph with
(removing multiple queues):

/usr/local/rrdtool/bin/rrdtool graph /var/graphs/queues.png -a PNG -l 0 -t
"Disabled Queues" \
DEF:queue1=/var/log/queues:queue1_enabled:AVERAGE \
CDEF:queue1N=queue1,0,GT,0,1,IF \
VDEF:queue1L=queue1N,LAST \
AREA:queue1N#00FF00:"Queue 1" \
GPRINT:queue1L:'%1.0lf' \
--upper-limit 4 --vertical-label "Disabled Queue Count" -w 400 -h 100 -s
"now-2h" -e "now"
 
The CDEF is essentially a ŒNOT¹.  I¹ve tried printing the raw values without
the CDEF IF, and they are always zero (not nan) - yes, 0, not 1.  I¹ve tried
removing the ³-e² and that didn¹t help.  The only thing that seems to get it
reasonably reliable is to specify ³-e now-30s².

If I print MAX instead of LAST, it is always correct.

How do I get it to properly display the correct latest value?  Am I
overlooking something above?  I¹ve got about three dozen other graphs that
have dynamic data and all display LAST correctly.

Wes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20080306/75a7f5e6/attachment.html 


More information about the rrd-users mailing list