Skip to main content

PHP APC

Pack Assets​

Templates​

The Centreon Monitoring Connector PHP APC brings 1 host template :

  • App-Php-Apc-Web-custom

It brings the following Service Templates:

Service AliasService TemplateDefault
Php-Apc-File-CacheApp-Php-Apc-File-Cache-WebX
Php-Apc-MemoryApp-Php-Apc-Memory-WebX

Collected metrics & status​

Metric nameDescriptionUnit
filecache.requests.persecondGlobal request rate per secondsr/s
filecache.requests.now.persecondRequest Rate per secondsr/s
filecache.hits.persecondGlobal hit rate per secondsr/s
filecache.hits.now.persecondHit rate per secondsr/s
filecache.misses.persecondGlobal miss rate per secondsr/s
filecache.misses.now.persecondMiss rate per secondsr/s
filecache.hits.percentageGLobal hit ratio%
filecache.hits.now.percentageHit ratio%

Prerequisites​

The target PHP APC Web page must be reachable from the Centreon Poller on the specified port in the PHPAPCWEBPORT Host Macro. More information in the Configuration section.

Setup​

  1. Install the Centreon package on every Centreon poller expected to monitor your PHP APC ressources:
yum install centreon-plugin-Applications-Php-Apc-Web
  1. On the Centreon Web interface, install the PHP APC 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 APC server settings
  • Select the Applications-Php-Apc-Web-custom template to apply to the Host
  • Once the template applied, some Macros marked as 'Mandatory' hereafter have to be configured.
MandatoryNameDescription
PHPAPCWEBPORT(Default: '80')
PHPAPCWEBPROTO(Default: 'http')
PHPAPCWEBURLPATH(Default: '/apc.php')
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_apc_web.pl \
--plugin=apps::php::apc::web::plugin \
--mode=memory \
--hostname=10.0.0.1 \
--proto='http' \
--port='80' \
--urlpath='/apc.php' \
--warning-used='80' \
--critical-used='90' \
--warning-fragmentation='' \
--critical-fragmentation='' \
--use-new-perfdata

Expected command output is shown below:

OK : Memory Usage Total: 985.22 MB Used: 500.68 MB (50.82%) Free: 484.54 MB (49.18%) Memory Fragmentation: 10% | 'memory.usage.bytes'=525000704B;80;90;0;1033080832 'memory.fragmentation.percentage'=10%;;;0;100 

This command would trigger a WARNING alarm if the memory usage is reported as over 80% (--warning-used='80') and a CRITICAL alarm if over than 90% (--critical-used='90').

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

/usr/lib/centreon/plugins//centreon_php_apc_web.pl \
--plugin=apps::php::apc::web::plugin \
--mode=memory \
--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_apc_web.pl \
--plugin=apps::php::apc::web::plugin \
--list-mode

Troubleshooting​

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