[mrtg] With "options[target]: gauge" MRTG updates the RRD file with one value, but fetch returns a different (averaged) value

Volk,Gregory B greg.volk at edwardjones.com
Fri Apr 20 12:51:55 CEST 2007


I'm using mrtg to plot the number of users associated with wireless
access point over time. Even though the SNMP var is an integer, I've
noticed non-integers in the data when looking at the output from
"rrdtool dump", and "rrdtool fetch". It appears that there is some
averaging going on inside the RRD file even though the GAUGE variable
type was specified when the RRD file was created. It really doesn't make
sense to do that in this case and fractional numbers of users (for the
Peak and Current values embedded in the graphs) are causing the users
who look at the data to call me and ask how 5.8 users can be attached to
an AP.

Is there anything I can do to disable the gauge averaging in this case?
I don't quite understand why it happens - gauge data doesn't really seem
average-able. I set up a quick & dirty script (outside of MRTG) to
verify what was happening and this is what I'm seeing. I don't know if
it has always been this way or if this is the result of the version 3
rrd format. After five years of doing this you'd think I would have
noticed it before now. ;)



/*load the RRD file with some integers (using updatev for verbosity)*/
~>rrdtool updatev test.rrd N:11:17	
return_value = 0
[1177063800]RRA[AVERAGE][1]DS[ds0] = 8.7693914733e+00
[1177063800]RRA[AVERAGE][1]DS[ds1] = 1.8216695560e+01
[1177063800]RRA[MAX][1]DS[ds0] = 8.7693914733e+00
[1177063800]RRA[MAX][1]DS[ds1] = 1.8216695560e+01
~>
/*fetch the last few data points*/
~>rrdtool fetch test.rrd AVERAGE -s -600s    
                            ds0                 ds1

1177063500: 2.6339290900e+00 2.2189560280e+01
1177063800: 8.7693914733e+00 1.8216695560e+01   <==expected to see 11
and 17 here?
1177064100: NaN NaN
~>
/*wait for a while*/
300 Seconds later - Fri Apr 20 05:16:00 CDT 2007 (1177064160)
/*load some more integers*/
~>rrdtool updatev test.rrd N:18:3     
return_value = 0
[1177064100]RRA[AVERAGE][1]DS[ds0] = 1.6579915180e+01
[1177064100]RRA[AVERAGE][1]DS[ds1] = 5.8401696400e+00
[1177064100]RRA[MAX][1]DS[ds0] = 1.6579915180e+01
[1177064100]RRA[MAX][1]DS[ds1] = 5.8401696400e+00
~>
/*fetch the last few data points*/
~>rrdtool fetch test.rrd AVERAGE -s -600s   
                            ds0                 ds1

1177063800: 8.7693914733e+00 1.8216695560e+01
1177064100: 1.6579915180e+01 5.8401696400e+00    <==expected to see 18
and 3 here
1177064400: NaN NaN
~>
/* rinse and repeat */
300 Seconds later - Fri Apr 20 05:21:00 CDT 2007 (1177064460)
~>rrdtool updatev test.rrd N:28:16
return_value = 0
[1177064400]RRA[AVERAGE][1]DS[ds0] = 2.5970160733e+01
[1177064400]RRA[AVERAGE][1]DS[ds1] = 1.3361208953e+01
[1177064400]RRA[MAX][1]DS[ds0] = 2.5970160733e+01
[1177064400]RRA[MAX][1]DS[ds1] = 1.3361208953e+01
~>
~>rrdtool fetch test.rrd AVERAGE -s -600s
                            ds0                 ds1

1177064100: 1.6579915180e+01 5.8401696400e+001177064400:
2.5970160733e+01 1.3361208953e+01
1177064700: NaN NaN
~>
300 Seconds later - Fri Apr 20 05:26:00 CDT 2007 (1177064760)
~>rrdtool updatev test.rrd N:13:7
return_value = 0
[1177064700]RRA[AVERAGE][1]DS[ds0] = 1.6046936050e+01
[1177064700]RRA[AVERAGE][1]DS[ds1] = 8.8281616300e+00
[1177064700]RRA[MAX][1]DS[ds0] = 1.6046936050e+01
[1177064700]RRA[MAX][1]DS[ds1] = 8.8281616300e+00
~>
~>rrdtool fetch test.rrd AVERAGE -s -600s
                            ds0                 ds1

1177064400: 2.5970160733e+01 1.3361208953e+01
1177064700: 1.6046936050e+01 8.8281616300e+00
1177065000: NaN NaN
~>
300 Seconds later - Fri Apr 20 05:31:00 CDT 2007 (1177065060)
~>rrdtool updatev test.rrd N:20:21
return_value = 0
[1177065000]RRA[AVERAGE][1]DS[ds0] = 1.8577291720e+01
[1177065000]RRA[AVERAGE][1]DS[ds1] = 1.8154583440e+01
[1177065000]RRA[AVERAGE][6]DS[ds0] = 1.4762937374e+01
[1177065000]RRA[AVERAGE][6]DS[ds1] = 1.4431729917e+01
[1177065000]RRA[MAX][1]DS[ds0] = 1.8577291720e+01
[1177065000]RRA[MAX][1]DS[ds1] = 1.8154583440e+01
[1177065000]RRA[MAX][6]DS[ds0] = 2.5970160733e+01
[1177065000]RRA[MAX][6]DS[ds1] = 2.2189560280e+01
~>
~>rrdtool fetch test.rrd AVERAGE -s -600s
                            ds0                 ds1

1177064700: 1.6046936050e+01 8.8281616300e+00
1177065000: 1.8577291720e+01 1.8154583440e+01
1177065300: NaN NaN
~>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20070420/9475d0f1/attachment.html 


More information about the mrtg mailing list