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

Fredrik X fredrik at pulsesoft.com
Tue May 28 08:17:20 MEST 2002


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