<HTML>
<HEAD>
<TITLE>LAST always returning zero</TITLE>
</HEAD>
<BODY>
<FONT FACE="Arial"><SPAN STYLE='font-size:12.0px'>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.<BR>
<BR>
Data points are generated every 10 seconds.<BR>
<BR>
The definition (removing multiple queue definitions) is:<BR>
<BR>
/usr/local/rrdtool/bin/rrdtool create /var/log/queues --start 1204404266 -s 10 \<BR>
DS:queue1_depth:GAUGE:20:0:U \<BR>
DS:queue1_added:DERIVE:20:0:U \<BR>
DS:queue1_removed:DERIVE:20:0:U \<BR>
DS:queue1_enabled:GAUGE:20:0:U \<BR>
RRA:AVERAGE:0.5:1:60480 \<BR>
RRA:MAX:0.5:1:8640 \<BR>
RRA:AVERAGE:0.5:6:44640 \<BR>
RRA:MAX:0.5:6:44640\<BR>
RRA:AVERAGE:0.5:12:267840 \<BR>
RRA:MAX:0.5:12:267840<BR>
<BR>
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):<BR>
<BR>
/usr/local/rrdtool/bin/rrdtool graph /var/graphs/queues.png -a PNG -l 0 -t "Disabled Queues" \<BR>
DEF:queue1=/var/log/queues:queue1_enabled:AVERAGE \<BR>
CDEF:queue1N=queue1,0,GT,0,1,IF \<BR>
VDEF:queue1L=queue1N,LAST \<BR>
AREA:queue1N#00FF00:"Queue 1" \<BR>
GPRINT:queue1L:'%1.0lf' \<BR>
--upper-limit 4 --vertical-label "Disabled Queue Count" -w 400 -h 100 -s "now-2h" -e "now"<BR>
<BR>
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”.<BR>
<BR>
If I print MAX instead of LAST, it is always correct.<BR>
<BR>
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.<BR>
<BR>
Wes</SPAN></FONT>
</BODY>
</HTML>