-
Incident report
-
Resolution: Cannot Reproduce
-
Trivial
-
None
-
5.0.10
-
None
Steps to reproduce:
- Using Zabbix Agent2 to monitor Postgresql 11 on debian 10
Result:
Postgresql wal items are not populated, because the agent doesn't have permissions to run the required function.
In the postgresql log file:
2021-04-01 11:31:45.022 CEST [1111] zbx_monitor@postgres ERROR: permission denied for function pg_ls_waldir 2021-04-01 11:31:45.022 CEST [1111] zbx_monitor@postgres STATEMENT: SELECT row_to_json(T) FROM ( SELECT pg_wal_lsn_diff(pg_current_wal_lsn(),'0/00000000') AS WRITE, count(*) FROM pg_ls_waldir() AS COUNT ) T;
Expected:
Wal items are populated.
Possible solution, seems to work for me:
Just like the advice in https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql_agent2.
Give the user required permission on this function:
GRANT EXECUTE ON FUNCTION pg_catalog.pg_ls_waldir TO zbx_monitor ;
Now the wal items are populated.