Page 1 of 1
Postgres monitoring
Posted: Mon Oct 12, 2020 9:38 am
by maoreyes76
Hi...
I have set up Postgres monitoring but dont get it to work, i get this:
Postgres Backend Connections
(No output on stdout) stderr: /bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
Anyone know the reason to this error?
NagiosXI version 5.6.14
Re: Postgres monitoring
Posted: Mon Oct 12, 2020 4:59 pm
by benjaminsmith
Hi,
Looks like there's an error in the plugin syntax, try logging in to the XI server, run the following commands and post the output.
Code: Select all
su - nagios
/usr/local/nagios/libexec/check_postgres.pl -V
If that is successful, please run the full check command from this service directly from the command line, so we can review the arguments, and post the output.
We have directions for testing plugins from the shell on the following kb article. Thanks, Ben
Nagios XI - How To Test Check Commands From The Command-line
Re: Postgres monitoring
Posted: Wed Oct 14, 2020 2:20 am
by maoreyes76
HI...
Thank you for your reply.
If i run first command i get:
check_postgres.pl version 2.21.0
If i run the check command as Nagios user;
./check_postgres.pl -H test-postgres1-stage --port=5432 --dbuser=nagiosmon --dbname=postgres --dbpass="testpasswd" --action=connection
POSTGRES_CONNECTION CRITICAL: DB "postgres" (host:test-postgres1-stage) FATAL: no pg_hba.conf entry for host "10.230.100.21", user "nagiosmon", database "postgres", SSL off | time=0.01s
10.230.100.21 is our Nagios server...why do I get FATAL: no pg_hba.conf entry for host "10.230.100.21"?
Re: Postgres monitoring
Posted: Wed Oct 14, 2020 4:16 pm
by ssax
You likely need to edit the /var/lib/pgsql/data/pg_hba.conf on the postgresql server to allow access from 10.230.100.21. Please attach yours if you have questions.