-
Problem report
-
Resolution: Fixed
-
Minor
-
None
-
6.4.3
-
Alma Linux 9.2
Zabbix 6.4.3
After installing and setting up the postgresql plugin for Agent2, as described in our documentation here: https://www.zabbix.com/integrations/postgresql#postgresql_agent2
there are issues with the plugin, and it is not working.
After the last step, setting the macros, I was receiving this error log message:
Connection failed: failed to connect to `host=localhost user=zabbix database=user=zbx_monitor`: server error (FATAL: database "user=zbx_monitor" does not exist (SQLSTATE 3D000)).
The error message is stating that a database "user=zbx_monitor" does not exist. I set the {$PG.USER} value to "zbx_monitor" ({$PG.DATABASE} value was set to "zabbix"), which was the user in the database I created for this plugin, but it looks like something with the macros is broken.
I couldn't get it to work by setting macros, so I set these parameters in the plugin configuration file 'postgresql.conf' as I would set the macros in frontend:
- Plugins.PostgreSQL.Default.Uri=
- Plugins.PostgreSQL.Default.User=
- Plugins.PostgreSQL.Default.Password=
- Plugins.PostgreSQL.Default.Database=
After setting these parameters in the plugin configuration file, the plugin works and is collecting data.
To reproduce: Follow the steps in documentation - https://www.zabbix.com/integrations/postgresql#postgresql_agent2