Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
Hi all,
I've problem with my scripts. I can run them manually with correct results, however poller seems to not run them - one of that script is customized ping script and in intermediate firewall log I can see packets generated by the script with manual run, but I can't see any periodically repeated packet that shoud be generated by the script with poller run...
11/11/2011 08:36:02 AM - SPINE: Poller[0] Host[37] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
11/11/2011 08:36:02 AM - SPINE: Poller[0] Host[37] DS[674] SCRIPT: perl /var/www/cacti/scripts/ping.pl 192.168.254.10, output: U
11/11/2011 08:36:02 AM - SPINE: Poller[0] Host[37] DS[674] WARNING: Result from SCRIPT not valid. Partial Result: ...
11/11/2011 08:36:02 AM - SPINE: Poller[0] Host[37] ERROR: Empty result [192.168.254.10]: 'perl /var/www/cacti/scripts/ping.pl 192.168.254.10'
11/11/2011 08:36:02 AM - SPINE: Poller[0] Host[37] DEBUG: The POPEN returned the following File Descriptor 9
11/11/2011 08:36:02 AM - SPINE: Poller[0] Host[37] DS[673] SCRIPT: perl /var/www/cacti/scripts.ping2.pl 192.168.254.10, output: U
11/11/2011 08:36:02 AM - SPINE: Poller[0] Host[37] DS[673] WARNING: Result from SCRIPT not valid. Partial Result: ...
11/11/2011 08:36:02 AM - SPINE: Poller[0] Host[37] ERROR: Empty result [192.168.254.10]: 'perl /var/www/cacti/scripts.ping2.pl 192.168.254.10'
11/11/2011 08:36:02 AM - SPINE: Poller[0] Host[37] DEBUG: The POPEN returned the following File Descriptor 9
How can the result of script be empty? Manual run returns a value, so as cron job (I controled it in Webmin)...
I'm not as good in linux as I'd like to be, so that I do not know all possibilities of this behaviour.
Damned, I'm sorry for editting the post. The problem is really in using spine. I've notices a typo in Data Input Method for the custom script - and it works with cmd.php (as the "deafult" ping script does), however no script does work with spine...
I do not know, how to redirect stdout from spine command (using '>' or '| tee' does not work), however with DEVEL log level I can see just some error I've already posted:
Run it as the poller user from the command line using "./spine -R -V 3". Also, we specifically ask you to use the full path to 'perl' in your data input methods. This is due to the fact that we do not pass the users environment to the scripts. This is done to increase performance and reduce load. Make sure that when you are done, that the poller cache contains the entire path to perl.
So, if you follow the rules, generally things work just fine.
TheWitness
True understanding begins only when we realize how little we truly understand...
I modified the Data Input Methods to use full perl path, but this didn't helped.
TheWitness wrote:Run it as the poller user from the command line using "./spine -R -V 3".
Please, could you guide me? I'm not "linux-aware", I'm just 'advanced user'. I do not know the 'www-data' user password so I cannot log in as that user... I can run cron job as that user, however I do not know how to redirect the output of spine command to the file (as I wrote, the ways I know - " > file.txt" and "| tee file.txt" don't work)...
I'm sorry for very log time response, I've been out of office...
See the result of 'spine -S -R -V 3 > spine.txt' command in attachement. It seems as all is ok, however the perl script don't work with spine poller...
I just realize I run the script as root, not as www-data - I've created the cron job with run as www-data and the result is different - in spine.txt there is the same errors as in cacti log with spine as poller.
Well, it's permission problem, am I right?
May be this is significant - when I run the cron job, I get this warnings:
Insecure $ENV{PATH} while running setuid at /var/www/cacti/scripts/linux_memory.pl line 3.
Insecure $ENV{PATH} while running setuid at /var/www/cacti/scripts/linux_memory.pl line 3.
Insecure $ENV{PATH} while running setuid at /var/www/cacti/scripts/loadavg_multi.pl line 4.
Insecure $ENV{PATH} while running setuid at /var/www/cacti/scripts/unix_users.pl line 8.
Insecure $ENV{PATH} while running setgid at /var/www/cacti/scripts/ping.pl line 7.
Insecure $ENV{PATH} while running setgid at /var/www/cacti/scripts/ping3.pl line 7.
Insecure $ENV{PATH} while running setuid at /var/www/cacti/scripts/ping3.pl line 7.
Insecure $ENV{PATH} while running setgid at /var/www/cacti/scripts/ping2.pl line 7.
Insecure $ENV{PATH} while running setgid at /var/www/cacti/scripts/ping3.pl line 7.