[rrd-users] Re: rrdupdate with UNKNOWN and 0 value

ralf-buero at kruedewagen.de ralf-buero at kruedewagen.de
Wed Jul 27 09:17:04 MEST 2005


Hi Tobias,
here is an example. When updating the database with absolute 
timestamps (sample 1), everything is okay.
But the sample 2 is using N as timestamp for updates. Here you see, 
that only 0 values are stored to database.

#### Script #############
#!/bin/bash

# First sample: update with absolute timestamp
rrdtool create unknown-0-1.rrd   \
	    --start 1122415200 \
	    --step 60 \
            DS:DS1:GAUGE:240:0:100   \
            DS:DS2:GAUGE:240:0:U   \
            RRA:AVERAGE:0.5:1:1440

rrdtool updatev unknown-0-1.rrd 1122415260:U:0
rrdtool updatev unknown-0-1.rrd 1122415320:U:0
rrdtool updatev unknown-0-1.rrd 1122415380:U:0
rrdtool updatev unknown-0-1.rrd 1122415440:U:0

rrdtool fetch unknown-0-1.rrd AVERAGE --start 1122415200 --end 
1122415440

############
# Second sample: update with N timestamp each 60 seconds

rrdtool create unknown-0-2.rrd   \
	    --start 1122415200 \
	    --step 60 \
            DS:DS1:GAUGE:240:0:100   \
            DS:DS2:GAUGE:240:0:U   \
            RRA:AVERAGE:0.5:1:1440

i=1
while [ $i -lt 6 ]; do
  rrdtool updatev unknown-0-2.rrd N:U:0
  sleep 60
  i=$(($i+1))
done

rrdtool fetch unknown-0-2.rrd AVERAGE --start -6min



++++++++++++++++++++++ Output ++++++++++++++++++++++++
./test-rrd-unknown-0
return_value = 0
[1122415260]RRA[AVERAGE][1]DS[DS1] = NaN
[1122415260]RRA[AVERAGE][1]DS[DS2] = 0.0000000000e+00
return_value = 0
[1122415320]RRA[AVERAGE][1]DS[DS1] = NaN
[1122415320]RRA[AVERAGE][1]DS[DS2] = 0.0000000000e+00
return_value = 0
[1122415380]RRA[AVERAGE][1]DS[DS1] = NaN
[1122415380]RRA[AVERAGE][1]DS[DS2] = 0.0000000000e+00
return_value = 0
[1122415440]RRA[AVERAGE][1]DS[DS1] = NaN
[1122415440]RRA[AVERAGE][1]DS[DS2] = 0.0000000000e+00
                            DS1                 DS2

1122415260: nan 0.0000000000e+00
1122415320: nan 0.0000000000e+00
1122415380: nan 0.0000000000e+00
1122415440: nan 0.0000000000e+00
return_value = 0
[1122415260]RRA[AVERAGE][1]DS[DS1] = NaN
[1122415260]RRA[AVERAGE][1]DS[DS2] = NaN
[1122415320]RRA[AVERAGE][1]DS[DS1] = NaN
...
...
return_value = 0
[1122447360]RRA[AVERAGE][1]DS[DS1] = 0.0000000000e+00
[1122447360]RRA[AVERAGE][1]DS[DS2] = 0.0000000000e+00
return_value = 0
[1122447420]RRA[AVERAGE][1]DS[DS1] = 0.0000000000e+00
[1122447420]RRA[AVERAGE][1]DS[DS2] = 0.0000000000e+00
return_value = 0
[1122447480]RRA[AVERAGE][1]DS[DS1] = 0.0000000000e+00
[1122447480]RRA[AVERAGE][1]DS[DS2] = 0.0000000000e+00
return_value = 0
[1122447540]RRA[AVERAGE][1]DS[DS1] = 0.0000000000e+00
[1122447540]RRA[AVERAGE][1]DS[DS2] = 0.0000000000e+00
                            DS1                 DS2

1122447300: nan nan
1122447360: 0.0000000000e+00 0.0000000000e+00
1122447420: 0.0000000000e+00 0.0000000000e+00
1122447480: 0.0000000000e+00 0.0000000000e+00
1122447540: 0.0000000000e+00 0.0000000000e+00
1122447600: nan nan
1122447660: nan nan
#######################

Cheers
Ralf

On Wednesday 27 July 2005 00:33, Tobias Oetiker wrote:
> Yesterday Salvatore D. Tepedino wrote:
> > On Tue, 2005-07-26 at 23:32 +0200, Tobias Oetiker wrote:
> > > Since N: ist the curren time, this seems to be bad for
> > > reproducing anything ...
> > >
> > > please try creating a demo script using absolute time including
> > > an absolute --start time when creating the rrd file ...
> >
> > I'm not sure what you're suggesting here. Normally, I create a
> > rrd DB without specifying a start time (doesn't it default to
> > now?) then updates after this would be inserted at the current
> > time (N). Why should that cause a unknown value to be stored as
> > 0?
>
> it does not cause it, but if I am going to look at the problem I
> need a reproducible example, and that must not have any things in
> it that change whenever one tries the example ...
>
> cheers
> tobi

-- 
Ralf Kruedewagen
Systems Integration
Ericsson GmbH, Germany
Tel:    +49-211-534-2640
Fax:    +49-211-534-3743
Mobile: +49-172-2166741
mailto:Ralf.Kruedewagen at ericsson.com

-- Attached file removed by Ecartis and put at URL below --
-- Type: application/x-shellscript
-- Size: 930 bytes
-- URL : http://lists.ee.ethz.ch/p/test-rrd-unknown-0


--
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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list