Say, I was writing values to a database, then stopped doing so, and now I want to continue starting from current point in time. As far as I can see, if I fail to write something within heartbeat
seconds, it stops writing to the database:
#!/usr/bin/env bash
set -eu
DIR=$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")
SCRIPT=$(basename -- "$(readlink -f -- "${BASH_SOURCE[0]}")")
start=1420729200
echo start: $start $(date -d @$start)
rrdtool create "$DIR/1.rrd" \
--start "$start" \
--step 300 \
DS:g:GAUGE:600:U:U \
RRA:MAX:0.5:1:10
rrdtool update "$DIR/1.rrd" $(( start + 601 )):111
rrdtool dump "$DIR/1.rrd"
What am I doing wrong? What is heartbeat
exactly? I thought it defines how many adjacent input values are used for interpolating PDP
values. What am I missing?
UPD If I do update
with $start
timestamp value, I get:
ERROR: /home/yuri/_/1.rrd: illegal attempt to update using time 1420729200 when last update time is 1420729200 (minimum one second step)
So it works for $(( start + 1 ))
to $(( start + 600 ))
including both ends. I don't get errors when I do update with $(( start + >600 ))
.