Page 1 of 1

Monitoring PostgresQL 9.5 version

Posted: Tue Feb 12, 2019 3:36 pm
by mohan23
Hi,

We have PostgreSQL database with 9.5 version. can you let me know if we can monitor this using nagios as when I run check for this db in nagios, im getting below error

[nagios@hostname~]$ /usr/local/nagios/libexec/check_postgres.pl -H 172.29.149.254 --port=5432 --dbuser=sosnagread --dbname=postgres --action=disk_space
POSTGRES_DISK_SPACE UNKNOWN: DB "postgres" (host:172.29.149.254) Could not determine data_directory: are you connecting as a superuser? | time=0.03s
[nagios@hostname ~]$

Can you let me know what permissions/roles should we need for a user created on postgreSQL database .

Re: Monitoring PostgresQL 9.5 version

Posted: Wed Feb 13, 2019 12:14 pm
by scottwilkerson
Per the plugin's output ?

Code: Select all

Could not determine data_directory: are you connecting as a superuser?

Re: Monitoring PostgresQL 9.5 version

Posted: Wed Feb 13, 2019 12:29 pm
by mohan23
no, its read only user, only thing was in hba conf file, user was added as trust user. so that we can connect to database without password

Re: Monitoring PostgresQL 9.5 version

Posted: Wed Feb 13, 2019 12:40 pm
by scottwilkerson
From the documentation for the plugin
disk_space
This action requires that you have the executable "/bin/df" available to report on disk sizes, and it also needs to be run as a superuser, so it can examine the data_directory setting inside of Postgres. The --warning and --critical options are given in either sizes or percentages or both. If using sizes, the standard unit types are allowed: bytes, kilobytes, gigabytes, megabytes, gigabytes, terabytes, or exabytes. Each may be abbreviated to the first letter only; no units at all indicates 'bytes'. The default values are '90%' and '95%'.
https://bucardo.org/check_postgres/chec ... disk_space

Re: Monitoring PostgresQL 9.5 version

Posted: Fri Feb 15, 2019 10:37 am
by mohan23
I see that in Postgres log , there is a log "[unknown]@[unknown] LOG: incomplete startup" since nagios monitoring was setup.

Re: Monitoring PostgresQL 9.5 version

Posted: Fri Feb 15, 2019 1:28 pm
by scottwilkerson
mohan23 wrote:I see that in Postgres log , there is a log "[unknown]@[unknown] LOG: incomplete startup" since nagios monitoring was setup.
This seems like a postgresql configuration issue, a little googling led me to this
https://stackoverflow.com/questions/226 ... tup-packet