[ZBX-19734] PostgreSQL Agent 2 documentation GRANT missing Created: 2021 Jul 26  Updated: 2021 Dec 21  Resolved: 2021 Dec 21

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: 5.0.14
Fix Version/s: None

Type: Documentation task Priority: Trivial
Reporter: Aleksey Volodin Assignee: Vyacheslav Khaliev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Sub-task
depends on ZBX-19897 Bug in template PostgreSQL by agent2 ... Closed

 Description   

In PostgreSQL Agent 2 template documentation:

https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql_agent2?at=release/5.0

In section

1. Create PostgreSQL user for monitoring (<password> at your discretion):

Missing important GRANT section:

GRANT EXECUTE ON FUNCTION pg_ls_waldir() TO zbx_monitor;

Otherwise in fronted error appear
Cannot fetch data: ERROR: permission denied for function pg_ls_waldir (SQLSTATE 42501).



 Comments   
Comment by Konstantin Ilyasov [ 2021 Jul 27 ]

I'm not sure, but maybe it is still necessary to grant role pg_monitor for user even in case of zabbix_agent2 (not only for legacy zabbix_agent)?
Like it is stated in here
https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql/README.md
Because pg_ls_waldir() is allowed for role pg_monitor (source)

This function is restricted to superusers and members of the pg_monitor role by default, but other users can be granted EXECUTE to run the function.
Comment by Vyacheslav Khaliev [ 2021 Dec 02 ]

Resolved in ZBX-19897

Generated at Sat Jun 14 17:09:26 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.