Script/command not running, no idea why

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
brendonc
Posts: 7
Joined: Mon Jan 28, 2008 6:53 pm

Script/command not running, no idea why

Post by brendonc »

Greetings,

I've worked on this all day long and am stumped! I created a Data Input Method to get some statistics out of a mysql database. It's supposed to call a python script that returns data in this format:

read_percentage:24 cur_io_per_sec:115 total_ios:34587 cur_kbps:2002 cache_hit_percentage:60

I set up a the data templates, etc. I've gone through my setup 50 times. I've run through the "Debugging NaN" as well. My script simply does not run. I put a few lines at the beginning that writes output to a log file any time it's executed, and cmd.php simply doesn't appear to be executing it!

cacti.log (in debug) shows only this:

01/28/2008 05:55:02 PM - CMDPHP: Poller[0] Host[3] DS[14] WARNING: Result from CMD not valid. Partial Result:
01/28/2008 05:55:02 PM - CMDPHP: Poller[0] Host[3] DS[14] CMD: /tmp/cacti_get_stats.py DS4802 STORAGE SUBSYSTEM TOTALS, output: U

Subsequently, my RRDs get updated with NaN.

I've su'd to cacti, run the script - works. I've done everything I can think of to troubleshoot and fix this. I'm simply not sure why cacti isn't running the script - ideas?

Thanks!

Brendon
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

When you manually execute "/tmp/cacti_get_stats.py DS4802 STORAGE SUBSYSTEM TOTALS", it works properly, right?

Did you include the full path to python in the data input entry path field?
brendonc wrote:I've su'd to cacti, run the script - works
Ummm, so the script works with su rights? You sure the script / python have the correct permissions on them so the web server can execute them?
brendonc
Posts: 7
Joined: Mon Jan 28, 2008 6:53 pm

Post by brendonc »

cmd.php runs the script as cacti out of cron doesn't it? What I meant was, I su'd to the cacti user and ran the script successfully. cmd.php just doesn't appear to be running the script at all and I cannot figure out why.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please visit Utilities and search the Poller log for your target host and the script name. If you find it there, cmd.php should know about it.
Reinhard
brendonc
Posts: 7
Joined: Mon Jan 28, 2008 6:53 pm

Post by brendonc »

I never figured out why this was happening...probably was a permissions problem or something. I converted the script to a data query and everything appears to be working great. Thanks for the input!
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests