[rrd-users] How can I calculate % of sum like in mrtg?

Flemming Christensen fc at dsidata.dk
Tue Apr 9 15:46:19 MEST 2002


I'm trying move from mrtg to rrdtool, to get more control of the graphs

 

This is my 12 hours graf (php-code) for data collected from a cisco router:

 

$rrd12 = "rrdtool graph ppp12.png --title=\"PPP Trafik over 12 timer (MAX)\"".
       " --start end-12hours ".
       " --x-grid MINUTE:10:HOUR:1:HOUR:2:0:%R ".
       " --imgformat PNG ".
       " --width 600 --height 150 ".
       " --vertical-label \"Bytes per second\" ".
       " DEF:in=ppp.rrd:ds0:AVERAGE ".
       "  LINE2:in#00FF00:\"In traffic  \"".
       "   GPRINT:in:MAX:\"Max\\: %7.0lf bytes/s\"".
       "   GPRINT:in:MIN:\"Min\\: %7.0lf bytes/s\"".
       "   GPRINT:in:AVERAGE:\"Avg\\: %7.0lf bytes/s\"".
       "   GPRINT:in:LAST:\"Last\\: %7.0lf bytes/s\\l\"".
       " DEF:out=ppp.rrd:ds1:AVERAGE ".
       "  LINE1:out#0000FF:\"Out trafffic\"".
       "   GPRINT:out:MAX:\"Max\\: %7.0lf bytes/s\"".
       "   GPRINT:out:MIN:\"Min\\: %7.0lf bytes/s\"".
       "   GPRINT:out:AVERAGE:\"Avg\\: %7.0lf bytes/s\"".
       "   GPRINT:out:LAST:\"Last\\: %7.0lf bytes/s\"";

exec("rm -f  ppp12.png", $returntxt, $returnflag);   


 
Some questions
 
1. I'm using GPRINT to show max, min, average and last data.
How can I make a percentage of total calculation to show for each like in MRTG ?
 
2. rrdtool is graphing the data in kBytes/s.
How can I make i draw the lines and scale it in kbits/s ?
 
3. What will happen to my data (generated my mrtg)
if I want to graph the peaks (in day, week, month and year graphs) instead of the average?
and is it enough to write: DEF:out=ethernet.rrd:ds1:MAX   ?

 
 

Flemming Christensen

Chefkonsulent

DSI DATA A/S
Kokkedal Industripark 2 | 2980 Kokkedal
Tel. +45 4918 4918 | Fax +45 4918 4944
     www.dsidata.dk | fc at dsidata.dk 

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