Monitoring PostgresQL 9.5 version

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mohan23
Posts: 118
Joined: Tue Oct 03, 2017 7:11 am

Monitoring PostgresQL 9.5 version

Post 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 .
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring PostgresQL 9.5 version

Post by scottwilkerson »

Per the plugin's output ?

Code: Select all

Could not determine data_directory: are you connecting as a superuser?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mohan23
Posts: 118
Joined: Tue Oct 03, 2017 7:11 am

Re: Monitoring PostgresQL 9.5 version

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring PostgresQL 9.5 version

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mohan23
Posts: 118
Joined: Tue Oct 03, 2017 7:11 am

Re: Monitoring PostgresQL 9.5 version

Post by mohan23 »

I see that in Postgres log , there is a log "[unknown]@[unknown] LOG: incomplete startup" since nagios monitoring was setup.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring PostgresQL 9.5 version

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked