[rrd-users] Re: How to draw color graphs

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Wed Jun 13 14:26:46 MEST 2001


Pawel Dworniak wrote:

> I want to draw my graphs in different colors depending on transfer rate
> 

[snip standard stuff]

>       DEF:Incoming1=/Inetpub/wwwroot/mrtg/example.rrd:ds0:MAX
>       DEF:Outgoing1=/Inetpub/wwwroot/mrtg/example.rrd:ds1:MAX
>       CDEF:Incoming=Incoming1,-8,*
>       CDEF:Outgoing=Outgoing1,8,*
>       CDEF:OK=Incoming,6000,GT,0,Incoming,IF

You are multiplying the incoming counter by -1.  Assuming the original
counter has positive values, you end up with negative values.
Then you test for this negative number to be > 6000.  If it is not
(which will always be the case) so OK is just a copy of Incoming.

>       AREA:OK#000000:"OK"
>       AREA:Incoming#00ff00

Here you graph OK, then you paint it over with Incoming.  Nett result
is Incoming.

You want something like:

      DEF:Incoming1=/Inetpub/wwwroot/mrtg/example.rrd:ds0:MAX
      DEF:Outgoing1=/Inetpub/wwwroot/mrtg/example.rrd:ds1:MAX
      CDEF:Incoming=Incoming1,-8,*
      CDEF:Outgoing=Outgoing1,8,*
      CDEF:OK=Incoming,-6000,LT,Incoming,UNKN,IF

Now OK is defined only if Incoming < -6000. 

      AREA:Incoming#00ff00
      AREA:OK#000000:"OK"

This will paint Incoming and then paint it over with OK.  However,
if Incoming is not high enough, there's no OK to paint.

HTH
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. | 
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

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