[rrd-users] rrdtool create --start parameter
Holger.VanKoll at swisscom.com
Holger.VanKoll at swisscom.com
Mon Jan 13 17:58:19 MET 2003
Hello,
thx to Tobias Oetiker for rrdtool and to Alex van den Bogaerdt (and
others) for his contributions to this list.
My question is: What --start parameter should I give to "rrdtool create"
when I dont know what the first update-time will be?
After reading the rrdtool manpage I assumed this parameter is just a
check to avoid insertion of too old data.
But thats wrong... I dont get the same .rrd-contents when setting this
parameter to different values, at least if those values differ more than
heartbeat-step of the DS.
I looked through the archives for anything regarding the --start
parameter and (only) found a hint that starttime divided by heartbeat
should give an integer.
But also when I care about this, I still see missing data or data where
I didnt enter anything.
Simple example:
root at 0-tvgicsc1 620# cat mkrrd2
#!/bin/sh
rrd="/usr/local/bin/rrdtool"
rrdfile=./test.rrd
STEP=600
DSF=GAUGE:6000:0:100
RRF1=AVERAGE:0.5:1:144
OFFSET=$1
stime="2003-01-12"
stime_u=`/usr/local/bin/gnudate -d "$stime 0:00" +%s` # $stime
in "secs since 1.1.1970"; this is 1042326000
let starttime=$stime_u+$OFFSET
let utime=1042326600 # first
update time
echo creating $rrdfile with start $starttime
rm -f $rrdfile
$rrd create $rrdfile --start $starttime --step $STEP \
DS:user:$DSF RRA:$RRF1 DS:system:$DSF RRA:$RRF1 \
DS:idle:$DSF RRA:$RRF1 DS:wait:$DSF RRA:$RRF1
$rrd update $rrdfile -t user:system:idle:wait $utime:10:10:80:20 ; let
utime=$utime+$STEP
$rrd update $rrdfile -t user:system:idle:wait $utime:20:20:50:10 ; let
utime=$utime+$STEP
$rrd update $rrdfile -t user:system:idle:wait $utime:30:30:30:10 ; let
utime=$utime+$STEP
$rrd fetch $rrdfile AVERAGE -s 1042326000 -e $utime
root at 0-tvgicsc1 674# ./mkrrd2 0
creating ./test.rrd with start 1042326000
user system idle wait
1042326000: NaNQ NaNQ NaNQ NaNQ
1042326600: 1.0000000000e+01 1.0000000000e+01 8.0000000000e+01
2.0000000000e+01
1042327200: 2.0000000000e+01 2.0000000000e+01 5.0000000000e+01
1.0000000000e+01
1042327800: 3.0000000000e+01 3.0000000000e+01 3.0000000000e+01
1.0000000000e+01
1042328400: NaNQ NaNQ NaNQ NaNQ
Great. Looks as expected.
root at 0-tvgicsc1 681# ./mkrrd2 -600
creating ./test.rrd with start 1042325400
user system idle wait
1042326000: 1.0000000000e+01 1.0000000000e+01 8.0000000000e+01
2.0000000000e+01
1042326600: 1.0000000000e+01 1.0000000000e+01 8.0000000000e+01
2.0000000000e+01
1042327200: 2.0000000000e+01 2.0000000000e+01 5.0000000000e+01
1.0000000000e+01
1042327800: 3.0000000000e+01 3.0000000000e+01 3.0000000000e+01
1.0000000000e+01
Ok, I can live with that. But why do I have data at 1042326000 when I
didnt enter anything?
root at 0-tvgicsc1 685# ./mkrrd2 -6000 # or anything greater
than 5400 instead of 6000
creating ./test.rrd with start 1042320000
user system idle wait
1042326000: NaNQ NaNQ NaNQ NaNQ
1042326600: NaNQ NaNQ NaNQ NaNQ
1042327200: 2.0000000000e+01 2.0000000000e+01 5.0000000000e+01
1.0000000000e+01
1042327800: 3.0000000000e+01 3.0000000000e+01 3.0000000000e+01
1.0000000000e+01
1042328400: NaNQ NaNQ NaNQ NaNQ
Here is my problem. I just changed the --start time to more than
(date_of_first_data_entered - [heartbeat-step]).
Now the (entered) data at 1042326600 went away.
What happens here? I think rrdtool tries to consolidate
data_of_1042326600, with the last update, and this is the --start
parameter in this case (concerning date, unknown data), so its more than
heartbeat secs older --> unknown data for the whole interval.
If my thinking is correct, the answer to my question "which
startparameter when first update-time is unknown" is obviously: "You
cannot create a rrd if you dont know the date of the first data you will
put in".
Hopefully I am missing something ;-)
Regards,
Holger
--
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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the rrd-users
mailing list