A PHP FPM Munin Plugin for monitoring PHP FPM pools. Written in Python 3, depends on JSON gem. Compatible with PHP FPM 7.x–8.x.
- Monitors key PHP FPM metrics: accepted connections, processes (active, idle, max) and slow requests.
- Supports multiple PHP FPM pools.
- Configurable via environment variables.
- Ensure you have Python 3 and the JSON gem installed:
pip install json
- Download the plugin script and place it in your Munin plugins directory (e.g.,
/etc/munin/plugins/):wget https://raw.githubusercontent.com/janu-software/munin-phpfpm/refs/heads/master/phpfpm_ -O /etc/munin/plugins/phpfpm_ chmod +x /etc/munin/plugins/phpfpm_
- Create symlinks for each PHP FPM pool you want to monitor:
ln -s /etc/munin/plugins/phpfpm_ /etc/munin/plugins/phpfpm-{your_pool_name} - Restart the Munin node to apply changes:
service munin-node restart
Create configuration files in /etc/munin/plugin-conf.d/ to specify the PHP FPM pools to monitor. Example configuration:
[phpfpm-{your_pool_name}]
env.pool {your_pool_name}
# Optional: specify custom status URL
# Automatically generated http://127.0.0.1/status-{your_pool_name}?json
# env.url http://127.0.0.1/status?json