Perl module not running

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
marros
Posts: 2
Joined: Thu May 10, 2012 4:26 pm

Perl module not running

Post by marros »

I have a perl module, check_smcli_io, to monitor an IBM DS5000 SAN. The command runs fine from the command line as a standard user, and also as the nagios user, but will not run from nagios. Actually, that is not true. It creates a file in a directory owned by nagios.nagios, and fails if the file is not found, or processes the data and then deletes it. If the file doesn't exit, it returns with an error, but if I create the file, the command completes with success, but the data doesn't get updated.I have disabled embedded perl, and stripped down my config files to eliminate and configuration erros. I have also added some debugging info where the file that it creates then deletes also get created in the /tmp directory, but this doesn't get updated either. Can anybody help me?

Thanks
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Perl module not running

Post by jsmurphy »

I'm not 100% sure I actually understand what your issue is, it was a very disjointed read. If I understand correctly when executed via Nagios/NRPE then it's failing to perform actions on the files.

Is the script run locally on the Nagios server or on a remote server? If it's run remotely via NRPE I have seen the same issue before if you try to use relative paths in your script instead of the full path.
marros
Posts: 2
Joined: Thu May 10, 2012 4:26 pm

Re: Perl module not running

Post by marros »

Thanks for your reply, and sorry for the post being so disjointed. I am running it locally on the nagios server, and when I manually run it, it works, but when I let nagios handle it, it doesn't work. The script goes out and collects data from the SAN unit, creates a temporary file, parses the data, puts it into a rrd database, then deletes the temp file. If it doesn't create the temp file, it exits with an error to nagios, so nagios flags it with the SAN is not responding. If I change the script to not delete the temp file and run it manually, it seems to work for a while, but then it stops updating again. From what I am thinking is, when I manually run it, it takes about 24 seconds for data to come back, and nagios isn't waiting long enough and continues on with the script, so the temp file doesn't get created, the script then exits with an error. Is that possible? If you google cehck_smcli_io, you can see what the code looks like, and from the authors site, it seems he has it working.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Perl module not running

Post by jsmurphy »

Your assumption could be correct, I can't remember if the default max execution time is 30 seconds or 60 seconds... check your service_check_timeout in nagios.cfg, it may also be worthwhile disabling the embedded perl handler and seeing if that makes a difference. What's the actual error message it displays? Is it a timeout? Execution failure? Our good old friend error 127?
Locked