Skip to content

Commit

Permalink
php-fpm: Remove parameters --*-max-children because php-fpm `max ch…
Browse files Browse the repository at this point in the history
…ildren reached` is either 0 or 1
  • Loading branch information
markuslf committed Apr 12, 2024
1 parent 5be2d97 commit a55ad81
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 160 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Monitoring Plugins:
* journald-query: Pattern-matching is now always case-sensitive (fix #745)
* librenms-alerts: Rewritten from scratch to fetch from LibreNMS MySQL/MariaDB database (therefore the check comes with new parameters)
* librenms-health: Rewritten from scratch to fetch from LibreNMS MySQL/MariaDB database (therefore the check comes with new parameters)
* php-fpm: Remove parameters `--*-max-children` because php-fpm `max children reached` is either 0 or 1
* snmp: Improve Performance Data Handling ([#481](https://github.com/Linuxfabrik/monitoring-plugins/issues/481)) - update your CSV definition files and add two more columns according to the check's README
* uptime: Use the plugin to warn about recent reboots ([#722](https://github.com/Linuxfabrik/monitoring-plugins/issues/722)). Note that the plugin now requires a time qualifier when specifying parameters, e.g. ``--warning=180D`` for 180 days (instead of ``--warning=180`` as in previous versions).

Expand Down
41 changes: 18 additions & 23 deletions check-plugins/php-fpm-status/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ Help
.. code-block:: text
usage: php-fpm-status [-h] [-V] [--always-ok] [-c CRIT]
[--critical-maxchildren CRIT_MAX_CHILDREN]
[--critical-slowreq CRIT_SLOW_REQUESTS] [--insecure]
[--no-proxy] [--test TEST] [--timeout TIMEOUT] [-u URL]
[-w WARN] [--warning-maxchildren WARN_MAX_CHILDREN]
[--lengthy] [--no-proxy] [--test TEST]
[--timeout TIMEOUT] [-u URL] [-w WARN]
[--warning-slowreq WARN_SLOW_REQUESTS]
This check collects information from the PHP-FPM status page and alerts on
Expand All @@ -60,14 +59,12 @@ Help
-c CRIT, --critical CRIT
Set the CRIT threshold for queue usage as a
percentage. Default: >= 90
--critical-maxchildren CRIT_MAX_CHILDREN
Set the CRIT threshold for the number of times the
process limit has been reached. Default: >= 100
--critical-slowreq CRIT_SLOW_REQUESTS
Set the CRIT threshold for slow requests. Default: >=
100
--insecure This option explicitly allows to perform "insecure"
SSL connections. Default: False
--lengthy Extended reporting.
--no-proxy Do not use a proxy. Default: False
--test TEST For unit tests. Needs "path-to-stdout-file,path-to-
stderr-file,expected-retc".
Expand All @@ -77,9 +74,6 @@ Help
-w WARN, --warning WARN
Set the WARN threshold for queue usage as a
percentage. Default: >= 80
--warning-maxchildren WARN_MAX_CHILDREN
Set the WARN threshold for the number of times the
process limit has been reached. Default: >= 1
--warning-slowreq WARN_SLOW_REQUESTS
Set the WARN threshold for slow requests. Default: >=
1
Expand All @@ -90,35 +84,36 @@ Usage Examples

.. code-block:: bash
./php-fpm-status --url http://localhost/fpm-status --warning 80 --warning-maxchildren 10 --critical-slowreq 3
./php-fpm-status --url http://localhost/fpm-status --warning 80 --critical-slowreq 3 --lengthy
Output:

.. code-block:: text
Pool www (dynamic): 47/55 reqs in queue (85.5%) [WARNING], 3x max children reached [WARNING], 42 slow requests [WARNING], 129k connections, 23 processes (3 active, 20 idle), Up 3h 28m (since 2021-05-08 09:18:11)
Pool www (dynamic): 71.0 connections, 14 processes (4 active, 10 idle), Up 23s (since 2024-04-12 13:24:23)
PID Reqs ReqDur Request URI POST AuthUser
--- ---- ------ ----------- ---- --------
1818627 5785 6h 23m /nextcloud/remote.php - [email protected]
1821973 5062 5h 14m /nextcloud/remote.php - [email protected]
1823283 5092 3m 40s /nextcloud/index.php 252.0B -
PID ! State ! Process Start ! Reqs ! LastReqDur ! LastMthd ! LastContLen ! Last Request URI ! Script ! AuthUser
------+---------+-------------------------------+------+-------------+----------+-------------+------------------+-------------------------------------------+----------
55238 ! Running ! 2024-04-12 13:24:23 (23s ago) ! 6 ! 530ms 807us ! GET ! - ! /index.php ! /var/www/html/www.example.com/index.php ! -
The columns mean:

* PID: the PID of the process
* Requests: the number of requests the process has served
* ReqDur: the duration of the requests
* Request URI: the request URI with the query string
* POST: the content length of the POST request (or '-' if not a POST)
* AuthUser: the user (PHP_AUTH_USER) (or '-' if not set);
* PID: The system PID of the process.
* Reqs: The total number of requests served.
* LastReqDur: The total time in microseconds spent serving last request.
* LastMthd: The HTTP method of the last served request.
* LastContLen: The length of the request body of the last request.
* Last Request URI: The URI of the last served request (after webserver processing, it may always be /index.php if you use a front controller pattern redirect).
* Script: The full path of the script executed by the last request. This will be '-' if not applicable (eg. status page requests).
* AuthUser: The HTTP user (``PHP_AUTH_USER``) of the last request.

For more details see https://www.php.net/manual/en/fpm.status.php.


States
------

* WARN or CRIT on queue usage over certain thresholds (default 80/90%)
* WARN or CRIT if number of max children is over certain thresholds (default 1/100)
* WARN or CRIT if number of slow queries is over certain thresholds (default 1/100)


Expand Down
Loading

0 comments on commit a55ad81

Please sign in to comment.