[rrd-users] How to store exact value
Denis
rrd at ledeuns.net
Sun Jan 24 18:00:22 CET 2010
Hello,
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 \
.1.3.6.1.4.1.3854.1.2.2.1.16.1.14.0
SNMPv2-SMI::enterprises.3854.1.2.2.1.16.1.14.0 = INTEGER: 234
-------------------------
Here is my fillrrd.sh script (run every minute from cron) :
-------------------------
#!/bin/sh
temperature=`echo "\`/usr/local/bin/snmpget -v 1 -c community \
device.home.lan .1.3.6.1.4.1.3854.1.2.2.1.16.1.14.0\`" | 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
http://oss.oetiker.ch/rrdtool/tut/rrdtutorial.en.html#IData_Resampling.
But in my case I need the exact value at the time I provide it.
Is it possible ?
Thank you in advance,
Denis
More information about the rrd-users
mailing list