[rrd-users] Re: Calculate area from graph?

Warnes, Jason SDH warnesj at sdh.sk.ca
Wed May 29 07:56:17 MEST 2002


That is very strange.  I think I screwed up the program I sent you.  I
didn't take into account that you're probably storing SNMP Octets instead of
bits in your RRDTool database file.  That examination for $val's>1000000 may
not be right.  You may want to test it against 125000 instead to take into
account that there are 8 bits in an octet.  Sorry about that.

Since you're sampling so quickly I'm not sure that you've taken this into
account when you sized your RRA's.  For example with your
RRA:AVERAGE:0.5:1:600 that would store 600 entries which are an average of 1
10 second sample, giving you 10 minutes worth of values in that RRA.  With
the next RRA:AVERAGE:0.5:6:700 that would store 700 entries which are an
average of the previous 6 samples, giving you about 11.6 hours of samples.
I think you see where I'm going here.  The same holds true for the MAX
values.  I think that the FETCH is pulling from an RRA that doesn't have the
resolution you're looking for.  It looks like you may have got those values
from the RRD Tutorial or something which uses that to demonstrate examining
a network device every 5 minutes.  I think you may need to up your stored
samples to their current values *30 (since there is 30 10second intervals in
5 minutes).

If I'm way off base here, just tell me and I'll see if I can think of
anything else.

Jason...

-----Original Message-----
From: Fredrik X [mailto:fredrik at pulsesoft.com] 
Sent: May 28, 2002 12:17 AM
To: 'Warnes, Jason SDH'
Cc: rrd-users at list.ee.ethz.ch
Subject: RE: [rrd-users] Re: Calculate area from graph?


Hi, 
I tried using fetch to sum the values over 1mbps, but im getting different
results... For example: 18/5-23/5 returns 453.65MB
		 19/5-23/5 returns  92.08MB (!)
             20/5-23/5 returns 542.46MB 

This is pretty annoying. 


To create my RRA i use a a perlscript:

(...)

$speed = $data{$SystemName}{'ifSpeed'}
@interface_rrd = ("DS:InBits:COUNTER:600:0:$speed",
			"DS:OutBits:COUNTER:600:0:$speed",
			"RRA:AVERAGE:0.5:1:600",
			"RRA:AVERAGE:0.5:6:700",
			"RRA:AVERAGE:0.5:24:775",
			"RRA:AVERAGE:0.5:288:797",
			"RRA:MAX:0.5:1:600",
			"RRA:MAX:0.5:6:700",
			"RRA:MAX:0.5:24:775",
			"RRA:MAX:0.5:288:797");

(...)

if(RRDs::create ("$rrd_store/$rrdfile", "--step=10", @interface_rrd)) 

(...)


Im currently running this script every 10 seconds.
Is there something wrong with this picture?

// Fredrik


> -----Original Message-----
> From: rrd-users-bounce at list.ee.ethz.ch
> [mailto:rrd-users-bounce at list.ee.ethz.ch] On Behalf Of 
> Warnes, Jason SDH
> Sent: den 27 maj 2002 20:06
> To: 'Fredrik X'; rrd-users at list.ee.ethz.ch
> Subject: [rrd-users] Re: Calculate area from graph?
> 
> 
> 
> You could try running a fetch for the week and add up all the
> bytes that are
> >1Mbps.  If you're using Perl it would be something like this:
> 	Assuming: You have the RRD shared module loaded in Perl
> 	          Your file is called 'bandwidth.rrd' for
> example purposes
> 
> ---Start Code---
> # Fetch a week's worth (604800 seconds) of data from bandwidth.rrd my 
> ($start,$step,$names,$data)=RRDs::fetch("bandwidth.rrd","AVERA
> GE","--start=-
> 604800");
> # Reset the over limit count to zero
> $totalover1Mbps=0;
> # Examine each line returned from the fetch
> foreach my $line (@$data) {
> 	# Examine each value on each line returned by the fetch
> 	foreach my $val (@$line) {
> 		if($val > 1000000) {	# The value is greater 
> that 1Mbps
> 			# Add the amount over 1Mbps to a total
> over counter
> 			$totalover1Mbps=$totalover1Mbps+($val-1000000);
> 		}
> 	}
> }
> ---End Code---
> 
> Then you should have a scalar called $totalover1Mpbs that you
> should be able to include in a comment on the graph 
> somewhere.  I have to warn you, I'm pretty new at Perl so 
> this might not be the most efficient way of doing things
> 
> Just a thought.
> 
> Jason...
> 
> -----Original Message-----
> From: Fredrik X [mailto:fredrik at pulsesoft.com]
> Sent: May 27, 2002 1:23 AM
> To: rrd-users at list.ee.ethz.ch
> Subject: [rrd-users] Calculate area from graph?
> 
> 
> Hello,
> 
> Im having some trouble with the graph...
> 
> I've attached a graph that shows all peaks over 1mbps with a
> gray area, is it possible to calculate this area? The result 
> should be total bytes transferred during these peaks.
> 
> //Fredrik
> 
> 
> -- Attached file removed by Listar and put at URL below --
> -- Type: image/gif
> -- Size: 18k (18741 bytes)
> -- URL : http://www.ee.ethz.ch/~slist/pantomime/monitor.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
> 
> --
> 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