PHP-fpm Monitoring (Multiple Pools)
Zabbix PHP-fpm Template with Auto-discovery and support for multiple pools
Supports auto discovery of pool.
Easy and flexible configuration.
Low load on Zabbix server: most elements sending info by zabbix_sender.
Bash: no need to install Perl, PHP, Go or other languages.
Safe: no need to allow root for zabbix agent.
Installation
1. On Target server
1.1 Install required packages
apt-get install jq libxml2-utils
1.2 Download and install files
cp fpm-monitoring.conf /etc/zabbix/zabbix_agentd.conf/
cp fpm-monitoring.sh /etc/zabbix/scripts/
chmod +x /etc/zabbix/scripts/fpm-monitoring.sh
systemctl restart zabbix-agent.service
If you using non-standart zabbix-agent.conf path change it in fpm-monitoring.sh
zabbixconf="/etc/zabbix/zabbix_agentd.conf"
2. On Zabbix Server
2.1 Import template
"Configuration"->"Templates"->"Import"
2.2 Add the template to your host(s)
"Configuration"->"Host"->"YourHost"->"Templates"
2.3 Override {$FPM_STATUS_URL} macro on your host with fpm status page
For few pools on one host: {$FPM_STATUS_URL}=statuspage1oIostatuspage2...
* oIo - speacial symbols sequence for dividing status pages addresses (you can rewrite it in fpm-monitoring.sh).
2.4 Rewrite tresholds {$FPM_MEM_WARN} {$FPM_CONN_WARN}
Setup is finished, just wait 15 minutes till Zabbix discovers your providers and captures the data (or use manual check).