[rrd-users] rrdgraph anomaly ?
Ulrich David
david.ulrich at siesa.ch
Tue Feb 13 00:07:30 CET 2007
Hi,
I use rrdtool to monitor a counter on fiber switch. I get results in
bytes from snmp requests. I put them in a rrd db :
- DS:out:COUNTER:600:U:U
- DS:in:COUNTER:600:U:U
- RRA:AVERAGE:0.5:1:600 # for a good resolution drawing a 2 day graph
- RRA:AVERAGE:0.5:1:3100 # for a good resolution drawing a 1 month graph
What I need is an exact result of number of bytes, each first of the
month. For examples : 15,56Go form port 1 to port 15 and from port 15
to 1 from the 1 january at 0h00 to the 1 february at 0h00. It could
be 50Mo or 200,56Go :) ...
I have a lot of switch and a lot of ports. Each port is assigned to
an person.
I have made some try but I have no stable results.
For example I have a person I monitor for 10 days. When I draw a
graph of inbound, outbound and total the results differ when I change
the width or the height of the graph image !!? It could differ for
about 1-2%... On 1Go data transfer it's nothing, but on 50Go...
I don't understand the reason why this. I can understand that the
graph/draw is not exact, but why the GPRINT/PRINT of the results are
different?
I have read all tutorials. I know that the graph are a bit made to
match the resolution of the image but why the GPRINT are modified??
How can I know which result is exact? How can I compute the error?
Finally, perharps the best question :) ,
Have I a better option to compute exactly one month of traffic? Is it
possible to only stock the exact value of the counter is the DB and
not only differences? With this option I could draw a nice graph and
get a real result at the end of the month doing just a substract of
the first counter value to the last counter value.
David
--------------------------
Here is my graph function (in perl). The results differ when I only
change width and height (I try "--no-gridfit" and "--alt-autoscale"
but without more success) :
push(@graph_args, $img_full_path);
push(@graph_args, "--imgformat=$img_format");
push(@graph_args, "--color=BACK#FFFFFF");
push(@graph_args, "--color=SHADEA#FFFFFF");
push(@graph_args, "--color=SHADEB#FFFFFF");
push(@graph_args, "--font=DEFAULT:0:/var/www/html/css/
ArialRoundedMTBold.ttf");
#push(@graph_args, "--slope-mode");
push(@graph_args, "--start=$start_time", "--end=$end_time");
# databases
push(@graph_args, "DEF:inoctets_u=$self->
{RRDDB_PATH}"."$db_name.rrd:in:AVERAGE");
push(@graph_args, "DEF:outoctets_u=$self->
{RRDDB_PATH}"."$db_name.rrd:out:AVERAGE");
push(@graph_args, "CDEF:inoctets=inoctets_u,UN,
0,inoctets_u,IF");
push(@graph_args, "CDEF:outoctets=outoctets_u,UN,
0,outoctets_u,IF");
push(@graph_args, "CDEF:total_bytes=inoctets,outoctets,+");
push(@graph_args, "CDEF:in_traffic=inoctets,8,/");
push(@graph_args, "CDEF:out_traffic=outoctets,8,/");
# calc the averages
push(@graph_args, "VDEF:av_in=in_traffic,AVERAGE");
push(@graph_args, "VDEF:av_out=out_traffic,AVERAGE");
# calc total
push(@graph_args, "VDEF:total=total_bytes,TOTAL");
push(@graph_args, "VDEF:total_in=inoctets,TOTAL");
push(@graph_args, "VDEF:total_out=outoctets,TOTAL");
push(@graph_args, "COMMENT:\t\t\td?bit moyen\t\ttotal".'\c');
push(@graph_args, "CDEF:minusout=0,out_traffic,-");
push(@graph_args, "AREA:in_traffic#54EC48:Trafic entrant \\:
\t");
push(@graph_args, "LINE1:in_traffic#24BC14");
push(@graph_args, "GPRINT:av_in:%6.3lf %sb/s \t");
push(@graph_args, "GPRINT:total_in:%6.3lf %so".'\c');
push(@graph_args, "AREA:minusout#ECD748:Trafic sortant \\:
\t");
push(@graph_args, "LINE1:minusout#C9B215");
push(@graph_args, "GPRINT:av_out:%6.3lf %sb/s \t");
push(@graph_args, "GPRINT:total_out:%6.3lf %so".'\c');
push(@graph_args, "COMMENT: Total entrant et sortant \\:
\t \t");
push(@graph_args, "GPRINT:total:%11.3lf %so".'\c');
push(@graph_args, "--vertical-label=Sortant <- bits par
seconde -> Entrant");
push(@graph_args, "--width=600");
push(@graph_args, "--height=400");
push(@graph_args, "--title=Trafic entrant et sortant");
More information about the rrd-users
mailing list