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


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

and then


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

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"

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.


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