[ale] 95th percentile
Chris Fowler
cfowler at outpostsentinel.com
Fri Sep 9 15:18:50 EDT 2011
I'm trying to do something today where I use rrdtool (NOT MRTG) to do
calculations on my desktop eth0 interface and derive the 95th percentile
value. I'm doing this because I would like to be able to independently
monitor my BW usage at Peak 10.
Here is what I've come up with using rrdtool
rrdtool create eth0.rrd \
DS:input:COUNTER:600:U:U \
DS:output:COUNTER:600:U:U \
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:79
Perl stuff:
sub update {
rrdtool update $file N:$rx:$tx
}
graph {
push @cmd, "/usr/bin/rrdtool";
push @cmd, "graph";
push @cmd, "$file_graph";
push @cmd, "DEF:in=$file:input:AVERAGE";
push @cmd, "DEF:out=$file:output:AVERAGE";
push @cmd, "CDEF:base=in,out,MAX";
push @cmd, "VDEF:n95=base,95,PERCENT";
push @cmd, "AREA:in#0000b0:incoming";
push @cmd, "AREA:out#00ff0080:outgoing";
push @cmd, "LINE1:base#000000:maximum";
push @cmd, "LINE1:n95#ff0000:'95%-tile '";
push @cmd, "GPRINT:n95:\"at %.2lf %s\"";
exec it!
}
while(1) {
update();
graph();
sleep(300);
}
My graph is empty and when I do a dump on the file I see no values
being stored.
I'm basically grep '/sbin/ifconfig eth0' for the RX bytes and TX Bytes
value
I know MRTG does this but I want more control by using rrdtool directly.
I've looked at this and am using the examples at the bottom with no
luck:
http://www.geekfarm.org/wu/muse/RRDTool.html
Any people here love rrdtool and know where I'm making a mistake?
Chris
More information about the Ale
mailing list