Page 1 of 1

postgres.pl custom_query

Posted: Sun Mar 25, 2012 2:17 pm
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!

Re: postgres.pl custom_query

Posted: Mon Mar 26, 2012 8:04 pm
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?

Re: postgres.pl custom_query

Posted: Mon Mar 26, 2012 10:32 pm
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!

Re: postgres.pl custom_query

Posted: Tue Mar 27, 2012 9:11 pm
by jsmurphy
You're welcome :)