From 3a6765eae1899ac8386331c2f7a92593c890a9c7 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch> Date: Thu, 24 Aug 2023 15:09:32 +0200 Subject: [PATCH] add doc page --- docs/20_Checks/_index.md | 4 +- docs/20_Checks/check_php-fpm-status.md | 113 +++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 docs/20_Checks/check_php-fpm-status.md diff --git a/docs/20_Checks/_index.md b/docs/20_Checks/_index.md index 2399946..ae0a757 100644 --- a/docs/20_Checks/_index.md +++ b/docs/20_Checks/_index.md @@ -31,8 +31,8 @@ There is one include script used by all checks: * [check_onehost](check_onehost.md) * [check_onevm](check_onevm.md) * [check_opencpu](check_opencpu.md) -* [check_packages2install](check_packages2install) -* check_php-fpm-status +* [check_packages2install](check_packages2install.md) +* [check_php-fpm-status](check_php-fpm-status.md) * check_proc_mem * check_proc_ressources * check_proc_zombie diff --git a/docs/20_Checks/check_php-fpm-status.md b/docs/20_Checks/check_php-fpm-status.md new file mode 100644 index 0000000..cba83a5 --- /dev/null +++ b/docs/20_Checks/check_php-fpm-status.md @@ -0,0 +1,113 @@ +# check_php-fpm-status + +## Introduction + +The check fetches several counters from php-fm-status page. + +### Requirements + +* wget +* running PHP FPM service +* enabled status page + + +To enable a status page as http://localhost/fpm-status.php + +* Set pm.status_path in your pool config eg. /etc/php/8.1/fpm/pool.d/www.conf + +```txt +[www] +pm.status_path = /fpm-status.php +``` + +* In your webservice config limit the access; here a snippet for Apache 2.4: + +```txt +<Location /fpm-status.php> + Require local +</Location> +``` + + +## Syntax + +```text +> check_php-fpm-status -h +______________________________________________________________________ + +CHECK_PHP-FPM-STATUS +v1.1 + +(c) Institute for Medical Education - University of Bern +Licence: GNU GPL 3 + +https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_php-fpm-status.html +______________________________________________________________________ + +The check fetches several counters from php-fm-status page. + +It shows a short service status in a single line and then the dump of the +status page. +For performance data it echos: + + php-fpm-active count of active workers (="Rrunning" + "Reading headers") + php-fpm-maxactive max active processes (sum of idle + running + reading) + php-fpm-idle count of workers in state "Idle" + php-fpm-running count of workers in state "Running" + php-fpm-reading count of workers in state "Reading headers" + php-fpm-queue count of items in the queue + php-fpm-maxqueue max listen queue + php-fpm-slow slow requests per min (since last execution of this check) + php-fpm-speed requests per min (since last execution of this check) + +SYNTAX: +check_php-fpm-status [-u URL] + +OPTIONS: + + -u url to fpm status page (optional; default: localhost/status) + -h or --help show this help. + +PARAMETERS: + + None. + +EXAMPLE: +check_php-fpm-status -u http://localhost/my-custom-fpm-statuspage.php + +``` + +## Examples + + +`./check_php-fpm-status -u localhost/fpm-status.php` returns + +```txt +OK: PHP-FPM service: running: 1 .. active: 2 (max: 5) .. idle workers: 3 .. queue: 0 .. speed: 1 req per min ... slow: 0 req per min (0%; total: 0) +Workers: Running: 1 + Reading headers: 1 + Idle: 3 + + Waiting for a worker (queue): 0 (max: 0) + +--- Status of service + "pool": "www" + "process manager": "dynamic" + "start time": 1692402233 + "start since": 479084 + "accepted conn": 10960 + "listen queue": 0 + "max listen queue": 0 + "listen queue len": 0 + "idle processes": 3 + "active processes": 2 + "total processes": 5 + "max active processes": 5 + "max children reached": 0 + "slow requests": 0 + +--- workers in state Running +{"pid":588192,"state":"Running","start time":1692856027,"start since":25290,"requests":197,"request duration":42053467,"request method":"GET","request uri":"/fpm-status.php?full&json","content length":0,"user":"-","script":"-","last request cpu":0,"last request memory":0} + + |php-fpm-active=2;;;0;0 php-fpm-maxactive=5;;;0;0 php-fpm-queue=0;;;0;0 php-fpm-maxqueue=0;;;0;0 php-fpm-slow=0;;;0;0 php-fpm-speed=1;;;0;0 php-fpm-idle=3;;;0;0 php-fpm-running=1;;;0;0 php-fpm-reading=1;;;0;0 + ``` -- GitLab