[rrd-users] Newbie Question Storing Absolute Values versus Average

Karl Fischer rrd-users at ficos.de
Wed Jun 4 21:28:33 CEST 2008


Guy Fleegman wrote:
> Hello:
> 
> I have read all the examples I could find on rrd but i have having a
> tough time. The data is not acting in the way I expect.
> 
> What I want to do is feed an rrd data from an SNMP get via cron.
> 
> The problem however is that i am not getting the data vales recorded
> in the archive the way i think they should be created
> (I am missing something in my understanding)
> 
> Here is an example and what i think it means
> 
> If I create a rrd with
> 
> rrdtool create test3.rrd --start now --step 60 DS:in:GAUGE:120:U:U
> DS:out:GAUGE:120:U:U DS:busyper:GAUGE:120:U:U RRA:LAST:0.5:1:60
> 
> 
> So if I test this by running
> 
> rrdtool updatev N 10:10:10
> 
> I get no data showing up

Chris,

if you define a --step 60 the rrd will only accept one update per minute
and creation counts as one update. So if you create the rrd at 21:04:51
and try to update it at 21:04:56 it will not accept the update. However,
if you try to update it after the minute-rollover at 21:05:01, it's goin
to work:

root at tux:/tmp# date ; rrdtool create test3.rrd --start now --step 60 \
               DS:in:GAUGE:120:U:U  DS:out:GAUGE:120:U:U \
               DS:busyper:GAUGE:120:U:U  RRA:LAST:0.5:1:60
Wed Jun  4 21:04:51 CEST 2008

root at tux:/tmp# date ; rrdtool updatev test3.rrd N:10:10:10
Wed Jun  4 21:04:56 CEST 2008
return_value = 0

root at tux:/tmp# date ; rrdtool updatev test3.rrd N:10:10:10
Wed Jun  4 21:05:01 CEST 2008
return_value = 0
[1212606300]RRA[LAST][1]DS[in] = 1.0000000000e+01
[1212606300]RRA[LAST][1]DS[out] = 1.0000000000e+01
[1212606300]RRA[LAST][1]DS[busyper] = 1.0000000000e+01


put the following example into a script and call it to see what happens:

--- snip

#!/bin/bash

date "+%Y-%m-%d %T (%s)"

rrdtool create test3.rrd --start now --step 5 DS:in:GAUGE:120:U:U \
  DS:out:GAUGE:120:U:U DS:busyper:GAUGE:120:U:U RRA:LAST:0.5:1:60

echo created.

while true; do
  date "+%Y-%m-%d %T (%s)"
  rrdtool updatev test3.rrd N:10:10:10
  sleep 1
done

--- snap


hth

- Karl






More information about the rrd-users mailing list