[rrd-users] Re: stupid GRAPH COMMENT formatting question

Chris Marlow marlowc at us.ibm.com
Tue Feb 13 16:08:27 MET 2001



Try something like this - my stats line up great....

    $GraphCommand = $BinPath . " graph " . $WorkPath . $Machine . '-day.png
'.
     '--start -86400 ' .
        '--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,* ' .
        'CDEF:inpercent=inoctets,' . $MaxBytes . ',/,100,* ' .
     'DEF:outoctets=' . $DatabaseFile . ':output:AVERAGE ' .
        'CDEF:outbits=outoctets,8,* ' .
        'CDEF:outpercent=outoctets,' . $MaxBytes . ',/,100,* ' .
     'CDEF:totalpercent=outpercent,inpercent,+ ' .
        'COMMENT:"                                  Max
Average                      Last\n" ' .
        'AREA:inbits#FFCC00:"Inbound Traffic " ' .
        'GPRINT:inbits:MAX:"%10.4lf %sbps" ' .
     'GPRINT:inpercent:MAX:"(%5.2lf%%)" ' .
        'GPRINT:inbits:AVERAGE:"%10.4lf %sbps" ' .
     'GPRINT:inpercent:AVERAGE:"(%5.2lf%%)" ' .
        'GPRINT:inbits:LAST:"%10.4lf %sbps" ' .
     'GPRINT:inpercent:LAST:"(%5.2lf%%)\n" ' .
     'LINE1:outbits#CC66FF:"Outbound traffic" ' .
        'GPRINT:outbits:MAX:"%10.4lf %sbps" ' .
     'GPRINT:outpercent:MAX:"(%5.2lf%%)" ' .
        'GPRINT:outbits:AVERAGE:"%10.4lf %sbps" ' .
     'GPRINT:outpercent:AVERAGE:"(%5.2lf%%)" ' .
        'GPRINT:outbits:LAST:"%10.4lf %sbps" ' .
     'GPRINT:outpercent:LAST:"(%5.2lf%%)\n" ' .
     'GPRINT:totalpercent:MAX:"Total percentages                    (%5.2lf%%)" ' .
     'GPRINT:totalpercent:AVERAGE:"                 (%5.2lf%%)" ' .
     'GPRINT:totalpercent:LAST:"                 (%5.2lf%%)\n" ' .
     'COMMENT:"    (Max is maximum percentage used at one time)" ';

    $GraphResults = `$GraphCommand`;

This is run as a Perl script, so let me know if you don't understand one of the variables.

-Chris

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


"Matt Ashfield" <mda at unb.ca>@list.ee.ethz.ch on 02/13/2001 09:56:57 AM

Sent by:  rrd-users-bounce at list.ee.ethz.ch


To:   "RRD users" <rrd-users at list.ee.ethz.ch>
cc:
Subject:  [rrd-users] stupid GRAPH COMMENT formatting question




Hi All,

I'm trying to display some comments on my graph of in and out traffic of a
router interface. Basically, the very simple, straightforward:
 Max  Average  Last
And obviously I want my stats to line up underneath. Basically, the rrdtool
graph command does not seem to accept any line breaks or tab sets...Is
there
a way to do this? My rrdtool graph command is as follows:

/usr/local/bin/rrdtool graph $dir/$gif5
--start -1d
--title="Traffic for last day"
 --vertical-label "bits/sec"
--color CANVAS#DDDDDD
--color BACK#EEEEEE
--height 350 --width 600
DEF:inoctets=$rrdfile:input:AVERAGE DEF:outoctets=$rrdfile:output:AVERAGE
CDEF:inbits=inoctets,8,* CDEF:inpercent=inoctets,$MaxBytes,/,100,*
CDEF:outbits=outoctets,8,* CDEF:outpercent=outoctets,$MaxBytes,/,100,*
COMMENT:"Max Average Last\n"
AREA:inbits#FFCC00:"Inbound Traffic"
GPRINT:inbits:MAX:"%10.4lf %sbps"
GPRINT:inpercent:MAX:"(%04.2lf%%)"
GPRINT:inbits:AVERAGE:"%10.4lf %sbps" GPRINT:inpercent:AVERAGE:"
(%04.2lf%%)"
GPRINT:inbits:LAST:"%10.4lf %sbps"
GPRINT:inpercent:LAST:"(%04.2lf%%)\n"
LINE1:outbits#CC66FF:"Outbound traffic"
GPRINT:outbits:MAX:"%10.4lf %sbps"
GPRINT:outpercent:MAX:"(%04.2lf%%)"
GPRINT:outbits:AVERAGE:"%10.4lf %sbps"
GPRINT:outpercent:AVERAGE:"(%04.2lf%%)"
GPRINT:outbits:LAST:"%10.4lf %sbps"
GPRINT:outpercent:LAST:"(%04.2lf%%)\n"`


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





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