postgres.pl custom_query

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
GPsysadmin
Posts: 2
Joined: Sun Mar 25, 2012 12:59 pm

postgres.pl custom_query

Post by GPsysadmin »

I have created a check using postgres.pl custom_query. The check runs and inserts a string into the result column. The result is either "GOOD" or "BAD". The critical level has been set to use a string and the string is "BAD". The check works and returns either of the strings I mentioned but is in a critical state no matter what the result is. When it is bad it is critical and sending out alerts and when it is good it is critical and sending out alerts.

Please help me figure this out. Thanks!
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: postgres.pl custom_query

Post by jsmurphy »

Need more information, are you able to provide the parts where your script exits? Have you set the appropriate exit codes in your script?
exit 0 = OK
exit 1 = WARNING
exit 2 = CRITICAL
exit 3 = UNKNOWN

Does it exit correctly on the command line?
GPsysadmin
Posts: 2
Joined: Sun Mar 25, 2012 12:59 pm

Re: postgres.pl custom_query

Post by GPsysadmin »

It was the exit codes! I had copied my script over from another we had in use and did not think to re-evaluate the exit codes. Thanks for helping me out!
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: postgres.pl custom_query

Post by jsmurphy »

You're welcome :)
Locked