[rrd-users] doubt behavior database RRD

Steve Shipway s.shipway at auckland.ac.nz
Fri Jun 27 01:19:58 CEST 2014


The problem you have is that by default, when you create the RRD, the last
update time is set to 'now'.   It sets up an initial set of 'unkown' RRA
stretching back intime from the last update time.

 

Then you subsequently use 'rrdtool first' which returns the time of the
START of the RRA, and attempt to update using this.  

 

Of course, it does not work, because this time is in the past, and you can
only update by adding new records with a time after the LAST update.

 

This is probably counterintuitive to you, as you might think you need to
allocate the records that you are intending to update in advance.  In fact,
with RRDtool, you do not do this and records are automatically created and
expired by the RRD mechanism.

 

So, rather than using 'rrdtool first', try using 'rrdtool lastupdate' and
incrementing from that.

 

Steve

 

Steve Shipway

s.shipway at auckland.ac.nz

 

From: rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch
[mailto:rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] On
Behalf Of spiderslack
Sent: Friday, 27 June 2014 8:23 a.m.
To: rrd-users at lists.oetiker.ch
Subject: [rrd-users] doubt behavior database RRD

 

Hi all.

i testing the database rrd. I create the shellscript follow bellow:


------------------- test.sh ----------------------
set -x
ARQUIVO_RRD="kakaroto.rrd"
rm $ARQUIVO_RRD
rrdtool create $ARQUIVO_RRD             \
                    --start N --step 15         \
                    DS:dados:COUNTER:20:U:U   \
                    RRA:AVERAGE:0.5:1:60       \


date +%s
INICIO=$( rrdtool first $ARQUIVO_RRD )
ATUAL=$INICIO
sleep 15
INICIO=$( expr $INICIO + 15)
rrdtool update $ARQUIVO_RRD $INICIO:10
---------------------------------------------------

when execute the shell script

--------------------
[ricardobarbosa at shark transito]$ bash eeee.sh
+ ARQUIVO_RRD=kakaroto.rrd
+ rm kakaroto.rrd
+ rrdtool create kakaroto.rrd --start N --step 15 DS:dados:COUNTER:20:U:U
RRA:AVERAGE:0.5:1:60
+ date +%s
1403813403
++ rrdtool first kakaroto.rrd
+ INICIO=1403812515
+ ATUAL=1403812515
+ sleep 15
++ expr 1403812515 + 15
+ INICIO=1403812530
+ rrdtool update kakaroto.rrd 1403812530:10
ERROR: kakaroto.rrd: illegal attempt to update using time 1403812530 when
last update time is 1403813403 (minimum one second step)
[ricardobarbosa at shark transito]$
---------------------------
[ricardobarbosa at shark transito]$ bash eeee.sh
+ ARQUIVO_RRD=kakaroto.rrd
+ rm kakaroto.rrd
+ rrdtool create kakaroto.rrd --start N --step 15 DS:dados:COUNTER:20:U:U
RRA:AVERAGE:0.5:1:60
+ date +%s
1403813422
++ rrdtool first kakaroto.rrd
+ INICIO=1403812530
+ ATUAL=1403812530
+ sleep 15
++ expr 1403812530 + 15
+ INICIO=1403812545
+ rrdtool update kakaroto.rrd 1403812545:10
ERROR: kakaroto.rrd: illegal attempt to update using time 1403812545 when
last update time is 1403813422 (minimum one second step)
[ricardobarbosa at shark transito]$


--------------------

The value th output command (rrdtool first) is correct? should not be the
current epoch, since it was not updated anything in the file. rrd?

in the last example the timestamp used when creating the rrd file is
1403813422, but the output of command (rrdtool first) he shows how the
timestamp 1403812530 is smaller. The value of the output of the command
(rrdtool first) should not be at least 1403813XXX.



each execution of the script I delete the rrd file. he should not reset? it
seems that he is guarding the first of the previous file. If someone can
help me understand I thank.


Regards.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20140626/7c0f92f7/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5909 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20140626/7c0f92f7/attachment-0001.bin 


More information about the rrd-users mailing list