We capture useful data from host and fpm status page:
PHP-fpm main statistic:
For each pool:
History storage period is 7 days, trend storage period is 30 days. Data is captured every minute. These timings can be adjusted in template or per host if needed.
Displays the following data:
Displays the following data:
Perform the following operations on all servers with Zabbix Agent and PHP-fpm from which you want to capture the data.
apt-get update
apt-get install jq libxml2-utils
wget https://github.com/kreicer/zabbix-phpfpm-monitoring/archive/master.zip /tmp/zabbix-phpfpm-monitoring.zip
unzip /tmp/zabbix-phpfpm-monitoring.zip
cp /tmp/zabbix-phpfpm-monitoring/fpm-monitoring.conf /etc/zabbix/zabbix_agentd.conf/
cp /tmp/zabbix-phpfpm-monitoring/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"
Delete temporary files:
rm /tmp/zabbix-phpfpm-monitoring.zip
rm -r /tmp/zabbix-phpfpm-monitoring/
In Zabbix frontend go to "Configuration"->"Templates"->"Import"
:
Upload file /fpm_template.xml
from the archive.
Add template "PHP-fpm Template" to the hosts.
Add your status page address in the macros section of the host by adding value:
{$FPM_STATUS_URL}=your status page address
For few pools on one host: Add your status pages addresses in the macros section of the host. Example:
{$FPM_STATUS_URL}=statuspage1oIostatuspage2...
oIo - speacial symbols sequence for dividing status pages addresses (you can rewrite it in fpm-monitoring.sh).
div="oIo"
Rewrite tresholds (if needed):
{$FPM_MEM_WARN}=50 //mem % of total mem for trigger
{$FPM_CONN_WARN}=150 //number of accepted reqs per minute for trigger
Setup is finished, just wait 15 minutes till Zabbix discovers your providers and captures the data (or use manual check).
Tested with:
Should work:
Not tested with:
If it works, please let me know.