[rrd-users] Re: Percentages in RRDTool

Chris Marlow marlowc at us.ibm.com
Fri Feb 9 15:28:15 MET 2001


I understand how percentages get calculated, it was the proceedure for
putting them in the graph I was unclear about.  But I think you may have
helped.  For example, my graphing command currently looks as follows (In my
Perl script):

    $GraphCommand = $BinPath . " graph " . $WorkPath . $Machine . '
-month.png '.
     '--start -2678400 ' .
     '--title="Interface traffic for ' . $Machine . '" ' .
     '--vertical-label "bits per second" ' .
     '--imgformat PNG ' .
     '--color CANVAS#DDDDDD ' .
     '--color BACK#EEEEEE ' .
     '--height 350 ' .
     '--width  600 ' .
     'DEF:inoctets=' . $DatabaseFile . ':input:AVERAGE ' .
     'CDEF:inbits=inoctets,8,* ' .
     'DEF:outoctets=' . $DatabaseFile . ':output:AVERAGE ' .
     'CDEF:outbits=outoctets,8,* ' .
     'COMMENT:"                            Max           Average
Last\n" ' .
     'AREA:inbits#FFCC00:"Inbound Traffic " ' .
     'GPRINT:inbits:MAX:"%10.4lf %sbps" ' .
     'GPRINT:inbits:AVERAGE:"%10.4lf %sbps" ' .
     'GPRINT:inbits:LAST:"%10.4lf %sbps\n" ' .
     'LINE1:outbits#CC66FF:"Outbound traffic" ' .
     'GPRINT:outbits:MAX:"%10.4lf %sbps" ' .
     'GPRINT:outbits:AVERAGE:"%10.4lf %sbps" ' .
     'GPRINT:outbits:LAST:"%10.4lf %sbps\n" ';


So if I understand correctly, I should put a:
CDEF:inpercent=inoctects,"maximum speed attainable",/,100,*

And then a GPRINT later on:   GPRINT:inpercent:MAX:"%10.4lf %sbps"

What do you think??  Thanks again for the help.

-Chris

-----
Christopher S. Marlow
IBM
AIX Infrastructure / 24x7 Security
Burlington, VT
Phone: 802-769-3253
Tie line: 446-3253
e-mail: marlowc at us.ibm.com

---------------------- Forwarded by Chris Marlow/Burlington/Contr/IBM on
02/09/2001 09:20 AM ---------------------------



Alex van den Bogaerdt <alex at slot.hollandcasino.nl> on 02/09/2001 09:11:08
AM


To:   Chris Marlow/Burlington/Contr/IBM at IBMUS
cc:

Subject:  Re: [rrd-users] Percentages in RRDTool




Chris Marlow wrote:

> Does anyone have a quick and dirty way of getting the traffic PERCENTAGES
> into the graph?  I'm processing the data through a perl script, so even
if
> it's not an option for the graphing, I could always add it in by hand
with
> the script.  The trouble is, I don't know how to get the percentages.
Any
> help would be appreciated

Calculating percentages is "per" "cent".

current/maximum == x/100

Calculate by which number you need to divide "maximum" to get 100.
Divide "current" by the same number et voila, there's your percentage.

For instance:128kbps out of a maximum of 256kbps:
You need to divide 256000 by 2560 to get 100.
Also divide 128000 by 2560 to get 50.  This means 128kbps is
50% of 256kbps.

Now, in a CDEF:  percent=current,2560,/

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