check_postgres
check_postgres copied to clipboard
checking more than one host or port = only checks first one and reports
I can't get it to check more than one host or port. I've tried both version 2.22.0 and 2.21.0.
This is not working as advertised Connection options can be grouped: --host=a,b --host=c --port=1234 --port=3344 would connect to a-1234, b-1234, and c-3344
I find it checks the first one only and reports the issue. A single host and single port works fine. You can add as many hosts and ports as you want in different combinations. There is no error, but the result is that it will report on the first host and first port it checks only. Below is a 2 ports example but --host=a,b --port=1234 has the same result, only host a results are reported.
nagios1@nagios01:/usr/local/nagios/libexec>` ./check_postgres --host=somehost --port=5432,5433 -action=backends -u postgres2 -w 3% -c 4% --timeout 60
POSTGRES_BACKENDS CRITICAL: DB "postgres" (host:somehost) (port=5432) 4 of 100 connections (4%) | time=2.64s postgres=1;3;4;0;100 somehost=3;3;4;0;100 template0=0;3;4;0;100 template1=0;3;4;0;100