[rrd-users] doubt behavior database RRD

spiderslack spiderslack at yahoo.com.br
Thu Jun 26 22:23:13 CEST 2014


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/a708df1d/attachment.htm 


More information about the rrd-users mailing list