check_pgsql run through check_nrpe fails
Posted: Fri Jun 14, 2019 3:14 pm
I am new to Nagios and am attempting to set up monitoring of a postgres database. I'm taking over from someone else and working on a fairly complicated system. I'm working through the details by setting up monitoring on a new VM (the database system).
I have nrpe installed and running on the database system, and nagios server set up and running on another system. I have a .cfg file in /etc/nrpe.d/ on the database system that contains the command to run check_pgsql:
If I run that command locally as root, it successfully returns an "OK - database template1" status line.
If I run that command remotely from the nagios server system using check_nrpe
It returns:
I have another check on the database system that uses check_disk, which is also run remotely using check_nrpe, and that check runs successfully and returns an "OK" status line.
Nagios server system is Centos 6, database system is Centos 7, database is Postgres 11.3
Any advice on why check_pgsql would run successfully when run locally and fail when run through check_nrpe would be greatly appreciated.
I have nrpe installed and running on the database system, and nagios server set up and running on another system. I have a .cfg file in /etc/nrpe.d/ on the database system that contains the command to run check_pgsql:
Code: Select all
command[check_pgsql-os]=usr/lib64/nagios/plugins/check_pgsql -l postgres
If I run that command remotely from the nagios server system using check_nrpe
Code: Select all
check_nrpe -H dbsystem -t 60 -c check_pgsql-os
Code: Select all
CRITICAL - no connection to 'template1' (could not connect to server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
)
Nagios server system is Centos 6, database system is Centos 7, database is Postgres 11.3
Any advice on why check_pgsql would run successfully when run locally and fail when run through check_nrpe would be greatly appreciated.