[mrtg] RRD Graphs
Steve Shipway
s.shipway at auckland.ac.nz
Wed Sep 3 08:59:56 CEST 2008
>From: mrtg-bounces at lists.oetiker.ch [mailto:mrtg-bounces at lists.oetiker.ch] >On Behalf Of James Riccard
...
>The first problem is that the MAX and AVERAGE values are always the same
>for hourly and daily reports. For greater time frames, say yearly, I get
>the expected different values?
This is correct. The reason is that your normal MRTG-generated RRD file holds four AVG RRAs and four MAX RRAs, corresponding to daily, weekly, monthly and yearly. The number of samples making up a data point are 1, 6, 24, and 288 respectively (if you have a 1-min interval, then these will be 1, 30, 120, 1440 instead).
When you make and hourly or a daily graph, you will use the first RRA since this has the smallest data sample (5min).
Since the first RRA has only 1 sample per data point, then of course MAX = AVG. For weekly, monthly and yearly you will use the second, third and fourth RRAs which have more samples per data point and so MAX > AVG.
>Secondly, can somebody, using the above example show me how to get
>everything into nice neet and tidy colums, my values are getting
>printed all over the place and I can't seem to get the spacing correct.
You probably don't want to use them like this; the average of the max is not so useful. Also, the MIN is not going to be correct as you don't have a MIN RRA in your RRD file (unless you add one).
To put them into columns just add the required number of spaces into your GPRINT statements, and use the %lf options to fix the display width; however, something like this is probably best (aligned to show where the spaces are):
"DEF:IfIn=$rrd_location/$file1.rrd:ds0:AVERAGE",
"DEF:IfInMax=$rrd_location/$file1.rrd:ds0:MAX",
"DEF:IfOut=$rrd_location/$file1.rrd:ds1:AVERAGE",
"DEF:IfOutMax=$rrd_location/$file1.rrd:ds1:MAX",
"GPRINT:IfIn:LAST In :%5.0lf%sb/s ",
"GPRINT:IfIn:AVG In :%5.0lf%sb/s ",
"GPRINT:IfInMax:MAX In :%5.0lf%sb/s\\n",
"GPRINT:IfOut:LAST Out:%5.0lf%sb/s ",
"GPRINT:IfOut:AVG Out :%5.0lf%sb/s ",
"GPRINT:IfOutMax:MAX Out :%5.0lf%sb/s\\n",
Coincidentally, this is approximately the way both MRTG and Routers2 do it.
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20080903/149028ff/attachment.html
More information about the mrtg
mailing list