Skip to main content

PHP FPM

Pack Assets

Templates

The Centreon Monitoring Connector PHP FPM brings 1 host template :

  • App-Php-Fpm-Web-custom

It brings the following Service Template:

Service AliasService TemplateDefault
Php-Fpm-UsageApp-Php-Fpm-Usage-WebX

Collected metrics & status

Metric nameDescriptionUnit
fpm.processes.active.countNumber of active processescount
fpm.processes.idle.countNumber of idle processescount
fpm.queue.listen.countNumber of connections in the listen queuecount
fpm.requests.persecondNumber of requests per seconds/s

Prerequisites

The target PHP FPM Web page must be reachable from the Centreon Poller on the specified port in the PHPFPMWEBPORT Host Macro. More information in the configuration section.

Setup

  1. Install the Centreon package on every Centreon poller expected to monitor your PHP FPM ressources:
yum install centreon-plugin-Applications-Php-Fpm-Web
  1. On the Centreon Web interface, install the PHP FPM Centreon Monitoring Connector on the Configuration > Monitoring Connector Manager page

Configuration

Host

  • Log into Centreon and add a new Host through Configuration > Hosts.
  • Fill the "Name", "Alias" & "IP Address / DNS" fields according to your PHP FPM server settings
  • Select the Applications-Php-Fpm-Web-custom template to apply to the Host
  • Once the template applied, some Macros marked as 'Mandatory' hereafter have to be configured.
MandatoryNameDescription
PHPFPMWEBPORT(Default: '80')
PHPFPMWEBPROTO(Default: 'http')
PHPFPMWEBURLPATH(Default: '/fpm-status')
EXTRAOPTIONS(Default: 'Any extra option you may want to add to every command_line (eg. a --verbose flag)')

How to check in the CLI that the configuration is OK and what are the main options for ?

Once the plugin installed, log into your Centreon Poller CLI using the centreon-engine user account and test the Plugin by running the following command:

/usr/lib/centreon/plugins//centreon_php_fpm_web.pl \
--plugin=apps::php::fpm::web::plugin \
--mode=usage \
--hostname=10.0.0.1 \
--proto='http' \
--port='80' \
--urlpath='/fpm-status' \
--warning-active-processes='30' \
--critical-active-processes='35' \
--warning-idle-processes='' \
--critical-idle-processes='' \
--warning-listen-queue='' \
--critical-listen-queue='' \
--warning-requests='' \
--critical-requests='' \
--use-new-perfdata

Expected command output is shown below:

OK : active processes: 8 (40%) idle processes: 12 (60%) listen queue: 2 requests: 90/s | 'fpm.processes.active.count'=8;30;35;0; 'fpm.processes.idle.count'=12;;;0; 'fpm.queue.listen.count'=2;;;0; 'fpm.requests.persecond'=90/s;;;0; 

This command would trigger a WARNING alarm if the number of active processes is reported as over 30 (--warning-active-processes='30') and a CRITICAL alarm if over 35 (--critical-active-processes='35').

All available options for a given mode can be displayed by adding the --help parameter to the command:

/usr/lib/centreon/plugins//centreon_php_fpm_web.pl \
--plugin=apps::php::fpm::web::plugin \
--mode=usage \
--help

All available options for a given mode can be displayed by adding the --list-mode parameter to the command:

/usr/lib/centreon/plugins//centreon_php_fpm_web.pl \
--plugin=apps::php::fpm::web::plugin \
--list-mode

Troubleshooting

Please find all the troubleshooting documentation for the Centreon Plugin in the dedicated page