[rrd-users] a few question to ask

zura baizura zrbaizura at yahoo.com
Thu Mar 22 04:17:52 CET 2007


Before this i try update data from a text file with
every 5 minutes using crontab.And i got the graph. 
But : 

1)my supervisor wants me to update data using the time
that is a few hours ago. The data is capture and store
in text file .

my question is about:

how to change my script. Before this the script is
using TIMESTAMP=`date +%s`.

and bytheway the time of data is not at every 5
minutes or else because he wants the time is random. i
know that i can update the data manually like in
tutorial but i want the script run it.

has anyway can give me an idea as i am poor in writing
shell script.

-----my last script------

DATA=`tail -1 "${MyHome}rrd/read" | gawk '{print $1}'`
/bin/echo $DATA
TIMESTAMP=`/bin/date +%s`
/bin/rrdtool update sss.rrd $TIMESTAMP:$DATA
/bin/rrdtool fetch sss.rrd LAST --start 1174523678
/bin/rrdtool graph /tmp/voltan.png -s 1174523678 -h
400 \
DEF:voltage=sss.rrd:voltan:LAST \
CDEF:myvoltage=voltage \

------in text file-----------

11.30     2.0
11.33     3.1
11.37     2.1
11.41     3.6
11.43     1.3
11.50     2.2
and so on-----------------

how can i change the time into seconds so i can use
the date in script.

Don't get soaked.  Take a quick peek at the forecast
with the Yahoo! Search weather shortcut.

More information about the rrd-users mailing list