[rrd-users] How to store exact value

Denis rrd at ledeuns.net
Sun Jan 24 18:00:22 CET 2010


I created a rrd base :
$ rrdtool create temp.rrd --step '60' \
   'DS:temp:GAUGE:90:U:U' 'RRA:LAST:0.5:1:1440'

This one is used to store temperatures got from an snmp device.
$ /usr/local/bin/snmpget -v 1 -c community device.home.lan \ 
SNMPv2-SMI::enterprises.3854. = INTEGER: 234

Here is my fillrrd.sh script (run every minute from cron) :
temperature=`echo "\`/usr/local/bin/snmpget -v 1 -c community \ 
device.home.lan .\`" | awk \
'BEGIN {in_put=0} {if ($NF) {in_put=$NF}} END {print in_put}'`
/usr/local/bin/rrdtool update /home/test/temp.rrd N:$temperature

(I double-checked, the returned value is an integer : "234" in that case)

If I check the written data in temp.rrd, I got :
$ rrdtool fetch temp.rrd LAST
1264351380: 2.3612731083e+02
1264351440: 2.3600000000e+02
1264351500: 2.3506428832e+02
1264351560: 2.3500000000e+02
1264351620: 2.3406449040e+02
1264351680: nan


I'd like to store only 2.3400000000e+02 and not 2.3406449040e+02
I tried to create a base with LAST or MIN or MAX as RRA CF and GAUGE or 
ABSOLUTE as DS DST but with no luck. It seems RRD just want to average 
the provided value.

I can understand that it is done for a counter as it is explained in 
But in my case I need the exact value at the time I provide it.

Is it possible ?

Thank you in advance,

More information about the rrd-users mailing list