[rrd-users] Re: Getting a different 'average'

Serge Maandag serge.maandag at staff.zeelandnet.nl
Tue Feb 18 15:12:30 MET 2003

David Gabler submitted a 95% script to the list 2 weeks ago, you can
find it at:

I altered it a bit to have it calculate the value over other periods
besides 1 month. 
I added the command line parameter --start.

I just call the script before I generate the graph:

my $perc95 = `/path/95th.pl --file /path/database.rrd --start $Period -d
for ($perc95){
     /ds0:(\d+)/ && do {$in_95 =$1} or do {$in_95 =0};
     /ds1:(\d+)/ && do {$out_95=$1} or do {$out_95=0};

Then I convert the values to a cdef to be able to use GPRINT's %s


A CDEF needs to perform calculations on a DEF, so I stuck in the bogus
"in,0,*" meaning "0 times in" and added the 95th percentile to it.

In the legend of the graph I print the 95th percentile values with :

GPRINT:in_95:AVERAGE:%6.2lf %sbps
GPRINT:out_95:AVERAGE:%6.2lf %sbps


-----Original Message-----
From: Adam Denenberg [mailto:adam at dberg.org] 
Sent: Tuesday, February 18, 2003 2:41 PM
To: Serge Maandag; Buttery, Daniel; rrd-users at list.ee.ethz.ch
Subject: Re: [rrd-users] Re: Getting a different 'average'


 Do you mind if I ask how you got those 95th Percentile parts of your
I would love to see the additions to your rrdgraph statements to make


On 2/18/03 6:09 AM, "Serge Maandag" <serge.maandag at staff.zeelandnet.nl>

> You can do this:
> - in your script that generates the graph, first call another rrdtool
> graph with a different start and end time.
> - capture the output from the print statement.
> - print a comment in your graph "COMMENT:Between noon and midnight\:
> $value Bps on average"
> If you still want to use the %s option you need to trick a bit by
> converting your value to a cdef, but that's a different story.
> Serge.
> p.s. I took some time to study this, this is what my graphs look like:
> http://www.ee.ethz.ch/~slist/pantomime/rrdtool-example.gif

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