[rrd-users] Parameter problem - was: LAST always returning zero
Alex van den Bogaerdt
alex at ergens.op.het.net
Sun Mar 9 14:23:09 CET 2008
On Sat, Mar 08, 2008 at 04:57:49PM -0600, Wes wrote:
> On 3/8/08 2:08 AM, "Alex van den Bogaerdt" <alex at ergens.op.het.net> wrote:
> > CDEF:red1=queue1,UN,INF,UNKN,IF
> > AREA:red1#FF0000:unknown
> > CDEF:red2=queue2,UN,-INF,UNKN,IF
> > AREA:red2#FF0000:unknown
> > This won't solve your problem but it should make it more visible.
> > Another debug technique:
> > If your script has a variable '$end' or so, change
> > -t "Disabled Queues (mmp11es)"
> > into
> > -t "Disabled Queues (mmp11es) upto $end"
> > You could combine this with
> > VDEF:last=queue1,LAST
> > GPRINT:last:"%s":strftime
> I did the above. To verify functionality (force an undefined value), I set
> --end <rrdtool last> / 10 * 10 + 20
> The graph label ($end) shows *250 and the GPRINT LAST shoes *230, there is a
> red bar in the graph, and the GPRINT enabled/disabled is showing 0, all
> exactly as expected.
You are displaying the opposite of queue1, meaning you display
1 when the line is disabled.
If you get 0, you succesfully prevented NaN from resulting in 1.
> Both the graph label and the GPRINT LAST show *340. There is *no* red bar
> in the graph. The queue GPRINT enabled/disabled is showing 0, when it
> should be showing 1. I assume this is because when --end is 340, I actually
> get through 350, per my previous email. But then why don't I have a red
Why would you expect 1 ?
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" \
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...
Alex van den Bogaerdt
More information about the rrd-users