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.
Hello, wondering if anyone might be able to help me out... I'm new to Nagios and received a JSON perl (custom) perl script from a developer... only problem is it doesn't seem to output any useful data to Nagios... I receive "(Service check did not exit properly)" ... I'm not sure that the script is correctly formated for proper output... but very lost ... here's a copy of the code if anyone can take a peek and advise... Thank you...
My guess is that you have embedded perl enabled in nagios and this script does not obey the restrictions that entails. You should either disable embedded perl (set enable_embedded_perl=0 in nagios.cfg) or rewrite the script to follow these guidelines.
the script outputs "CRITICAL"... and displayed the number 2... which seems to match with the exit codes listed. Maybe something in the command structure is causing an issue... I left it pretty basic just for testing...
I can honestly say I've never encountered a problem like this before, the command definition looks alright as well. One last ditch effort might be to see if there's an issue running that script under the nagios user context, su - nagios then run the script and echo $? as mguthrie suggested and see if it fails then... I'm really hoping it spews out an error of some description. I think that's the first time I've ever hoped for an execution failure.
no failure... seems to work considering the same output was successful. oh well, guess I'll need to find another JSON script... maybe something from the Nagios plugin archive...
Sorry I can't help any further. I'm not sure how exactly you could go about debugging why it's only failing with Nagios exectuion... especially considering you have disabled the internal perl handler; it just doesn't make any sense.