[rrd-users] Re: GAUGE not functioning correctly?

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Sat Aug 12 02:45:02 MEST 2000

Cade M. Robinson wrote:
> I setup RRDTool both alone and in MRTG and they are screwing up the
> numbers passed in when I want a GAUGE.

No, they're not.  It is expected behaviour.

If you want to keep the exact values you have to make sure that the
values are entered into the database at exactly the right moment.
If you let RRDtool do its calculations (as you do when you do not
enter the values at those intervals) they will be recalculated.

The values are expected to be valid during the period ending at the
time you enter them.

Let's do an experiment:
rrdtool create bla.rrd -s 00:00 DS:x:GAUGE:600:U:U RRA:AVERAGE:0.5:1:5
rrdtool update bla.rrd `date -d 00:05:00 +%s`:1000
rrdtool update bla.rrd `date -d 00:10:15 +%s`:2000
rrdtool update bla.rrd `date -d 00:15:00 +%s`:3000
rrdtool update bla.rrd `date -d 00:20:00 +%s`:4000
rrdtool dump bla.rrd

output of the dump, after cleaning up a lot:
 <!-- 2000-08-12 00:00:00 MET DST --> <row><v> NaN </v></row>
 <!-- 2000-08-12 00:05:00 MET DST --> <row><v> 1.00000000e+03 </v></row>
 <!-- 2000-08-12 00:10:00 MET DST --> <row><v> 2.00000000e+03 </v></row>
 <!-- 2000-08-12 00:15:00 MET DST --> <row><v> 2.95000000e+03 </v></row>
 <!-- 2000-08-12 00:20:00 MET DST --> <row><v> 4.00000000e+03 </v></row>

The values are exact, except for the 00:10:00...00:15:00 period.  During
that period the value has been 2000 during 15 seconds, 3000 during the
remaining 285 seconds.

   15/300*2000 + 285/300*3000
== 30000/300 + 855000/300
== 875000/300
== 2950
== 2.95e+3

If you use your timestamps and values you will find that the same rule
can be applied.

 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |

Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list