Check PgBouncer status and LLD pools.
Check pools metrics.
psql, bash, zabbix-agent.
-
configure pgbouncer monitoring user (https://www.pgbouncer.org/usage.html)
-
create directory and copy pgbouncer.sh to /var/lib/zabbix/externalscripts/ change homedir for zabbix user usermod -d /var/lib/zabbix zabbix
-
copy zabbix_agentd.d/pgbouncer.conf to /etc/zabbix/zabbix_agentd.d/
-
chmod 755 /var/lib/zabbix/externalscripts/pgbouncer.sh and chown zabbix.zabbix /var/lib/zabbix/externalscripts/pgbouncer.sh
-
copy file .pgpass.j2 to ~zabbix/.pgpass and edit monitoring user and password, if needed, port too.
-
chmod 0600 ~zabbix/.pgpass and chown zabbix.zabbix ~zabbix/.pgpass
-
restart zabbix-agent daemon.
-
import "zbx_templates/Template App PgBouncer.xml" into your templates.
-
apply template "Template App PgBouncer" to pgbouncer node.
-
enjoy.
You can easily change the settings for monitoring a remote pgbouncer node.