[rrd-users] an error message using RRDTool

Tobias Oetiker tobi at oetiker.ch
Tue Apr 29 14:36:50 CEST 2008


David,

if you tell me what you try to achieve I might be able to help ...

if you want to draw the speed in a different color, depending on
its value, you should set the speed to UNKN when you do not want to
draw anyting ...

CDEF:fast=kmh,100,GT,100,UNKN,IF

cheers
tobi


Today David Sambo wrote:

> Hi Tobi;
>
> Thanks for the reply, not sure how I would create the IF/THEN/ELSE
> statement as this is not C++ to me but close, please where or how would
> I code this:
>
> C:\wamp\www\rrdtool\rrdtool-1.2.27-w32>rrdtool graph speed4.jpg --start
> 920804400 --end 920808000 --vertical-lab
> el km/h DEF:myspeed=test.rrd:speed:AVERAGE "CDEF:kmh=myspeed,3600,*"
> CDEF:fast=kmh,100,GT,100,0,IF CDEF:over=kmh
> ,100,GT,kmh,100,-,0,IF CDEF:over=kmh,100,GT,kmh,100,-,0,IF
> CDEF:good=kmh,100,GT,0,kmh,IF HRULE:100#0000FF:"Maxim
> um allowed" AREA:good#00FF00:"Good speed" AREA:fast#550000:"Too fast"
> STACK:over#FF0000:"Over speed"
>
>
> Thanks
>
> David
> -----Original Message-----
> From: Tobias Oetiker [mailto:tobi at oetiker.ch]
> Sent: 29 April 2008 12:20
> To: David Sambo
> Cc: rrd-users at lists.oetiker.ch
> Subject: Re: [rrd-users] an error message using RRDTool
>
> Hi David,
>
> > Using RRDTOOL on a Windows based system, for the 1st Time, working on
> > the Tutorial, and discovered an error message and would like someone
> to
> > help resolve asap Shown below:
> >
> >
> >
> > C:\wamp\www\rrdtool\rrdtool-1.2.27-w32>rrdtool graph speed4.jpg
> --start
> > 920804400 --end 920808000 --vertical-label km/h
> > DEF:myspeed=test.rrd:speed:AVERAGE "CDEF:kmh=myspeed,3600,*"
> > CDEF:fast=kmh,100,GT,100,0,IF CDEF:over=kmh,100,GT,kmh,100,-,0,IF
> > CDEF:over=kmh,100,GT,kmh,100,-,0,IF CDEF:good=kmh,100,GT,0,kmh,IF
> > HRULE:100#0000FF:"Maximum allowed" AREA:good#00FF00:"Good speed"
> > AREA:fast#550000:"Too fast" STACK:over#FF0000:"Over speed"
> >
> > ERROR: Attempting to reuse 'over'
> >
> > it seems it does not understand 'over' in the IF ELSE statements:
> > over=kmh ,100,GT,kmh,100,-,0, CDEF:over=kmh...
>
> you have two IF/THEN/ELSE statements here ... with their results
> both assigned to the same variable. rrdtool does not like that and
> complains.
>
> cheers
> tobi
>
> >
> >
> >
> > Best Regards,
> >
> >
> >
> > David
> >
> >
> >
> >
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://it.oetiker.ch tobi at oetiker.ch ++41 62 213 9902



More information about the rrd-users mailing list