[rrd-users] start time

fadwa salam fadawine at gmail.com
Fri Jul 1 11:56:09 CEST 2011

I have a problem with the fetch command.
I want to recover the data stored for a period . This period is given as an
argument of the script, to check for a varous peroids such 1
the problem is ,when I do the subtraction of this period to the present
timestamp does not work .

$rrdtool fetch power.rrd AVERAGE -s 1h

end=$(date +%s)
time=$2 =1h
let "start=($end-$time)"

ERROR: start time: unparsable trailing text: '...h'
  start time: There should be number after '-'

*if i change 1h by 3600seconds
$rrdtool fetch power.rrd AVERAGE -s 3600

ERROR: start time: did you really mean month 3600?

*I tried to change subtraction by addition*

$rrdtool fetch power.rrd AVERAGE -s 1h

end=$(date +%s)
time=$2 =1h
let "start=($end+$time)"

./hist-conso.sh: line 34: let: start=(1309513267+-1h: value too great for
base (error token is "1h")

*but with 3600 it works *

$rrdtool fetch power.rrd AVERAGE -s 3600

I want to keep addition,but i can not convert each time period to seconds,
especially if I use a very long time.

Thank you very much.
best wishes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20110701/7a5e80be/attachment.htm 

More information about the rrd-users mailing list