[rrd-users] Re: Disk Usage per SNMP?

Alex van den Bogaerdt alex at ergens.op.het.net
Tue Apr 8 00:03:37 MEST 2003


On Mon, Apr 07, 2003 at 09:27:47PM +0200, Hugo van der Kooij wrote:

> Now the object is to make a CDEF string to return the following formula:
> 
> if ( 0.8 < (used/size) <= 0.95 ) {
> 	used+units
> } else {
> 	0
> )
> 
> I settled for:
> 
>         CDEF:normal=used,size,/,$BUSY,LT,used,units,*,0,IF      \
>         CDEF:temp=used,size,/,$BUSY,GT,used,0,IF                        \
>         CDEF:busy=used,size,/,$FULL,LT,temp,units,*,0,IF                \
>         CDEF:full=used,size,/,$FULL,GT,used,units,*,0,IF                \
> 
> Where:
> BUSY=0.8
> FULL=0.95

This is one of many possible solutions.

I prefer something like:

value=used,size,/
normal=value,$BUSY,LE,value,$BUSY,IF
busy=value,$BUSY,GE,value,$FULL,LE,value,$FULL,IF,UN,IF
full=value,$FULL,GE,value,UN,IF

(fill in the used,units,* part yourself)

and then

AREA:normal#00CC00
STACK:busy#FFCC00
FULL:full#FF0000

Unless I made a mistake while thinking or typing, this should do:

if value <= $BUSY
   then normal:=value
   else normal:=$BUSY
if value >= $BUSY
   then if value <= $FULL
      then busy:=value
      else busy:=$FULL
   else busy=UNKNOWN
if value >= $FULL
   then full:=value
   else full:=UNKNOWN

Result: 
A green part that represents "normal" traffic,
a yellow part above this representing "busy" -or- blank
a red part representing "full" -or- blank

Of course, "value" isn't needed, this can be done in-line.
"busy" is the difficult part here.  "value,$FULL,LE,value,$FULL,IF" is the
inner part; its outcome is used in "value,$BUSY,GE,<inner-part>,UN,IF"

HTH
Alex
-- 
Much of what looks like rudeness in hacker circles is not intended to give
offence. Rather, it's the product of the direct, cut-through-the-bullshit
communications style that is natural to people who are more concerned about
solving problems than making others feel warm and fuzzy.

http://www.tuxedo.org/~esr/faqs/smart-questions.html

--
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