[rrd-users] Re: Script error

This is a discussion on [rrd-users] Re: Script error within the RRD Users forums, part of the Networking and Network Related category; Ok, I changed the crontab file so that each time it runs the results are posted to my screen: */1 * * * * ...


Go Back   Usenet Forums > Networking and Network Related > RRD Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-17-2005
Fabian Borot
 
Posts: n/a
Default [rrd-users] Re: Script error

Ok, I changed the crontab file so that each time it runs the results are
posted to my screen:

*/1 * * * * bash /var/www/html/rrdtool_test/script1.in_act_calls.sh >
/dev/pts/0

That way I can see what happens each time the script runs. I see this :

rrdtool update actv_in_calls.rrd N: 1
rrdtool update actv_in_calls.rrd N: 4
rrdtool update actv_in_calls.rrd N: 12
rrdtool update actv_in_calls.rrd N: 14

These are the last 4 values (last 4 minutes since the script runs each
minute). Now, There is a space between the "N" and the number as you can see
above. (ex. N: 14). If I run the command manually with an space between the
N and the value I get this error:

rrdtool update actv_in_calls.rrd N: 2
ERROR: expected 1 data source readings (got 0) from 2:...

1- So I suspect that the problem is that. Am I right?
2- Why when the cron job runs there is no such error?
3- Finally , how can i fix it ? :-) if possible using bash commands only
since I know nothing about perl, awk, sed


Regards
fabian
fabian
>From: "Fabian Borot" <fborot@hotmail.com>
>To: rrd-users@list.ee.ethz.ch
>Subject: [rrd-users] Script error
>Date: Tue, 17 May 2005 14:14:29 -0400
>
>
>
>Hello
>
>I created a database and I am able to manually update it. Then I can fetch
>the values and graph. Perfect. Manually is working fine.
>
>But now I am trying to update the database using a bash script and all I
>get
>is "nan". I am kind of new to bash scripting so I may have an error. This
>is
>it:
>
>#!/bin/bash
>in_act_calls=$(snmpget -v1 -c <string> <ip_address> <OID> | cut -d: -f4)
>echo "rrdtool update actv_in_calls.rrd N:$in_act_calls"
>
>Below is what I get when trying to fetch:
>
>[root@cactitest rrdtool_test]# rrdtool fetch actv_in_calls.rrd AVERAGE
>--start 1116349686 --end 1116349943
> active_in_calls
>
>1116349680: nan
>1116349740: nan
>1116349800: nan
>1116349860: nan
>1116349920: nan
>1116349980: nan
>
>This is my crontab file:
>*/1 * * * * bash /var/www/html/rrdtool_test/script1.in_act_calls.sh >
>/dev/null 2>&1
>
>and every minute I see this is the cron log: (hre I pasted the last one)
>
>May 17 14:17:01 cactitest crond[6467]: (root) CMD (bash
>/var/www/html/rrdtool_test/script1.in_act_calls.sh > /dev/null 2>&1)
>
>I suspect that I am not handling the variable the right way but I havent
>been able to spot the error.
>Can somebody tell me what is wrong with the script ?
>
>Regards
>Fabian
>
>
>--
>Unsubscribe mailto:rrd-users-request@list.ee.ethz.ch?subject=unsubscribe
>Help mailto:rrd-users-request@list.ee.ethz.ch?subject=help
>Archive http://lists.ee.ethz.ch/rrd-users
>WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
>



--
Unsubscribe mailto:rrd-users-request@list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request@list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-users
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:07 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0