-
Notifications
You must be signed in to change notification settings - Fork 174
Description
I've got 2 machines, one with PostgreSQL 10 running (DB), and one with other services including Nagios Core (lets call it just Nagios). I've installed NRPE on DB machine alongside some plugins. Commands configured in nrpe.cnf are like so:
# Misc
command[check_users]=/usr/lib64/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib64/nagios/plugins/check_load -r -w 1.75,1.50,1.00 -c 2.00,1.75,1.50
command[check_hdd]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/vda
command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 150 -c 200
# PostgreSQL
command[check_postgres_locks]=/usr/lib64/nagios/plugins/check_postgres_locks -w 2 -c 3
command[check_postgres_bloat]=/usr/lib64/nagios/plugins/check_postgres_bloat -w='100 M' -c='200 M'
command[check_postgres_connection]=/usr/lib64/nagios/plugins/check_postgres_connection --db=postgres
command[check_postgres_backends]=/usr/lib64/nagios/plugins/check_postgres_backends -w=70 -c=100
From Nagios Machine I'm able to run any check from misc, but none from PostgreSQL section. Those fails with error:
NRPE: Unable to read output
I've installed nagios-plugin-nrpe on DB machine to eliminate network problem, and even on localhost I am unable to get valid response. Example:
$ /usr/lib64/nagios/plugins/check_nrpe -H localhost -c check_postgres_connection
NRPE: Unable to read output
locally it's fine:
$ /usr/lib64/nagios/plugins/check_postgres_connection --db=postgres
POSTGRES_CONNECTION OK: DB "postgres" version 10.3 | time=0.01s
and other check works just fine over NRPE:
$ /usr/lib64/nagios/plugins/check_nrpe -H 127.0.0.1 -c check_load
OK - load average per CPU: 0.01, 0.07, 0.07|load1=0.005;1.750;2.000;0; load5=0.075;1.500;1.750;0; load15=0.065;1.000;1.500;0;
I had trouble with connection timeout when 5666 port was not added to iptables as allowed, but that is not the case this time.
NRPE is configured to run as user nrpe and group nagios, where permissions on all files (symlinks included) in /usr/lib64/nagios/plugins are set to 755 and ownership root:nagios
. I've installed check_postgres version 2.23.0.
Any ideas how to approach this problem? I've stumbled accross this plugin because of this tutorial.