This section contains the required steps to ensure proper operation of Template DB PostgreSQL.
1. Install Áú»¢¶Ä²© agent and create a read-only zbx_monitor user with proper access to your PostgreSQL server.
For PostgreSQL version 10 and above:
For older PostgreSQL versions:
CREATE USER zbx_monitor WITH PASSWORD '<PASSWORD>';
GRANT SELECT ON pg_stat_database TO zbx_monitor;
2. Copy postgresql/
to Áú»¢¶Ä²© agent home directory (/var/lib/zabbix/). The directory contains the files needed to obtain metrics from PostgreSQL.
3. Copy template_db_postgresql.conf
(found in the templates directory of the downloaded latest Áú»¢¶Ä²© version) to Áú»¢¶Ä²© agent configuration directory (/etc/zabbix/zabbix_agentd.d/) and restart Áú»¢¶Ä²© agent service.
4. Edit pg_hba.conf
to allow connections from Áú»¢¶Ä²© agent ().
Add rows (for example):
host all zbx_monitor 127.0.0.1/32 trust
host all zbx_monitor 0.0.0.0/0 md5
host all zbx_monitor ::0/0 md5
5. If you need to monitor a remote server then create a .pgpass
file in Áú»¢¶Ä²© agent home directory (/var/lib/zabbix/) and add the connection details with the instance, port, database, user and password information in the format below ().
Add rows, for example:
<REMOTE_HOST1>:5432:postgres:zbx_monitor:<PASSWORD>
<REMOTE_HOST2>:5432:postgres:zbx_monitor:<PASSWORD>
...
<REMOTE_HOSTN>:5432:postgres:zbx_monitor:<PASSWORD>
Or, example 2:
6. Import template_db_postgresql.xml
in to Áú»¢¶Ä²© and link it to the target host.