[check_postgres] Output is not Nagios standard - causing critical to show as unknown

Lightner, Jeff jlightner at water.com
Mon Nov 1 17:28:02 UTC 2010


Excuse me if this posted before but I don't see it in the archives.
I'd tried to post it before subscribing last week and it said a
moderator had to approve it.   Since it isn't in the archives I'm
guessing it wasn't approved.  I'm reposting since I subscribed after the
original.

 

Hi,

 

First thanks for making this tool.

 

I installed the most recent download of check_postgres.pl on my Nagios
server and did setup to check basic database connectivity for another
server.   (I created user nagios in the postgresql installation on the
other server).

 

The command line I run from the Nagios master is:

check_postgres.pl --host ATLPGPD1 --port 5432 --action=connection --db
postgres -u nagios

 

This works fine and shows "OK" and single line of output when the
database is up on server atlpgpd1 but when I shut it down there the
output I see is:

 

ERROR: could not connect to server: Connection refused

        Is the server running on host "ATLPGPD1" and accepting

        TCP/IP connections on port 5432?

 

If I run "echo $?" it correctly shows the exit status is 3 which means
Nagios should show it as CRITICAL.    Instead it is showing it as
UNKNOWN.  I believe this is occurring because of the extraneous output
after the first ERROR line.    Nagios expects only one line of output
and the documentation for check_postgres.pl says it only outputs one
line.   Adding "-output=nagios" doesn't help.  (In fact I see pretty
much the same 3 lines whether I use nagios, simple or mrtg.)   I looked
at other options and didn't see any that would help to suppress the
extra 2 lines.  Piping it through "head -1" isn't an option because it
changes status code to 0 (presumably due to success of th head command.


 

Can you suggest what I need to do to avoid having the extra lines
output?
 
Proud partner. Susan G. Komen for the Cure.
 
Please consider our environment before printing this e-mail or attachments.
----------------------------------
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.
----------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mail.endcrypt.com/pipermail/check_postgres/attachments/20101101/e2417542/attachment.html 


More information about the Check_postgres mailing list