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 .
Monitoring PostgresQL 9.5 version
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Monitoring PostgresQL 9.5 version
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
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
From the documentation for the plugin
https://bucardo.org/check_postgres/chec ... disk_spacedisk_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%'.
Re: Monitoring PostgresQL 9.5 version
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
This seems like a postgresql configuration issue, a little googling led me to thismohan23 wrote:I see that in Postgres log , there is a log "[unknown]@[unknown] LOG: incomplete startup" since nagios monitoring was setup.
https://stackoverflow.com/questions/226 ... tup-packet