Page 1 of 1

Perl module not running

Posted: Thu May 10, 2012 4:35 pm
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

Re: Perl module not running

Posted: Thu May 10, 2012 6:13 pm
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.

Re: Perl module not running

Posted: Fri May 11, 2012 9:39 am
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.

Re: Perl module not running

Posted: Fri May 11, 2012 5:17 pm
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?