[rrd-users] problem update with crontab

zura baizura zrbaizura at yahoo.com
Wed Mar 14 06:24:27 CET 2007


heloo...

im using redhat 8.0 and rrdtool 1.2.15
my propose using rrdtool is for graphing my collection
of data from just a simple electronic circuit.

i called my electronic circuit as 'sensor' because  it
can gave me a value of voltage(eg:4.4V,3.1V and so on
...)every 5 minutes.

so with the data , i want to show a graph that's why i
use rrdtool .


my project using rrdtool now at the stage to update .
i have create a bash script , here it is.
-----------my_script_CREATE-----------------------
#!/bin/sh
rrdtool create sss.rrd --step 300 \
DS:voltan:GAUGE:600:0:U   \
RRA:LAST:0.5:1:200

---------------my_script_UPDATE---------------------
#!/bin/sh
         DATA=`gawk {print $1} | tail -1 
/home/baizura/percubaan/reading`
        echo $DATA
        TIMESTAMP=`date +%s`
        echo $TIMESTAMP
        rrdtool update sss.rrd $TIMESTAMP:$DATA
rrdtool fetch sss.rrd LAST --start 1173839600
------------------------------------------------


my problem is every time i run my script , i can get
the result like below:
[root at localhost percubaan]# ./lost.sh
gawk: cmd. line:2: (END OF FILE)
gawk: cmd. line:2: parse error
2.0
1173848729
                         voltan

1173839700: 2.0000000000e+00
1173840000: nan
1173840300: nan
1173840600: nan
1173840900: nan
1173841200: nan
1173841500: nan
1173841800: nan
1173842100: nan
1173842400: 2.0000000000e+00
1173842700: 2.0000000000e+00
1173843000: nan
1173843300: nan
1173843600: nan
1173843900: nan
1173844200: nan
1173844500: 2.0000000000e+00
1173844800: 2.0000000000e+00
1173845100: 2.0000000000e+00
1173845400: 2.0000000000e+00
1173845700: 2.0000000000e+00
1173846000: nan
1173846300: nan
1173846600: nan
1173846900: nan
1173847200: nan
1173847500: 2.0000000000e+00
1173847800: nan
1173848100: nan
1173848400: nan
1173848700: nan
1173849000: nan
[root at localhost percubaan]#
------------------------------------------------
i am tired to run many time by enter( ./myscript.sh)
if im not run my script the data not update...

-----------------------------------------------
so that why i try use crontab. But there is error with
crontab.look below:
>From root at localhost.localdomain  Wed Mar 14 12:45:01
2007
Return-Path: <root at localhost.localdomain>
Received: from localhost.localdomain
(localhost.localdomain [127.0.0.1])
	by localhost.localdomain (8.12.5/8.12.5) with ESMTP
id l2E4j15W010328
	for <root at localhost.localdomain>; Wed, 14 Mar 2007
12:45:01 +0800
Received: (from root at localhost)
	by localhost.localdomain (8.12.5/8.12.5/Submit) id
l2E4j16S010321
	for root; Wed, 14 Mar 2007 12:45:01 +0800
Date: Wed, 14 Mar 2007 12:45:01 +0800
Message-Id:
<200703140445.l2E4j16S010321 at localhost.localdomain>
From: root at localhost.localdomain (Cron Daemon)
To: root at localhost.localdomain
Subject: Cron <root at localhost>
/home/baizura/percubaan/lost.sh>>/home/baizura/percubaan/sss.rrd
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>

gawk: cmd. line:2: (END OF FILE)
gawk: cmd. line:2: parse error
ERROR: opening 'sss.rrd': No such file or directory
ERROR: opening 'sss.rrd': No such file or directory
-----------------------------------------------------
please... help me to fix the crontab error...

 
 

 


 
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news



More information about the rrd-users mailing list