bucardo / check_postgres

Nagios check_postgres plugin for checking status of PostgreSQL databases
http://bucardo.org/wiki/Check_postgres
Other
561 stars 175 forks source link

Better check & document required permissions #166

Open HOSTED-POWER opened 5 years ago

HOSTED-POWER commented 5 years ago

Hi,

We tried the check_postgres for example for checking long running queries (--action query_time). However when we didn't have enough permissions it just outputted:

POSTGRES_QUERY_TIME OK: DB "postgres" (host:127.0.0.1) longest query: 0s

Now with sufficient permissions it outputs:

POSTGRES_QUERY_TIME WARNING: DB "postgres" (host:127.0.0.1) longest query: 16s

I would expect the first one to simply output UNKNOWN because of lacking permissions :)

Atm we grant:

grant pg_read_all_settings, pg_read_all_stats, pg_stat_scan_tables to xxx;

I suppose this should be a bit better documented and for sure output error if it lacks permissions for certain actions.