<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>With "options[target]: gauge" MRTG updates the RRD file with one value, but fetch returns a different (averaged) value</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">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.</FONT></SPAN></P>
<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Is there anything I can do to disable the gauge averaging in this case? I don't quite understand why it happens - gauge data</FONT> <FONT SIZE=2 FACE="Arial">doesn't really seem</FONT> <FONT SIZE=2 FACE="Arial">average-able. I set up a quick & dirty script (outside of MRTG) to verify what was happening and this is what I'm seeing.</FONT><FONT SIZE=2 FACE="Arial"> 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. ;)</FONT></SPAN></P>
<BR>
<BR>
<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">/*load the RRD file with some integers (using updatev for verbosity)*/</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~>rrdtool updatev test.rrd N:11:17 </FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">return_value = 0</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177063800]RRA[AVERAGE][1]DS[ds0] = 8.7693914733e+00</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177063800]RRA[AVERAGE][1]DS[ds1] = 1.8216695560e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177063800]RRA[MAX][1]DS[ds0] = 8.7693914733e+00</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177063800]RRA[MAX][1]DS[ds1] = 1.8216695560e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~></FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">/*fetch the last few data points*/</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~>rrdtool fetch test.rrd AVERAGE -s -600s </FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial"> ds0 ds1</FONT></SPAN>
</P>
<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177063500: 2.6339290900e+00 2.2189560280e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177063800: 8.7693914733e+00 1.8216695560e+01 <==expected to see 11 and 17 here?</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177064100: NaN NaN</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~></FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">/*wait for a while*/</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">300 Seconds later - Fri Apr 20 05:16:00 CDT 2007 (1177064160)</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">/*load some more integers*/</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~>rrdtool updatev test.rrd N:18:3 </FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">return_value = 0</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064100]RRA[AVERAGE][1]DS[ds0] = 1.6579915180e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064100]RRA[AVERAGE][1]DS[ds1] = 5.8401696400e+00</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064100]RRA[MAX][1]DS[ds0] = 1.6579915180e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064100]RRA[MAX][1]DS[ds1] = 5.8401696400e+00</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~></FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">/*fetch the last few data points*/</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~>rrdtool fetch test.rrd AVERAGE -s -600s </FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial"> ds0 ds1</FONT></SPAN>
</P>
<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177063800: 8.7693914733e+00 1.8216695560e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177064100: 1.6579915180e+01 5.8401696400e+00 <==expected to see 18 and 3 here</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177064400: NaN NaN</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~></FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">/* rinse and repeat */</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">300 Seconds later - Fri Apr 20 05:21:00 CDT 2007 (1177064460)</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~>rrdtool updatev test.rrd N:28:16</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">return_value = 0</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064400]RRA[AVERAGE][1]DS[ds0] = 2.5970160733e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064400]RRA[AVERAGE][1]DS[ds1] = 1.3361208953e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064400]RRA[MAX][1]DS[ds0] = 2.5970160733e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064400]RRA[MAX][1]DS[ds1] = 1.3361208953e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~></FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~>rrdtool fetch test.rrd AVERAGE -s -600s</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial"> ds0 ds1</FONT></SPAN>
</P>
<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177064100: 1.6579915180e+01 5.8401696400e+001177064400: 2.5970160733e+01 1.3361208953e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177064700: NaN NaN</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~></FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">300 Seconds later - Fri Apr 20 05:26:00 CDT 2007 (1177064760)</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~>rrdtool updatev test.rrd N:13:7</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">return_value = 0</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064700]RRA[AVERAGE][1]DS[ds0] = 1.6046936050e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064700]RRA[AVERAGE][1]DS[ds1] = 8.8281616300e+00</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064700]RRA[MAX][1]DS[ds0] = 1.6046936050e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177064700]RRA[MAX][1]DS[ds1] = 8.8281616300e+00</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~></FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~>rrdtool fetch test.rrd AVERAGE -s -600s</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial"> ds0 ds1</FONT></SPAN>
</P>
<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177064400: 2.5970160733e+01 1.3361208953e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177064700: 1.6046936050e+01 8.8281616300e+00</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177065000: NaN NaN</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~></FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">300 Seconds later - Fri Apr 20 05:31:00 CDT 2007 (1177065060)</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~>rrdtool updatev test.rrd N:20:21</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">return_value = 0</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177065000]RRA[AVERAGE][1]DS[ds0] = 1.8577291720e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177065000]RRA[AVERAGE][1]DS[ds1] = 1.8154583440e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177065000]RRA[AVERAGE][6]DS[ds0] = 1.4762937374e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177065000]RRA[AVERAGE][6]DS[ds1] = 1.4431729917e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177065000]RRA[MAX][1]DS[ds0] = 1.8577291720e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177065000]RRA[MAX][1]DS[ds1] = 1.8154583440e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177065000]RRA[MAX][6]DS[ds0] = 2.5970160733e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">[1177065000]RRA[MAX][6]DS[ds1] = 2.2189560280e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~></FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~>rrdtool fetch test.rrd AVERAGE -s -600s</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial"> ds0 ds1</FONT></SPAN>
</P>
<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177064700: 1.6046936050e+01 8.8281616300e+00</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177065000: 1.8577291720e+01 1.8154583440e+01</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">1177065300: NaN NaN</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">~></FONT></SPAN>
</P>
</BODY>
</HTML>