[rrd-users] Using CDEF to make B = 1 but only when A = 0

Eric Brander Eric_Mailing_List at rednarb.com
Wed Dec 22 23:49:56 MET 2004

I'm graphing web response, including a line that shows average service 
level (management team loves it!) Essentially, I log a 1 if a poll is 
successful, and a 0 if its not. Unknowns are gray.  Its quite snazzy, 
and an example can be seen here:

Its generated by something that looks like this:
rrdtool graph \www\graphs\webcheck\TEST2_Uptimeday.png _
--title="Uptime Last day, 5 Min Poll" -w 700 -a PNG _
--start=-1d -e -600s -r -l 0.5 _
DEF:Response=\mrtg\log\WebCheck\TEST2.rrd:ds0:AVERAGE _
CDEF:Cleaned=Response,UN,1.0,Response,IF _
CDEF:ResponseSum=PREV,UN,0,PREV,IF,Cleaned,+ _
CDEF:One=Cleaned,-1,GT _
CDEF:Uptime=ResponseSum,OneSum,/ _
CDEF:UptDisp=Uptime,100,* _
CDEF:AboveSLA=Uptime,0.99,GE,Uptime,UNKN,IF _
CDEF:Unknown=Response,UN,INF,UNKN,IF _
AREA:Response#3399ff:"Response from Webserver" _
AREA:Unknown#999999:"Monitoring Offline" _
HRULE:0.99#000000:"SLA 99 %\n" _
LINE3:Uptime#FF0000:"UpTime below SLA" _
LINE3:AboveSLA#00FF00:"Uptime Above SLA\n" _
GPRINT:UptDisp:MAX:"Uptime Max %.2lf %%" _
GPRINT:UptDisp:MIN:"Min %.2lf %%" _
GPRINT:UptDisp:AVERAGE:"Mean %.2lf %%" _
GPRINT:Response:LAST:"Last Reading %.2lf \n" _
COMMENT:"Site Checked: blah - Last Update: blah blah\r"

What I would like to do is add a CDEF that fills the white space in with 
an orange area.

I tried:

AREA:Down#FFAA00:"Site Down"

But the RPN really rattles my brain and I just can't wrap my head around 
it. That gives me an orange line that runs the bottom of all the graphs 
and doesn't fill the area.  I don't want the orange line at all at the 
bottom. I only want to see orange when there is a failure, so 
essentially I want it to be the inverse of the blue area, or "Response".

Could someone give me a clue?



Eric Brander
A: Because people read from top to bottom.
Q: Why should I not top-post?

Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list