Skip to content

Latest commit

 

History

History
36 lines (34 loc) · 1.36 KB

File metadata and controls

36 lines (34 loc) · 1.36 KB

PHP FPM Munin Plugin

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.

Features

  • Monitors key PHP FPM metrics: accepted connections, processes (active, idle, max) and slow requests.
  • Supports multiple PHP FPM pools.
  • Configurable via environment variables.

Installation

  1. Ensure you have Python 3 and the JSON gem installed:
    pip install json
  2. 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_
  3. Create symlinks for each PHP FPM pool you want to monitor:
    ln -s /etc/munin/plugins/phpfpm_ /etc/munin/plugins/phpfpm-{your_pool_name}
  4. Restart the Munin node to apply changes:
     service munin-node restart

Configuration

Create configuration files in /etc/munin/plugin-conf.d/ to specify the PHP FPM pools to monitor. Example configuration:

File: /etc/munin/plugin-conf.d/phpfpm

[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