[check_postgres] Nagios Status unknown

Jürgen Schulz-Brüssel | Fotofinder Gmb Jürgen Schulz-Brüssel | Fotofinder Gmb
Mon Jun 15 15:42:48 UTC 2009


Hi,

I am just about to use check_postgres for our Nagios and found two
issues I am wondering about. Basically it is all about the unknown
status of Nagios. When I first run the Nagios check:

check_postgres.pl --action=backends

I had the problem that the number of max_connections was already
exceeded. The postgres server is returns:

'FATAL:  sorry, too many clients already'

I really do not understand why a fatal error is handled as an unknown
status (Line 1633). As a first approach I changed

 if ($db->{error} =~ /FATAL/) {
        ndie "$db->{error}";
 }

to

if ($db->{error} =~ /FATAL/) {
        add_critical $db->{error};
        $db->{ok} = 1;
 }

In fact I am not sure about $db->{ok} = 1;

Just to check if everything is fine, I shut down the postgres server and
checked the Nagios again. I was a little bit astonished to learn that

'could not connect to server: Connection refused'

is a status unknown, too. As an result I changed the exit code of 'ndie'
to 2 rather than using 3 before.

I did not go through the archive yet. Has there been discussion on this
subject here before. Are there any arguments to terminate these
obviously critical errors as status unknown?

Best regards
    Juergen

-- 
Fotofinder GmbH         USt-IdNr. DE812854514
Software Entwicklung    Web: http://www.fotofinder.com/
Potsdamer Str. 96       Tel: +49 30 25 79 28 90
10785 Berlin            Fax: +49 30 25 79 28 999

Geschäftsführer:  Ali Paczensky
Amtsgericht:      Berlin Charlottenburg (HRB 73099)
Sitz:             Berlin 



More information about the Check_postgres mailing list