[rrd-users] Parameter problem - was: LAST always returning zero
Alex van den Bogaerdt
alex at ergens.op.het.net
Sun Mar 9 18:27:38 CET 2008
> > This said, in the process I did find some weird behaviour. I checked
> > it against a much older version (1.2.10) which does not have this problem.
> >
> > rrdtool graph disabled.png -a PNG -l 0 \
> > -t "Disabled queues - $END" \
> > DEF:queue1=queues:queue1_enabled:AVERAGE \
> > CDEF:queue1N=queue1,0,GT,0,1,IF \
> > VDEF:queue1L1=queue1,LAST \
> > VDEF:queue1L2=queue1N,LAST \
> > AREA:queue1N#00FF00:"Queue 1 down\l" \
> > GPRINT:queue1L1:"Last is_up \: %1.0lf" \
> > GPRINT:queue1L1:"timestamp %s\l":strftime \
> > GPRINT:queue1L2:"Last is_down\: %1.0lf" \
> > GPRINT:queue1L2:"timestamp %s\l":strftime \
> > --upper-limit 4 -s $START -e $END
> >
> > All input is 1.
> >
> > This displays different timestamps for queue1L1 and queue1L2, which
> > really should not happen. There's something with that CDEF...
>
> Is this because of the extra row that is returned if you ask for a multiple
> of 10 - if you ask for *30, you get *40 - which is all nan's?
That CDEF statement should contain the same amount of time as the DEF
does, i.e. exactly the same amount of rows. Only the contents should
differ.
Then I find the end time of the last entry of both DEF and CDEF, and
these should match as well. If they don't, either the amount of time
has changed or the last value is unknown in one case but not in the other.
For some reason I find it hard to debug today, so I decided to let it
rest and ask on rrd-developers for help.
One thing for you to try:
You say you get 0 or 1 in queue, and you want the opposite.
Why not simply do
CDEF:queue1N=1,queue1,-
?
--
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/
More information about the rrd-users
mailing list