problem with poller.php!

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
kosta
Posts: 18
Joined: Fri May 06, 2005 12:55 pm

problem with poller.php!

Post by kosta »

I have a problem, and I upgraded from .86i to .87a hoping it was an issue with cactid / cacti.

I have installed spine now and this upgraded version of cacti, but still get a problem with a script I run.

When run with spine:

/usr/local/spine/bin/spine -f 5 -l 5 -C /etc/cactid.conf


I get this:

01/17/2008 12:15:36 PM - SPINE: Poller[0] Host[5] DS[1165] SCRIPT: /bin/sh /usr/local/apache/sites/cacti.4rnd.com/html/scripts/sms.sh, output: wip:641 wipretry:26 error:178 okretry0:169402 okretry1:352 okretryg1:19


In the cacti.log file when it is run through the poller.php cronjob I get this:

01/17/2008 11:55:02 AM - SPINE: Poller[0] Host[5] DS[1165] WARNING: Result from SCRIPT not valid. Partial Result: wip: wipretry: error...
01/17/2008 11:55:02 AM - SPINE: Poller[0] Host[5] DS[1165] SCRIPT: /bin/sh /usr/local/apache/sites/cacti.4rnd.com/html/scripts/sms.sh, output: U


any reason why that would happen? I have searched the forum, but dont seem to find anything that is related.

Thank you,

Kosta
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

In most cases, custom scripts that fail this way use implicit a $PATH setting to find specific binaries used within the script. But cactiuser does not have this $PATH.
Make sure to provide /full/path/to/everything that is used in your script.
Reinhard
kosta
Posts: 18
Joined: Fri May 06, 2005 12:55 pm

Post by kosta »

which='/usr/bin/which'
mysql=`which mysql`
tail=`which tail`
sed=`which sed`
echo=`which echo`
cut=`which cut`


Thats everything that I use in the script


thanks,

kosta
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

This will fail. "which" depends on a valid $PATH being set. Please provide /full/path/to/everything verbosely
Reinhard
kosta
Posts: 18
Joined: Fri May 06, 2005 12:55 pm

Post by kosta »

wow, I always go through the trouble to use $which, but I forgot to put a $ in front of it, grr!! I will know in 5 minutes if it will work, but im assuming that is the problem!

Thank you,

Kosta
kosta
Posts: 18
Joined: Fri May 06, 2005 12:55 pm

Post by kosta »

still shows that output: U

This is the script:

#!/bin/sh

mysql='/usr/bin/mysql'
tail='/usr/bin/tail'
echo='/bin/echo'
awk='/bin/awk'

data=`$mysql -ppass real_long_query_here" | $tail -1 `

$echo $data | $awk '{print "wip:"$1" wipretry:"$2" error:"$3" okretry0:"$4" okretry1:"$5" okretryg1:"$6}';

What else do you think it might be, as it works on the command line, and user the user cacti runs as

thanks,

kosta
kosta
Posts: 18
Joined: Fri May 06, 2005 12:55 pm

Post by kosta »

mysql did not have -u flag, thanks for the help =]

BTW this gave me time to upgrade to the lastest version of cacti, congrats again for all the good work =]


kosta
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests