PHP FastCGI Process Manager (PHP-FPM) is an alternative FastCGI daemon for PHP that allows a website to handle high loads. PHP-FPM maintains pools (workers that can respond to PHP requests) to accomplish this. PHP-FPM is faster than traditional CGI-based methods, such as SUPHP, for multi-user PHP environments.
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_http?at=release/7.4
This template is developed to monitor the FastCGI Process Manager (PHP-FPM) by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template PHP-FPM by Zabbix agent - collects metrics by polling PHP-FPM status-page with HTTP agent remotely.
Note that this solution supports HTTPS and redirects.
Zabbix version: 7.4 and higher.
This template has been tested on:
Zabbix should be configured according to the instructions in the Templates out of the box section.
Note that depending on your OS distribution, the PHP-FPM executable/service name can vary. RHEL-like distributions usually name both process and service as php-fpm, while for Debian/Ubuntu based distributions it may include the version, for example: executable name - php-fpm8.2, systemd service name - php8.2-fpm. Adjust the following instructions accordingly if needed.
pm.status_path = /status
ping.path = /ping
<version> in the command if needed.$ php-fpm -t
or
$ php-fpm<version> -t
php-fpm service to make the change active. Replace the <version> in the command if needed.$ systemctl reload php-fpm
or
$ systemctl reload php<version>-fpm
If you use Nginx, edit the configuration file of your Nginx server block (virtual host) and add the location block below it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
If you use Apache, edit the configuration file of the virtual host and add the following location blocks.
<LocationMatch "/status">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/status"
</LocationMatch>
<LocationMatch "/ping">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/ping"
</LocationMatch>
$ nginx -t
or
$ httpd -t
or
$ apachectl configtest
$ systemctl reload nginx
or
$ systemctl reload httpd
or
$ systemctl reload apache2
curl -L 127.0.0.1/status
curl -L 127.0.0.1/ping
If you use another location of the status/ping pages, don't forget to change the {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use another web server port or scheme for the location of the PHP-FPM status/ping pages, don't forget to change the macros {$PHP_FPM.SCHEME} and {$PHP_FPM.PORT}.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.PORT} | The port of the PHP-FPM status host or container. |
80 |
| {$PHP_FPM.SCHEME} | Request scheme which may be http or https |
http |
| {$PHP_FPM.HOST} | The hostname or IP address of the PHP-FPM status for a host or container. |
localhost |
| {$PHP_FPM.STATUS.PAGE} | The path of the PHP-FPM status page. |
status |
| {$PHP_FPM.PING.PAGE} | The path of the PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | The expected reply to the ping. |
pong |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum percent of the PHP-FPM queue usage for a trigger expression. |
80 |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Get ping page | HTTP agent | php-fpm.get_ping | |
| Get status page | HTTP agent | php-fpm.get_status | |
| Ping | Dependent item | php-fpm.ping Preprocessing
|
|
| Processes, active | The total number of active processes. |
Dependent item | php-fpm.processes_active Preprocessing
|
| Version | The current version of the PHP. You can get it from the HTTP-Header "X-Powered-By"; it may not work if you have changed the default HTTP-headers. |
Dependent item | php-fpm.version Preprocessing
|
| Pool name | The name of the current pool. |
Dependent item | php-fpm.name Preprocessing
|
| Uptime | It indicates how long has this pool been running. |
Dependent item | php-fpm.uptime Preprocessing
|
| Start time | The time when this pool was started. |
Dependent item | php-fpm.start_time Preprocessing
|
| Processes, total | The total number of server processes currently running. |
Dependent item | php-fpm.processes_total Preprocessing
|
| Processes, idle | The total number of idle processes. |
Dependent item | php-fpm.processes_idle Preprocessing
|
| Process manager | The method used by the process manager to control the number of child processes for this pool. |
Dependent item | php-fpm.process_manager Preprocessing
|
| Processes, max active | The highest value of "active processes" since the PHP-FPM server was started. |
Dependent item | php-fpm.processes_max_active Preprocessing
|
| Accepted connections per second | The number of accepted requests per second. |
Dependent item | php-fpm.conn_accepted.rate Preprocessing
|
| Slow requests | The number of requests that has exceeded your |
Dependent item | php-fpm.slow_requests Preprocessing
|
| Listen queue | The current number of connections that have been initiated but not yet accepted. |
Dependent item | php-fpm.listen_queue Preprocessing
|
| Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool was started. |
Dependent item | php-fpm.listen_queue_max Preprocessing
|
| Listen queue, len | The size of the socket queue of pending connections. |
Dependent item | php-fpm.listen_queue_len Preprocessing
|
| Queue usage | The utilization of the queue. |
Calculated | php-fpm.listen_queue_usage |
| Max children reached | The number of times that |
Dependent item | php-fpm.max_children Preprocessing
|
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Service is down | last(/PHP-FPM by HTTP/php-fpm.ping)=0 or nodata(/PHP-FPM by HTTP/php-fpm.ping,3m)=1 |
High | Manual close: Yes | |
| PHP-FPM: Version has changed | The PHP-FPM version has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by HTTP/php-fpm.version,#1)<>last(/PHP-FPM by HTTP/php-fpm.version,#2) and length(last(/PHP-FPM by HTTP/php-fpm.version))>0 |
Info | Manual close: Yes |
| PHP-FPM: Failed to fetch info data | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/PHP-FPM by HTTP/php-fpm.uptime,30m)=1 |
Info | Manual close: Yes Depends on:
|
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by HTTP/php-fpm.uptime)<10m |
Info | Manual close: Yes |
| PHP-FPM: Manager changed | The PHP-FPM manager has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by HTTP/php-fpm.process_manager,#1)<>last(/PHP-FPM by HTTP/php-fpm.process_manager,#2) |
Info | Manual close: Yes |
| PHP-FPM: Detected slow requests | The PHP-FPM has detected a slow request. |
min(/PHP-FPM by HTTP/php-fpm.slow_requests,#3)>0 |
Warning | |
| PHP-FPM: Queue utilization is high | The queue for this pool has reached |
min(/PHP-FPM by HTTP/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
Warning |
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_http?at=release/7.2
This template is developed to monitor the FastCGI Process Manager (PHP-FPM) by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template PHP-FPM by Zabbix agent - collects metrics by polling PHP-FPM status-page with HTTP agent remotely.
Note that this solution supports HTTPS and redirects.
Zabbix version: 7.2 and higher.
This template has been tested on:
Zabbix should be configured according to the instructions in the Templates out of the box section.
Note that depending on your OS distribution, the PHP-FPM executable/service name can vary. RHEL-like distributions usually name both process and service as php-fpm, while for Debian/Ubuntu based distributions it may include the version, for example: executable name - php-fpm8.2, systemd service name - php8.2-fpm. Adjust the following instructions accordingly if needed.
pm.status_path = /status
ping.path = /ping
<version> in the command if needed.$ php-fpm -t
or
$ php-fpm<version> -t
php-fpm service to make the change active. Replace the <version> in the command if needed.$ systemctl reload php-fpm
or
$ systemctl reload php<version>-fpm
If you use Nginx, edit the configuration file of your Nginx server block (virtual host) and add the location block below it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
If you use Apache, edit the configuration file of the virtual host and add the following location blocks.
<LocationMatch "/status">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/status"
</LocationMatch>
<LocationMatch "/ping">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/ping"
</LocationMatch>
$ nginx -t
or
$ httpd -t
or
$ apachectl configtest
$ systemctl reload nginx
or
$ systemctl reload httpd
or
$ systemctl reload apache2
curl -L 127.0.0.1/status
curl -L 127.0.0.1/ping
If you use another location of the status/ping pages, don't forget to change the {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use another web server port or scheme for the location of the PHP-FPM status/ping pages, don't forget to change the macros {$PHP_FPM.SCHEME} and {$PHP_FPM.PORT}.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.PORT} | The port of the PHP-FPM status host or container. |
80 |
| {$PHP_FPM.SCHEME} | Request scheme which may be http or https |
http |
| {$PHP_FPM.HOST} | The hostname or IP address of the PHP-FPM status for a host or container. |
localhost |
| {$PHP_FPM.STATUS.PAGE} | The path of the PHP-FPM status page. |
status |
| {$PHP_FPM.PING.PAGE} | The path of the PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | The expected reply to the ping. |
pong |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum percent of the PHP-FPM queue usage for a trigger expression. |
80 |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Get ping page | HTTP agent | php-fpm.get_ping | |
| Get status page | HTTP agent | php-fpm.get_status | |
| Ping | Dependent item | php-fpm.ping Preprocessing
|
|
| Processes, active | The total number of active processes. |
Dependent item | php-fpm.processes_active Preprocessing
|
| Version | The current version of the PHP. You can get it from the HTTP-Header "X-Powered-By"; it may not work if you have changed the default HTTP-headers. |
Dependent item | php-fpm.version Preprocessing
|
| Pool name | The name of the current pool. |
Dependent item | php-fpm.name Preprocessing
|
| Uptime | It indicates how long has this pool been running. |
Dependent item | php-fpm.uptime Preprocessing
|
| Start time | The time when this pool was started. |
Dependent item | php-fpm.start_time Preprocessing
|
| Processes, total | The total number of server processes currently running. |
Dependent item | php-fpm.processes_total Preprocessing
|
| Processes, idle | The total number of idle processes. |
Dependent item | php-fpm.processes_idle Preprocessing
|
| Process manager | The method used by the process manager to control the number of child processes for this pool. |
Dependent item | php-fpm.process_manager Preprocessing
|
| Processes, max active | The highest value of "active processes" since the PHP-FPM server was started. |
Dependent item | php-fpm.processes_max_active Preprocessing
|
| Accepted connections per second | The number of accepted requests per second. |
Dependent item | php-fpm.conn_accepted.rate Preprocessing
|
| Slow requests | The number of requests that has exceeded your |
Dependent item | php-fpm.slow_requests Preprocessing
|
| Listen queue | The current number of connections that have been initiated but not yet accepted. |
Dependent item | php-fpm.listen_queue Preprocessing
|
| Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool was started. |
Dependent item | php-fpm.listen_queue_max Preprocessing
|
| Listen queue, len | The size of the socket queue of pending connections. |
Dependent item | php-fpm.listen_queue_len Preprocessing
|
| Queue usage | The utilization of the queue. |
Calculated | php-fpm.listen_queue_usage |
| Max children reached | The number of times that |
Dependent item | php-fpm.max_children Preprocessing
|
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Service is down | last(/PHP-FPM by HTTP/php-fpm.ping)=0 or nodata(/PHP-FPM by HTTP/php-fpm.ping,3m)=1 |
High | Manual close: Yes | |
| PHP-FPM: Version has changed | The PHP-FPM version has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by HTTP/php-fpm.version,#1)<>last(/PHP-FPM by HTTP/php-fpm.version,#2) and length(last(/PHP-FPM by HTTP/php-fpm.version))>0 |
Info | Manual close: Yes |
| PHP-FPM: Failed to fetch info data | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/PHP-FPM by HTTP/php-fpm.uptime,30m)=1 |
Info | Manual close: Yes Depends on:
|
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by HTTP/php-fpm.uptime)<10m |
Info | Manual close: Yes |
| PHP-FPM: Manager changed | The PHP-FPM manager has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by HTTP/php-fpm.process_manager,#1)<>last(/PHP-FPM by HTTP/php-fpm.process_manager,#2) |
Info | Manual close: Yes |
| PHP-FPM: Detected slow requests | The PHP-FPM has detected a slow request. |
min(/PHP-FPM by HTTP/php-fpm.slow_requests,#3)>0 |
Warning | |
| PHP-FPM: Queue utilization is high | The queue for this pool has reached |
min(/PHP-FPM by HTTP/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
Warning |
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_http?at=release/7.0
This template is developed to monitor the FastCGI Process Manager (PHP-FPM) by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template PHP-FPM by Zabbix agent - collects metrics by polling PHP-FPM status-page with HTTP agent remotely.
Note that this solution supports HTTPS and redirects.
Zabbix version: 7.0 and higher.
This template has been tested on:
Zabbix should be configured according to the instructions in the Templates out of the box section.
Note that depending on your OS distribution, the PHP-FPM executable/service name can vary. RHEL-like distributions usually name both process and service as php-fpm, while for Debian/Ubuntu based distributions it may include the version, for example: executable name - php-fpm8.2, systemd service name - php8.2-fpm. Adjust the following instructions accordingly if needed.
pm.status_path = /status
ping.path = /ping
<version> in the command if needed.$ php-fpm -t
or
$ php-fpm<version> -t
php-fpm service to make the change active. Replace the <version> in the command if needed.$ systemctl reload php-fpm
or
$ systemctl reload php<version>-fpm
If you use Nginx, edit the configuration file of your Nginx server block (virtual host) and add the location block below it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
If you use Apache, edit the configuration file of the virtual host and add the following location blocks.
<LocationMatch "/status">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/status"
</LocationMatch>
<LocationMatch "/ping">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/ping"
</LocationMatch>
$ nginx -t
or
$ httpd -t
or
$ apachectl configtest
$ systemctl reload nginx
or
$ systemctl reload httpd
or
$ systemctl reload apache2
curl -L 127.0.0.1/status
curl -L 127.0.0.1/ping
If you use another location of the status/ping pages, don't forget to change the {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use another web server port or scheme for the location of the PHP-FPM status/ping pages, don't forget to change the macros {$PHP_FPM.SCHEME} and {$PHP_FPM.PORT}.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.PORT} | The port of the PHP-FPM status host or container. |
80 |
| {$PHP_FPM.SCHEME} | Request scheme which may be http or https |
http |
| {$PHP_FPM.HOST} | The hostname or IP address of the PHP-FPM status for a host or container. |
localhost |
| {$PHP_FPM.STATUS.PAGE} | The path of the PHP-FPM status page. |
status |
| {$PHP_FPM.PING.PAGE} | The path of the PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | The expected reply to the ping. |
pong |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum percent of the PHP-FPM queue usage for a trigger expression. |
80 |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Get ping page | HTTP agent | php-fpm.get_ping | |
| Get status page | HTTP agent | php-fpm.get_status | |
| Ping | Dependent item | php-fpm.ping Preprocessing
|
|
| Processes, active | The total number of active processes. |
Dependent item | php-fpm.processes_active Preprocessing
|
| Version | The current version of the PHP. You can get it from the HTTP-Header "X-Powered-By"; it may not work if you have changed the default HTTP-headers. |
Dependent item | php-fpm.version Preprocessing
|
| Pool name | The name of the current pool. |
Dependent item | php-fpm.name Preprocessing
|
| Uptime | It indicates how long has this pool been running. |
Dependent item | php-fpm.uptime Preprocessing
|
| Start time | The time when this pool was started. |
Dependent item | php-fpm.start_time Preprocessing
|
| Processes, total | The total number of server processes currently running. |
Dependent item | php-fpm.processes_total Preprocessing
|
| Processes, idle | The total number of idle processes. |
Dependent item | php-fpm.processes_idle Preprocessing
|
| Process manager | The method used by the process manager to control the number of child processes for this pool. |
Dependent item | php-fpm.process_manager Preprocessing
|
| Processes, max active | The highest value of "active processes" since the PHP-FPM server was started. |
Dependent item | php-fpm.processes_max_active Preprocessing
|
| Accepted connections per second | The number of accepted requests per second. |
Dependent item | php-fpm.conn_accepted.rate Preprocessing
|
| Slow requests | The number of requests that has exceeded your |
Dependent item | php-fpm.slow_requests Preprocessing
|
| Listen queue | The current number of connections that have been initiated but not yet accepted. |
Dependent item | php-fpm.listen_queue Preprocessing
|
| Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool was started. |
Dependent item | php-fpm.listen_queue_max Preprocessing
|
| Listen queue, len | The size of the socket queue of pending connections. |
Dependent item | php-fpm.listen_queue_len Preprocessing
|
| Queue usage | The utilization of the queue. |
Calculated | php-fpm.listen_queue_usage |
| Max children reached | The number of times that |
Dependent item | php-fpm.max_children Preprocessing
|
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Service is down | last(/PHP-FPM by HTTP/php-fpm.ping)=0 or nodata(/PHP-FPM by HTTP/php-fpm.ping,3m)=1 |
High | Manual close: Yes | |
| PHP-FPM: Version has changed | The PHP-FPM version has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by HTTP/php-fpm.version,#1)<>last(/PHP-FPM by HTTP/php-fpm.version,#2) and length(last(/PHP-FPM by HTTP/php-fpm.version))>0 |
Info | Manual close: Yes |
| PHP-FPM: Failed to fetch info data | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/PHP-FPM by HTTP/php-fpm.uptime,30m)=1 |
Info | Manual close: Yes Depends on:
|
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by HTTP/php-fpm.uptime)<10m |
Info | Manual close: Yes |
| PHP-FPM: Manager changed | The PHP-FPM manager has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by HTTP/php-fpm.process_manager,#1)<>last(/PHP-FPM by HTTP/php-fpm.process_manager,#2) |
Info | Manual close: Yes |
| PHP-FPM: Detected slow requests | The PHP-FPM has detected a slow request. |
min(/PHP-FPM by HTTP/php-fpm.slow_requests,#3)>0 |
Warning | |
| PHP-FPM: Queue utilization is high | The queue for this pool has reached |
min(/PHP-FPM by HTTP/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
Warning |
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_http?at=release/6.4
This template is developed to monitor the FastCGI Process Manager (PHP-FPM) by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template PHP-FPM by Zabbix agent - collects metrics by polling PHP-FPM status-page with HTTP agent remotely.
Note that this solution supports HTTPS and redirects.
Zabbix version: 6.4 and higher.
This template has been tested on:
Zabbix should be configured according to the instructions in the Templates out of the box section.
Note that depending on your OS distribution, the PHP-FPM executable/service name can vary. RHEL-like distributions usually name both process and service as php-fpm, while for Debian/Ubuntu based distributions it may include the version, for example: executable name - php-fpm8.2, systemd service name - php8.2-fpm. Adjust the following instructions accordingly if needed.
pm.status_path = /status
ping.path = /ping
<version> in the command if needed.$ php-fpm -t
or
$ php-fpm<version> -t
php-fpm service to make the change active. Replace the <version> in the command if needed.$ systemctl reload php-fpm
or
$ systemctl reload php<version>-fpm
If you use Nginx, edit the configuration file of your Nginx server block (virtual host) and add the location block below it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
If you use Apache, edit the configuration file of the virtual host and add the following location blocks.
<LocationMatch "/status">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/status"
</LocationMatch>
<LocationMatch "/ping">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/ping"
</LocationMatch>
$ nginx -t
or
$ httpd -t
or
$ apachectl configtest
$ systemctl reload nginx
or
$ systemctl reload httpd
or
$ systemctl reload apache2
curl -L 127.0.0.1/status
curl -L 127.0.0.1/ping
If you use another location of the status/ping pages, don't forget to change the {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use another web server port or scheme for the location of the PHP-FPM status/ping pages, don't forget to change the macros {$PHP_FPM.SCHEME} and {$PHP_FPM.PORT}.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.PORT} | The port of the PHP-FPM status host or container. |
80 |
| {$PHP_FPM.SCHEME} | Request scheme which may be http or https |
http |
| {$PHP_FPM.HOST} | The hostname or IP address of the PHP-FPM status for a host or container. |
localhost |
| {$PHP_FPM.STATUS.PAGE} | The path of the PHP-FPM status page. |
status |
| {$PHP_FPM.PING.PAGE} | The path of the PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | The expected reply to the ping. |
pong |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum percent of the PHP-FPM queue usage for a trigger expression. |
80 |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| PHP-FPM: Get ping page | HTTP agent | php-fpm.get_ping | |
| PHP-FPM: Get status page | HTTP agent | php-fpm.get_status | |
| PHP-FPM: Ping | Dependent item | php-fpm.ping Preprocessing
|
|
| PHP-FPM: Processes, active | The total number of active processes. |
Dependent item | php-fpm.processes_active Preprocessing
|
| PHP-FPM: Version | The current version of the PHP. You can get it from the HTTP-Header "X-Powered-By"; it may not work if you have changed the default HTTP-headers. |
Dependent item | php-fpm.version Preprocessing
|
| PHP-FPM: Pool name | The name of the current pool. |
Dependent item | php-fpm.name Preprocessing
|
| PHP-FPM: Uptime | It indicates how long has this pool been running. |
Dependent item | php-fpm.uptime Preprocessing
|
| PHP-FPM: Start time | The time when this pool was started. |
Dependent item | php-fpm.start_time Preprocessing
|
| PHP-FPM: Processes, total | The total number of server processes currently running. |
Dependent item | php-fpm.processes_total Preprocessing
|
| PHP-FPM: Processes, idle | The total number of idle processes. |
Dependent item | php-fpm.processes_idle Preprocessing
|
| PHP-FPM: Process manager | The method used by the process manager to control the number of child processes for this pool. |
Dependent item | php-fpm.process_manager Preprocessing
|
| PHP-FPM: Processes, max active | The highest value of "active processes" since the PHP-FPM server was started. |
Dependent item | php-fpm.processes_max_active Preprocessing
|
| PHP-FPM: Accepted connections per second | The number of accepted requests per second. |
Dependent item | php-fpm.conn_accepted.rate Preprocessing
|
| PHP-FPM: Slow requests | The number of requests that has exceeded your |
Dependent item | php-fpm.slow_requests Preprocessing
|
| PHP-FPM: Listen queue | The current number of connections that have been initiated but not yet accepted. |
Dependent item | php-fpm.listen_queue Preprocessing
|
| PHP-FPM: Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool was started. |
Dependent item | php-fpm.listen_queue_max Preprocessing
|
| PHP-FPM: Listen queue, len | The size of the socket queue of pending connections. |
Dependent item | php-fpm.listen_queue_len Preprocessing
|
| PHP-FPM: Queue usage | The utilization of the queue. |
Calculated | php-fpm.listen_queue_usage |
| PHP-FPM: Max children reached | The number of times that |
Dependent item | php-fpm.max_children Preprocessing
|
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Service is down | last(/PHP-FPM by HTTP/php-fpm.ping)=0 or nodata(/PHP-FPM by HTTP/php-fpm.ping,3m)=1 |
High | Manual close: Yes | |
| PHP-FPM: Version has changed | The PHP-FPM version has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by HTTP/php-fpm.version,#1)<>last(/PHP-FPM by HTTP/php-fpm.version,#2) and length(last(/PHP-FPM by HTTP/php-fpm.version))>0 |
Info | Manual close: Yes |
| PHP-FPM: Failed to fetch info data | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/PHP-FPM by HTTP/php-fpm.uptime,30m)=1 |
Info | Manual close: Yes Depends on:
|
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by HTTP/php-fpm.uptime)<10m |
Info | Manual close: Yes |
| PHP-FPM: Manager changed | The PHP-FPM manager has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by HTTP/php-fpm.process_manager,#1)<>last(/PHP-FPM by HTTP/php-fpm.process_manager,#2) |
Info | Manual close: Yes |
| PHP-FPM: Detected slow requests | The PHP-FPM has detected a slow request. |
min(/PHP-FPM by HTTP/php-fpm.slow_requests,#3)>0 |
Warning | |
| PHP-FPM: Queue utilization is high | The queue for this pool has reached |
min(/PHP-FPM by HTTP/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
Warning |
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_http?at=release/6.2
For Zabbix version: 6.2 and higher
The template to monitor PHP-FPM by Zabbix that work without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
Template PHP-FPM by HTTP collects metrics by polling PHP-FPM status-page with HTTP agent remotely.
Note that this solution supports https and redirects.
This template was tested on:
See Zabbix template operation for basic instructions.
Open the php-fpm configuration file and enable the status page as shown.
pm.status_path = /status
ping.path = /ping
Validate the syntax is fine before we reload the service
$ php-fpm7 -t
Reload the php-fpm service to make the change active
$ systemctl reload php-fpm
Next, edit your Nginx server block (virtual host) configuration file and add the location block below in it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
Check the syntax
$ nginx -t
Reload Nginx
$ systemctl reload nginx
Verify
curl -L 127.0.0.1/status
If you use another location of status/ping page, don't forget to change {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use an atypical location for PHP-FPM status-page don't forget to change the macros {$PHP_FPM.SCHEME},{$PHP_FPM.PORT}.
No specific Zabbix configuration is required.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.HOST} | Hostname or IP of PHP-FPM status host or container. |
localhost |
| {$PHP_FPM.PING.PAGE} | The path of PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | Expected reply to the ping. |
pong |
| {$PHP_FPM.PORT} | The port of PHP-FPM status host or container. |
80 |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum PHP-FPM queue usage percent for trigger expression. |
80 |
| {$PHP_FPM.SCHEME} | Request scheme which may be http or https |
http |
| {$PHP_FPM.STATUS.PAGE} | The path of PHP-FPM status page. |
status |
There are no template links in this template.
| Group | Name | Description | Type | Key and additional info |
|---|---|---|---|---|
| PHP-FPM | PHP-FPM: Ping | - |
DEPENDENT | php-fpm.ping Preprocessing: - REGEX: `{$PHP_FPM.PING.REPLY}($ |
| PHP-FPM | PHP-FPM: Processes, active | The total number of active processes. |
DEPENDENT | php-fpm.processes_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Version | Current version PHP. Get from HTTP-Header "X-Powered-By" and may not work if you change default HTTP-headers. |
DEPENDENT | php-fpm.version Preprocessing: - REGEX: ⛔️ON_FAIL: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Pool name | The name of current pool. |
DEPENDENT | php-fpm.name Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Uptime | How long has this pool been running. |
DEPENDENT | php-fpm.uptime Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Start time | The time when this pool was started. |
DEPENDENT | php-fpm.start_time Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, total | The total number of server processes currently running. |
DEPENDENT | php-fpm.processes_total Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, idle | The total number of idle processes. |
DEPENDENT | php-fpm.processes_idle Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Process manager | The method used by the process manager to control the number of child processes for this pool. |
DEPENDENT | php-fpm.process_manager Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Processes, max active | The highest value that 'active processes' has reached since the php-fpm server started. |
DEPENDENT | php-fpm.processes_max_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Accepted connections per second | The number of accepted requests per second. |
DEPENDENT | php-fpm.conn_accepted.rate Preprocessing: - JSONPATH: - CHANGE_PER_SECOND |
| PHP-FPM | PHP-FPM: Slow requests | The number of requests that exceeded your request_slowlog_timeout value. |
DEPENDENT | php-fpm.slow_requests Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| PHP-FPM | PHP-FPM: Listen queue | The current number of connections that have been initiated, but not yet accepted. |
DEPENDENT | php-fpm.listen_queue Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool has started. |
DEPENDENT | php-fpm.listen_queue_max Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, len | Size of the socket queue of pending connections. |
DEPENDENT | php-fpm.listen_queue_len Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Queue usage | Queue utilization |
CALCULATED | php-fpm.listen_queue_usage Expression: last(//php-fpm.listen_queue)/(last(//php-fpm.listen_queue_len)+(last(//php-fpm.listen_queue_len)=0))*100 |
| PHP-FPM | PHP-FPM: Max children reached | The number of times that pm.max_children has been reached since the php-fpm pool started |
DEPENDENT | php-fpm.max_children Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| Zabbix raw items | PHP-FPM: Get ping page | - |
HTTP_AGENT | php-fpm.get_ping |
| Zabbix raw items | PHP-FPM: Get status page | - |
HTTP_AGENT | php-fpm.get_status |
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Service is down | - |
last(/PHP-FPM by HTTP/php-fpm.ping)=0 or nodata(/PHP-FPM by HTTP/php-fpm.ping,3m)=1 |
HIGH | Manual close: YES |
| PHP-FPM: Version has changed | PHP-FPM version has changed. Ack to close. |
last(/PHP-FPM by HTTP/php-fpm.version,#1)<>last(/PHP-FPM by HTTP/php-fpm.version,#2) and length(last(/PHP-FPM by HTTP/php-fpm.version))>0 |
INFO | Manual close: YES |
| PHP-FPM: Failed to fetch info data | Zabbix has not received data for items for the last 30 minutes |
nodata(/PHP-FPM by HTTP/php-fpm.uptime,30m)=1 |
INFO | Manual close: YES Depends on: - PHP-FPM: Service is down |
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by HTTP/php-fpm.uptime)<10m |
INFO | Manual close: YES |
| PHP-FPM: Manager changed | PHP-FPM manager changed. Ack to close. |
last(/PHP-FPM by HTTP/php-fpm.process_manager,#1)<>last(/PHP-FPM by HTTP/php-fpm.process_manager,#2) |
INFO | Manual close: YES |
| PHP-FPM: Detected slow requests | PHP-FPM detected slow request. A slow request means that it took more time to execute than expected (defined in the configuration of your pool). |
min(/PHP-FPM by HTTP/php-fpm.slow_requests,#3)>0 |
WARNING | |
| PHP-FPM: Queue utilization is high | The queue for this pool reached {$PHP_FPM.QUEUE.WARN.MAX}% of its maximum capacity. Items in queue represent the current number of connections that have been initiated on this pool, but not yet accepted. |
min(/PHP-FPM by HTTP/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
WARNING |
Please report any issues with the template at https://support.zabbix.com
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_http?at=release/6.0
This template is developed to monitor the FastCGI Process Manager (PHP-FPM) by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template PHP-FPM by Zabbix agent - collects metrics by polling PHP-FPM status-page with HTTP agent remotely.
Note that this solution supports HTTPS and redirects.
Zabbix version: 6.0 and higher.
This template has been tested on:
Zabbix should be configured according to the instructions in the Templates out of the box section.
Note that depending on your OS distribution, the PHP-FPM executable/service name can vary. RHEL-like distributions usually name both process and service as php-fpm, while for Debian/Ubuntu based distributions it may include the version, for example: executable name - php-fpm8.2, systemd service name - php8.2-fpm. Adjust the following instructions accordingly if needed.
pm.status_path = /status
ping.path = /ping
<version> in the command if needed.$ php-fpm -t
or
$ php-fpm<version> -t
php-fpm service to make the change active. Replace the <version> in the command if needed.$ systemctl reload php-fpm
or
$ systemctl reload php<version>-fpm
If you use Nginx, edit the configuration file of your Nginx server block (virtual host) and add the location block below it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
If you use Apache, edit the configuration file of the virtual host and add the following location blocks.
<LocationMatch "/status">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/status"
</LocationMatch>
<LocationMatch "/ping">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/ping"
</LocationMatch>
$ nginx -t
or
$ httpd -t
or
$ apachectl configtest
$ systemctl reload nginx
or
$ systemctl reload httpd
or
$ systemctl reload apache2
curl -L 127.0.0.1/status
curl -L 127.0.0.1/ping
If you use another location of the status/ping pages, don't forget to change the {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use another web server port or scheme for the location of the PHP-FPM status/ping pages, don't forget to change the macros {$PHP_FPM.SCHEME} and {$PHP_FPM.PORT}.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.PORT} | The port of the PHP-FPM status host or container. |
80 |
| {$PHP_FPM.SCHEME} | Request scheme which may be http or https |
http |
| {$PHP_FPM.HOST} | The hostname or IP address of the PHP-FPM status for a host or container. |
localhost |
| {$PHP_FPM.STATUS.PAGE} | The path of the PHP-FPM status page. |
status |
| {$PHP_FPM.PING.PAGE} | The path of the PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | The expected reply to the ping. |
pong |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum percent of the PHP-FPM queue usage for a trigger expression. |
80 |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| PHP-FPM: Get ping page | HTTP agent | php-fpm.get_ping | |
| PHP-FPM: Get status page | HTTP agent | php-fpm.get_status | |
| PHP-FPM: Ping | Dependent item | php-fpm.ping Preprocessing
|
|
| PHP-FPM: Processes, active | The total number of active processes. |
Dependent item | php-fpm.processes_active Preprocessing
|
| PHP-FPM: Version | The current version of the PHP. You can get it from the HTTP-Header "X-Powered-By"; it may not work if you have changed the default HTTP-headers. |
Dependent item | php-fpm.version Preprocessing
|
| PHP-FPM: Pool name | The name of the current pool. |
Dependent item | php-fpm.name Preprocessing
|
| PHP-FPM: Uptime | It indicates how long has this pool been running. |
Dependent item | php-fpm.uptime Preprocessing
|
| PHP-FPM: Start time | The time when this pool was started. |
Dependent item | php-fpm.start_time Preprocessing
|
| PHP-FPM: Processes, total | The total number of server processes currently running. |
Dependent item | php-fpm.processes_total Preprocessing
|
| PHP-FPM: Processes, idle | The total number of idle processes. |
Dependent item | php-fpm.processes_idle Preprocessing
|
| PHP-FPM: Process manager | The method used by the process manager to control the number of child processes for this pool. |
Dependent item | php-fpm.process_manager Preprocessing
|
| PHP-FPM: Processes, max active | The highest value of "active processes" since the PHP-FPM server was started. |
Dependent item | php-fpm.processes_max_active Preprocessing
|
| PHP-FPM: Accepted connections per second | The number of accepted requests per second. |
Dependent item | php-fpm.conn_accepted.rate Preprocessing
|
| PHP-FPM: Slow requests | The number of requests that has exceeded your |
Dependent item | php-fpm.slow_requests Preprocessing
|
| PHP-FPM: Listen queue | The current number of connections that have been initiated but not yet accepted. |
Dependent item | php-fpm.listen_queue Preprocessing
|
| PHP-FPM: Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool was started. |
Dependent item | php-fpm.listen_queue_max Preprocessing
|
| PHP-FPM: Listen queue, len | The size of the socket queue of pending connections. |
Dependent item | php-fpm.listen_queue_len Preprocessing
|
| PHP-FPM: Queue usage | The utilization of the queue. |
Calculated | php-fpm.listen_queue_usage |
| PHP-FPM: Max children reached | The number of times that |
Dependent item | php-fpm.max_children Preprocessing
|
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Service is down | last(/PHP-FPM by HTTP/php-fpm.ping)=0 or nodata(/PHP-FPM by HTTP/php-fpm.ping,3m)=1 |
High | Manual close: Yes | |
| PHP-FPM: Version has changed | The PHP-FPM version has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by HTTP/php-fpm.version,#1)<>last(/PHP-FPM by HTTP/php-fpm.version,#2) and length(last(/PHP-FPM by HTTP/php-fpm.version))>0 |
Info | Manual close: Yes |
| PHP-FPM: Failed to fetch info data | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/PHP-FPM by HTTP/php-fpm.uptime,30m)=1 |
Info | Manual close: Yes Depends on:
|
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by HTTP/php-fpm.uptime)<10m |
Info | Manual close: Yes |
| PHP-FPM: Manager changed | The PHP-FPM manager has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by HTTP/php-fpm.process_manager,#1)<>last(/PHP-FPM by HTTP/php-fpm.process_manager,#2) |
Info | Manual close: Yes |
| PHP-FPM: Detected slow requests | The PHP-FPM has detected a slow request. |
min(/PHP-FPM by HTTP/php-fpm.slow_requests,#3)>0 |
Warning | |
| PHP-FPM: Queue utilization is high | The queue for this pool has reached |
min(/PHP-FPM by HTTP/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
Warning |
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_http?at=release/5.4
For Zabbix version: 5.4 and higher
The template to monitor PHP-FPM by Zabbix that work without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
Template PHP-FPM by HTTP collects metrics by polling PHP-FPM status-page with HTTP agent remotely.
Note that this solution supports https and redirects.
This template was tested on:
See Zabbix template operation for basic instructions.
Open the php-fpm configuration file and enable the status page as shown.
pm.status_path = /status
ping.path = /ping
Validate the syntax is fine before we reload the service
$ php-fpm7 -t
Reload the php-fpm service to make the change active
$ systemctl reload php-fpm
Next, edit your Nginx server block (virtual host) configuration file and add the location block below in it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
Check the syntax
$ nginx -t
Reload Nginx
$ systemctl reload nginx
Verify
curl -L 127.0.0.1/status
If you use another location of status/ping page, don't forget to change {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use an atypical location for PHP-FPM status-page don't forget to change the macros {$PHP_FPM.SCHEME},{$PHP_FPM.PORT}.
No specific Zabbix configuration is required.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.HOST} | Hostname or IP of PHP-FPM status host or container. |
localhost |
| {$PHP_FPM.PING.PAGE} | The path of PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | Expected reply to the ping. |
pong |
| {$PHP_FPM.PORT} | The port of PHP-FPM status host or container. |
80 |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum PHP-FPM queue usage percent for trigger expression. |
80 |
| {$PHP_FPM.SCHEME} | Request scheme which may be http or https |
http |
| {$PHP_FPM.STATUS.PAGE} | The path of PHP-FPM status page. |
status |
There are no template links in this template.
| Group | Name | Description | Type | Key and additional info |
|---|---|---|---|---|
| PHP-FPM | PHP-FPM: Ping | - |
DEPENDENT | php-fpm.ping Preprocessing: - REGEX: `{$PHP_FPM.PING.REPLY}($ |
| PHP-FPM | PHP-FPM: Processes, active | The total number of active processes. |
DEPENDENT | php-fpm.processes_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Version | Current version PHP. Get from HTTP-Header "X-Powered-By" and may not work if you change default HTTP-headers. |
DEPENDENT | php-fpm.version Preprocessing: - REGEX: ⛔️ON_FAIL: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Pool name | The name of current pool. |
DEPENDENT | php-fpm.name Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Uptime | How long has this pool been running. |
DEPENDENT | php-fpm.uptime Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Start time | The time when this pool was started. |
DEPENDENT | php-fpm.start_time Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, total | The total number of server processes currently running. |
DEPENDENT | php-fpm.processes_total Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, idle | The total number of idle processes. |
DEPENDENT | php-fpm.processes_idle Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Process manager | The method used by the process manager to control the number of child processes for this pool. |
DEPENDENT | php-fpm.process_manager Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Processes, max active | The highest value that 'active processes' has reached since the php-fpm server started. |
DEPENDENT | php-fpm.processes_max_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Accepted connections per second | The number of accepted requests per second. |
DEPENDENT | php-fpm.conn_accepted.rate Preprocessing: - JSONPATH: - CHANGE_PER_SECOND |
| PHP-FPM | PHP-FPM: Slow requests | The number of requests that exceeded your request_slowlog_timeout value. |
DEPENDENT | php-fpm.slow_requests Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| PHP-FPM | PHP-FPM: Listen queue | The current number of connections that have been initiated, but not yet accepted. |
DEPENDENT | php-fpm.listen_queue Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool has started. |
DEPENDENT | php-fpm.listen_queue_max Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, len | Size of the socket queue of pending connections. |
DEPENDENT | php-fpm.listen_queue_len Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Queue usage | Queue utilization |
CALCULATED | php-fpm.listen_queue_usage Expression: last(//php-fpm.listen_queue)/(last(//php-fpm.listen_queue_len)+(last(//php-fpm.listen_queue_len)=0))*100 |
| PHP-FPM | PHP-FPM: Max children reached | The number of times that pm.max_children has been reached since the php-fpm pool started |
DEPENDENT | php-fpm.max_children Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| Zabbix_raw_items | PHP-FPM: Get ping page | - |
HTTP_AGENT | php-fpm.get_ping |
| Zabbix_raw_items | PHP-FPM: Get status page | - |
HTTP_AGENT | php-fpm.get_status |
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Service is down | - |
last(/PHP-FPM by HTTP/php-fpm.ping)=0 or nodata(/PHP-FPM by HTTP/php-fpm.ping,3m)=1 |
HIGH | Manual close: YES |
| PHP-FPM: Version has changed (new version: {ITEM.VALUE}) | PHP-FPM version has changed. Ack to close. |
last(/PHP-FPM by HTTP/php-fpm.version,#1)<>last(/PHP-FPM by HTTP/php-fpm.version,#2) and length(last(/PHP-FPM by HTTP/php-fpm.version))>0 |
INFO | Manual close: YES |
| PHP-FPM: Failed to fetch info data (or no data for 30m) | Zabbix has not received data for items for the last 30 minutes |
nodata(/PHP-FPM by HTTP/php-fpm.uptime,30m)=1 |
INFO | Manual close: YES Depends on: - PHP-FPM: Service is down |
| PHP-FPM: has been restarted (uptime < 10m) | Uptime is less than 10 minutes |
last(/PHP-FPM by HTTP/php-fpm.uptime)<10m |
INFO | Manual close: YES |
| PHP-FPM: Manager changed (new value received: {ITEM.VALUE}) | PHP-FPM manager changed. Ack to close. |
last(/PHP-FPM by HTTP/php-fpm.process_manager,#1)<>last(/PHP-FPM by HTTP/php-fpm.process_manager,#2) |
INFO | Manual close: YES |
| PHP-FPM: Detected slow requests | PHP-FPM detected slow request. A slow request means that it took more time to execute than expected (defined in the configuration of your pool). |
min(/PHP-FPM by HTTP/php-fpm.slow_requests,#3)>0 |
WARNING | |
| PHP-FPM: Queue utilization is high (over {$PHP_FPM.QUEUE.WARN.MAX}% for 15m) | The queue for this pool reached {$PHP_FPM.QUEUE.WARN.MAX}% of its maximum capacity. Items in queue represent the current number of connections that have been initiated on this pool, but not yet accepted. |
min(/PHP-FPM by HTTP/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
WARNING |
Please report any issues with the template at https://support.zabbix.com
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_http?at=release/5.0
For Zabbix version: 5.0 and higher
The template to monitor PHP-FPM by Zabbix that work without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
Template PHP-FPM by HTTP collects metrics by polling PHP-FPM status-page with HTTP agent remotely.
Note that this solution supports https and redirects.
This template was tested on:
See Zabbix template operation for basic instructions.
Open the php-fpm configuration file and enable the status page as shown.
pm.status_path = /status
ping.path = /ping
Validate the syntax is fine before we reload the service
$ php-fpm7 -t
Reload the php-fpm service to make the change active
$ systemctl reload php-fpm
Next, edit your Nginx server block (virtual host) configuration file and add the location block below in it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
Check the syntax
$ nginx -t
Reload Nginx
$ systemctl reload nginx
Verify
curl -L 127.0.0.1/status
If you use another location of status/ping page, don't forget to change {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use an atypical location for PHP-FPM status-page don't forget to change the macros {$PHP_FPM.SCHEME},{$PHP_FPM.PORT}.
No specific Zabbix configuration is required.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.HOST} | Hostname or IP of PHP-FPM status host or container. |
localhost |
| {$PHP_FPM.PING.PAGE} | The path of PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | Expected reply to the ping. |
pong |
| {$PHP_FPM.PORT} | The port of PHP-FPM status host or container. |
80 |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum PHP-FPM queue usage percent for trigger expression. |
80 |
| {$PHP_FPM.SCHEME} | Request scheme which may be http or https |
http |
| {$PHP_FPM.STATUS.PAGE} | The path of PHP-FPM status page. |
status |
There are no template links in this template.
| Group | Name | Description | Type | Key and additional info |
|---|---|---|---|---|
| PHP-FPM | PHP-FPM: Ping | - |
DEPENDENT | php-fpm.ping Preprocessing: - REGEX: `{$PHP_FPM.PING.REPLY}($ |
| PHP-FPM | PHP-FPM: Processes, active | The total number of active processes. |
DEPENDENT | php-fpm.processes_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Version | Current version PHP. Get from HTTP-Header "X-Powered-By" and may not work if you change default HTTP-headers. |
DEPENDENT | php-fpm.version Preprocessing: - REGEX: ⛔️ON_FAIL: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Pool name | The name of current pool. |
DEPENDENT | php-fpm.name Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Uptime | How long has this pool been running. |
DEPENDENT | php-fpm.uptime Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Start time | The time when this pool was started. |
DEPENDENT | php-fpm.start_time Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, total | The total number of server processes currently running. |
DEPENDENT | php-fpm.processes_total Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, idle | The total number of idle processes. |
DEPENDENT | php-fpm.processes_idle Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Process manager | The method used by the process manager to control the number of child processes for this pool. |
DEPENDENT | php-fpm.process_manager Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Processes, max active | The highest value that 'active processes' has reached since the php-fpm server started. |
DEPENDENT | php-fpm.processes_max_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Accepted connections per second | The number of accepted requests per second. |
DEPENDENT | php-fpm.conn_accepted.rate Preprocessing: - JSONPATH: - CHANGE_PER_SECOND |
| PHP-FPM | PHP-FPM: Slow requests | The number of requests that exceeded your request_slowlog_timeout value. |
DEPENDENT | php-fpm.slow_requests Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| PHP-FPM | PHP-FPM: Listen queue | The current number of connections that have been initiated, but not yet accepted. |
DEPENDENT | php-fpm.listen_queue Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool has started. |
DEPENDENT | php-fpm.listen_queue_max Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, len | Size of the socket queue of pending connections. |
DEPENDENT | php-fpm.listen_queue_len Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Queue usage | Queue utilization |
CALCULATED | php-fpm.listen_queue_usage Expression: last(php-fpm.listen_queue)/(last(php-fpm.listen_queue_len)+(last(php-fpm.listen_queue_len)=0))*100 |
| PHP-FPM | PHP-FPM: Max children reached | The number of times that pm.max_children has been reached since the php-fpm pool started |
DEPENDENT | php-fpm.max_children Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| Zabbix_raw_items | PHP-FPM: Get ping page | - |
HTTP_AGENT | php-fpm.get_ping |
| Zabbix_raw_items | PHP-FPM: Get status page | - |
HTTP_AGENT | php-fpm.get_status |
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Service is down | - |
{TEMPLATE_NAME:php-fpm.ping.last()}=0 or {TEMPLATE_NAME:php-fpm.ping.nodata(3m)}=1 |
HIGH | Manual close: YES |
| PHP-FPM: Version has changed (new version: {ITEM.VALUE}) | PHP-FPM version has changed. Ack to close. |
{TEMPLATE_NAME:php-fpm.version.diff()}=1 and {TEMPLATE_NAME:php-fpm.version.strlen()}>0 |
INFO | Manual close: YES |
| PHP-FPM: Failed to fetch info data (or no data for 30m) | Zabbix has not received data for items for the last 30 minutes |
{TEMPLATE_NAME:php-fpm.uptime.nodata(30m)}=1 |
INFO | Manual close: YES Depends on: - PHP-FPM: Service is down |
| PHP-FPM: Pool has been restarted (uptime < 10m) | Uptime is less than 10 minutes. |
{TEMPLATE_NAME:php-fpm.uptime.last()}<10m |
INFO | Manual close: YES |
| PHP-FPM: Manager changed (new value received: {ITEM.VALUE}) | PHP-FPM manager changed. Ack to close. |
{TEMPLATE_NAME:php-fpm.process_manager.diff()}=1 |
INFO | Manual close: YES |
| PHP-FPM: Detected slow requests | PHP-FPM detected slow request. A slow request means that it took more time to execute than expected (defined in the configuration of your pool). |
{TEMPLATE_NAME:php-fpm.slow_requests.min(#3)}>0 |
WARNING | |
| PHP-FPM: Queue utilization is high (over {$PHP_FPM.QUEUE.WARN.MAX}% for 15m) | The queue for this pool reached {$PHP_FPM.QUEUE.WARN.MAX}% of its maximum capacity. Items in queue represent the current number of connections that have been initiated on this pool, but not yet accepted. |
{TEMPLATE_NAME:php-fpm.listen_queue_usage.min(15m)} > {$PHP_FPM.QUEUE.WARN.MAX} |
WARNING |
Please report any issues with the template at https://support.zabbix.com
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_agent?at=release/7.4
This template is developed to monitor the FastCGI Process Manager (PHP-FPM) by Zabbix agent that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template PHP-FPM by Zabbix agent - collects metrics by polling the PHP-FPM status-page locally with Zabbix agent.
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get).
It also uses Zabbix agent to collect php-fpm Linux process statistics, such as CPU usage, memory usage, and whether the process is running or not.
Zabbix version: 7.4 and higher.
This template has been tested on:
Zabbix should be configured according to the instructions in the Templates out of the box section.
Note that depending on your OS distribution, the PHP-FPM executable/service name can vary. RHEL-like distributions usually name both process and service as php-fpm, while for Debian/Ubuntu based distributions it may include the version, for example: executable name - php-fpm8.2, systemd service name - php8.2-fpm. Adjust the following instructions accordingly if needed.
pm.status_path = /status
ping.path = /ping
<version> in the command if needed.$ php-fpm -t
or
$ php-fpm<version> -t
php-fpm service to make the change active. Replace the <version> in the command if needed.$ systemctl reload php-fpm
or
$ systemctl reload php<version>-fpm
If you use Nginx, edit the configuration file of your Nginx server block (virtual host) and add the location block below it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
If you use Apache, edit the configuration file of the virtual host and add the following location blocks.
<LocationMatch "/status">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/status"
</LocationMatch>
<LocationMatch "/ping">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/ping"
</LocationMatch>
$ nginx -t
or
$ httpd -t
or
$ apachectl configtest
$ systemctl reload nginx
or
$ systemctl reload httpd
or
$ systemctl reload apache2
curl -L 127.0.0.1/status
curl -L 127.0.0.1/ping
Depending on your OS distribution, the PHP-FPM process name may vary as well. Please check the actual name in the line "Name" from /proc/<pid>/status file (https://www.zabbix.com/documentation/7.4/manual/appendix/items/proc_mem_num_notes) and change the {$PHP_FPM.PROCESS.NAME.PARAMETER} macro if needed.
If you use another location of the status/ping pages, don't forget to change the {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use another web server port for the location of the PHP-FPM status/ping pages, don't forget to change the macro {$PHP_FPM.PORT}.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.PORT} | The port of the PHP-FPM status host or container. |
80 |
| {$PHP_FPM.HOST} | The hostname or IP address of the PHP-FPM status for a host or container. |
localhost |
| {$PHP_FPM.STATUS.PAGE} | The path of the PHP-FPM status page. |
status |
| {$PHP_FPM.PING.PAGE} | The path of the PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | The expected reply to the ping. |
pong |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum percent of the PHP-FPM queue usage for a trigger expression. |
80 |
| {$PHP_FPM.PROCESS_NAME} | The process name filter for the PHP-FPM process discovery. May vary depending on your OS distribution. |
php-fpm |
| {$PHP_FPM.PROCESS.NAME.PARAMETER} | The process name of the PHP-FPM used in the item key |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$PHP_FPM.PROCESS.NAME.PARAMETER},,,summary] |
| php-fpm_ping | Zabbix agent | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"] | |
| Get status page | Zabbix agent | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"] Preprocessing
|
|
| Ping | Dependent item | php-fpm.ping Preprocessing
|
|
| Processes, active | The total number of active processes. |
Dependent item | php-fpm.processes_active Preprocessing
|
| Version | The current version of the PHP. You can get it from the HTTP-Header "X-Powered-By"; it may not work if you have changed the default HTTP-headers. |
Dependent item | php-fpm.version Preprocessing
|
| Pool name | The name of the current pool. |
Dependent item | php-fpm.name Preprocessing
|
| Uptime | It indicates how long has this pool been running. |
Dependent item | php-fpm.uptime Preprocessing
|
| Start time | The time when this pool was started. |
Dependent item | php-fpm.start_time Preprocessing
|
| Processes, total | The total number of server processes currently running. |
Dependent item | php-fpm.processes_total Preprocessing
|
| Processes, idle | The total number of idle processes. |
Dependent item | php-fpm.processes_idle Preprocessing
|
| Queue usage | The utilization of the queue. |
Calculated | php-fpm.listen_queue_usage |
| Process manager | The method used by the process manager to control the number of child processes for this pool. |
Dependent item | php-fpm.process_manager Preprocessing
|
| Processes, max active | The highest value of "active processes" since the PHP-FPM server was started. |
Dependent item | php-fpm.processes_max_active Preprocessing
|
| Accepted connections per second | The number of accepted requests per second. |
Dependent item | php-fpm.conn_accepted.rate Preprocessing
|
| Slow requests | The number of requests that has exceeded your |
Dependent item | php-fpm.slow_requests Preprocessing
|
| Listen queue | The current number of connections that have been initiated but not yet accepted. |
Dependent item | php-fpm.listen_queue Preprocessing
|
| Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool was started. |
Dependent item | php-fpm.listen_queue_max Preprocessing
|
| Listen queue, len | The size of the socket queue of pending connections. |
Dependent item | php-fpm.listen_queue_len Preprocessing
|
| Max children reached | The number of times that |
Dependent item | php-fpm.max_children Preprocessing
|
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Version has changed | The PHP-FPM version has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by Zabbix agent/php-fpm.version,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.version,#2) and length(last(/PHP-FPM by Zabbix agent/php-fpm.version))>0 |
Info | Manual close: Yes |
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by Zabbix agent/php-fpm.uptime)<10m |
Info | Manual close: Yes |
| PHP-FPM: Queue utilization is high | The queue for this pool has reached |
min(/PHP-FPM by Zabbix agent/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
Warning | |
| PHP-FPM: Manager changed | The PHP-FPM manager has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#2) |
Info | Manual close: Yes |
| PHP-FPM: Detected slow requests | The PHP-FPM has detected a slow request. |
min(/PHP-FPM by Zabbix agent/php-fpm.slow_requests,#3)>0 |
Warning |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| PHP-FPM process discovery | The discovery of the PHP-FPM summary processes. |
Dependent item | php-fpm.proc.discovery |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Get process data | The summary metrics aggregated by a process |
Dependent item | php-fpm.proc.get[{#PHP_FPM.NAME}] Preprocessing
|
| Memory usage (rss) | The summary of resident set size memory used by a process |
Dependent item | php-fpm.proc.rss[{#PHP_FPM.NAME}] Preprocessing
|
| Memory usage (vsize) | The summary of virtual memory used by a process |
Dependent item | php-fpm.proc.vmem[{#PHP_FPM.NAME}] Preprocessing
|
| Memory usage, % | The percentage of real memory used by a process |
Dependent item | php-fpm.proc.pmem[{#PHP_FPM.NAME}] Preprocessing
|
| Number of running processes | The number of running processes |
Dependent item | php-fpm.proc.num[{#PHP_FPM.NAME}] Preprocessing
|
| CPU utilization | The percentage of the CPU utilization by a process |
Zabbix agent | proc.cpu.util[{#PHP_FPM.NAME}] |
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Process is not running | last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])=0 |
High | ||
| PHP-FPM: Failed to fetch info data | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/PHP-FPM by Zabbix agent/php-fpm.uptime,30m)=1 and last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])>0 |
Info | Manual close: Yes |
| PHP-FPM: Service is down | (last(/PHP-FPM by Zabbix agent/php-fpm.ping)=0 or nodata(/PHP-FPM by Zabbix agent/php-fpm.ping,3m)=1) and last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])>0 |
High | Manual close: Yes |
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_agent?at=release/7.2
This template is developed to monitor the FastCGI Process Manager (PHP-FPM) by Zabbix agent that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template PHP-FPM by Zabbix agent - collects metrics by polling the PHP-FPM status-page locally with Zabbix agent.
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get).
It also uses Zabbix agent to collect php-fpm Linux process statistics, such as CPU usage, memory usage, and whether the process is running or not.
Zabbix version: 7.2 and higher.
This template has been tested on:
Zabbix should be configured according to the instructions in the Templates out of the box section.
Note that depending on your OS distribution, the PHP-FPM executable/service name can vary. RHEL-like distributions usually name both process and service as php-fpm, while for Debian/Ubuntu based distributions it may include the version, for example: executable name - php-fpm8.2, systemd service name - php8.2-fpm. Adjust the following instructions accordingly if needed.
pm.status_path = /status
ping.path = /ping
<version> in the command if needed.$ php-fpm -t
or
$ php-fpm<version> -t
php-fpm service to make the change active. Replace the <version> in the command if needed.$ systemctl reload php-fpm
or
$ systemctl reload php<version>-fpm
If you use Nginx, edit the configuration file of your Nginx server block (virtual host) and add the location block below it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
If you use Apache, edit the configuration file of the virtual host and add the following location blocks.
<LocationMatch "/status">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/status"
</LocationMatch>
<LocationMatch "/ping">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/ping"
</LocationMatch>
$ nginx -t
or
$ httpd -t
or
$ apachectl configtest
$ systemctl reload nginx
or
$ systemctl reload httpd
or
$ systemctl reload apache2
curl -L 127.0.0.1/status
curl -L 127.0.0.1/ping
Depending on your OS distribution, the PHP-FPM process name may vary as well. Please check the actual name in the line "Name" from /proc/<pid>/status file (https://www.zabbix.com/documentation/7.2/manual/appendix/items/proc_mem_num_notes) and change the {$PHP_FPM.PROCESS.NAME.PARAMETER} macro if needed.
If you use another location of the status/ping pages, don't forget to change the {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use another web server port for the location of the PHP-FPM status/ping pages, don't forget to change the macro {$PHP_FPM.PORT}.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.PORT} | The port of the PHP-FPM status host or container. |
80 |
| {$PHP_FPM.HOST} | The hostname or IP address of the PHP-FPM status for a host or container. |
localhost |
| {$PHP_FPM.STATUS.PAGE} | The path of the PHP-FPM status page. |
status |
| {$PHP_FPM.PING.PAGE} | The path of the PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | The expected reply to the ping. |
pong |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum percent of the PHP-FPM queue usage for a trigger expression. |
80 |
| {$PHP_FPM.PROCESS_NAME} | The process name filter for the PHP-FPM process discovery. May vary depending on your OS distribution. |
php-fpm |
| {$PHP_FPM.PROCESS.NAME.PARAMETER} | The process name of the PHP-FPM used in the item key |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$PHP_FPM.PROCESS.NAME.PARAMETER},,,summary] |
| php-fpm_ping | Zabbix agent | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"] | |
| Get status page | Zabbix agent | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"] Preprocessing
|
|
| Ping | Dependent item | php-fpm.ping Preprocessing
|
|
| Processes, active | The total number of active processes. |
Dependent item | php-fpm.processes_active Preprocessing
|
| Version | The current version of the PHP. You can get it from the HTTP-Header "X-Powered-By"; it may not work if you have changed the default HTTP-headers. |
Dependent item | php-fpm.version Preprocessing
|
| Pool name | The name of the current pool. |
Dependent item | php-fpm.name Preprocessing
|
| Uptime | It indicates how long has this pool been running. |
Dependent item | php-fpm.uptime Preprocessing
|
| Start time | The time when this pool was started. |
Dependent item | php-fpm.start_time Preprocessing
|
| Processes, total | The total number of server processes currently running. |
Dependent item | php-fpm.processes_total Preprocessing
|
| Processes, idle | The total number of idle processes. |
Dependent item | php-fpm.processes_idle Preprocessing
|
| Queue usage | The utilization of the queue. |
Calculated | php-fpm.listen_queue_usage |
| Process manager | The method used by the process manager to control the number of child processes for this pool. |
Dependent item | php-fpm.process_manager Preprocessing
|
| Processes, max active | The highest value of "active processes" since the PHP-FPM server was started. |
Dependent item | php-fpm.processes_max_active Preprocessing
|
| Accepted connections per second | The number of accepted requests per second. |
Dependent item | php-fpm.conn_accepted.rate Preprocessing
|
| Slow requests | The number of requests that has exceeded your |
Dependent item | php-fpm.slow_requests Preprocessing
|
| Listen queue | The current number of connections that have been initiated but not yet accepted. |
Dependent item | php-fpm.listen_queue Preprocessing
|
| Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool was started. |
Dependent item | php-fpm.listen_queue_max Preprocessing
|
| Listen queue, len | The size of the socket queue of pending connections. |
Dependent item | php-fpm.listen_queue_len Preprocessing
|
| Max children reached | The number of times that |
Dependent item | php-fpm.max_children Preprocessing
|
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Version has changed | The PHP-FPM version has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by Zabbix agent/php-fpm.version,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.version,#2) and length(last(/PHP-FPM by Zabbix agent/php-fpm.version))>0 |
Info | Manual close: Yes |
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by Zabbix agent/php-fpm.uptime)<10m |
Info | Manual close: Yes |
| PHP-FPM: Queue utilization is high | The queue for this pool has reached |
min(/PHP-FPM by Zabbix agent/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
Warning | |
| PHP-FPM: Manager changed | The PHP-FPM manager has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#2) |
Info | Manual close: Yes |
| PHP-FPM: Detected slow requests | The PHP-FPM has detected a slow request. |
min(/PHP-FPM by Zabbix agent/php-fpm.slow_requests,#3)>0 |
Warning |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| PHP-FPM process discovery | The discovery of the PHP-FPM summary processes. |
Dependent item | php-fpm.proc.discovery |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Get process data | The summary metrics aggregated by a process |
Dependent item | php-fpm.proc.get[{#PHP_FPM.NAME}] Preprocessing
|
| Memory usage (rss) | The summary of resident set size memory used by a process |
Dependent item | php-fpm.proc.rss[{#PHP_FPM.NAME}] Preprocessing
|
| Memory usage (vsize) | The summary of virtual memory used by a process |
Dependent item | php-fpm.proc.vmem[{#PHP_FPM.NAME}] Preprocessing
|
| Memory usage, % | The percentage of real memory used by a process |
Dependent item | php-fpm.proc.pmem[{#PHP_FPM.NAME}] Preprocessing
|
| Number of running processes | The number of running processes |
Dependent item | php-fpm.proc.num[{#PHP_FPM.NAME}] Preprocessing
|
| CPU utilization | The percentage of the CPU utilization by a process |
Zabbix agent | proc.cpu.util[{#PHP_FPM.NAME}] |
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Process is not running | last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])=0 |
High | ||
| PHP-FPM: Failed to fetch info data | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/PHP-FPM by Zabbix agent/php-fpm.uptime,30m)=1 and last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])>0 |
Info | Manual close: Yes |
| PHP-FPM: Service is down | (last(/PHP-FPM by Zabbix agent/php-fpm.ping)=0 or nodata(/PHP-FPM by Zabbix agent/php-fpm.ping,3m)=1) and last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])>0 |
High | Manual close: Yes |
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_agent?at=release/7.0
This template is developed to monitor the FastCGI Process Manager (PHP-FPM) by Zabbix agent that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template PHP-FPM by Zabbix agent - collects metrics by polling the PHP-FPM status-page locally with Zabbix agent.
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get).
It also uses Zabbix agent to collect php-fpm Linux process statistics, such as CPU usage, memory usage, and whether the process is running or not.
Zabbix version: 7.0 and higher.
This template has been tested on:
Zabbix should be configured according to the instructions in the Templates out of the box section.
Note that depending on your OS distribution, the PHP-FPM executable/service name can vary. RHEL-like distributions usually name both process and service as php-fpm, while for Debian/Ubuntu based distributions it may include the version, for example: executable name - php-fpm8.2, systemd service name - php8.2-fpm. Adjust the following instructions accordingly if needed.
pm.status_path = /status
ping.path = /ping
<version> in the command if needed.$ php-fpm -t
or
$ php-fpm<version> -t
php-fpm service to make the change active. Replace the <version> in the command if needed.$ systemctl reload php-fpm
or
$ systemctl reload php<version>-fpm
If you use Nginx, edit the configuration file of your Nginx server block (virtual host) and add the location block below it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
If you use Apache, edit the configuration file of the virtual host and add the following location blocks.
<LocationMatch "/status">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/status"
</LocationMatch>
<LocationMatch "/ping">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/ping"
</LocationMatch>
$ nginx -t
or
$ httpd -t
or
$ apachectl configtest
$ systemctl reload nginx
or
$ systemctl reload httpd
or
$ systemctl reload apache2
curl -L 127.0.0.1/status
curl -L 127.0.0.1/ping
Depending on your OS distribution, the PHP-FPM process name may vary as well. Please check the actual name in the line "Name" from /proc/<pid>/status file (https://www.zabbix.com/documentation/7.0/manual/appendix/items/proc_mem_num_notes) and change the {$PHP_FPM.PROCESS.NAME.PARAMETER} macro if needed.
If you use another location of the status/ping pages, don't forget to change the {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use another web server port for the location of the PHP-FPM status/ping pages, don't forget to change the macro {$PHP_FPM.PORT}.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.PORT} | The port of the PHP-FPM status host or container. |
80 |
| {$PHP_FPM.HOST} | The hostname or IP address of the PHP-FPM status for a host or container. |
localhost |
| {$PHP_FPM.STATUS.PAGE} | The path of the PHP-FPM status page. |
status |
| {$PHP_FPM.PING.PAGE} | The path of the PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | The expected reply to the ping. |
pong |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum percent of the PHP-FPM queue usage for a trigger expression. |
80 |
| {$PHP_FPM.PROCESS_NAME} | The process name filter for the PHP-FPM process discovery. May vary depending on your OS distribution. |
php-fpm |
| {$PHP_FPM.PROCESS.NAME.PARAMETER} | The process name of the PHP-FPM used in the item key |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$PHP_FPM.PROCESS.NAME.PARAMETER},,,summary] |
| php-fpm_ping | Zabbix agent | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"] | |
| Get status page | Zabbix agent | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"] Preprocessing
|
|
| Ping | Dependent item | php-fpm.ping Preprocessing
|
|
| Processes, active | The total number of active processes. |
Dependent item | php-fpm.processes_active Preprocessing
|
| Version | The current version of the PHP. You can get it from the HTTP-Header "X-Powered-By"; it may not work if you have changed the default HTTP-headers. |
Dependent item | php-fpm.version Preprocessing
|
| Pool name | The name of the current pool. |
Dependent item | php-fpm.name Preprocessing
|
| Uptime | It indicates how long has this pool been running. |
Dependent item | php-fpm.uptime Preprocessing
|
| Start time | The time when this pool was started. |
Dependent item | php-fpm.start_time Preprocessing
|
| Processes, total | The total number of server processes currently running. |
Dependent item | php-fpm.processes_total Preprocessing
|
| Processes, idle | The total number of idle processes. |
Dependent item | php-fpm.processes_idle Preprocessing
|
| Queue usage | The utilization of the queue. |
Calculated | php-fpm.listen_queue_usage |
| Process manager | The method used by the process manager to control the number of child processes for this pool. |
Dependent item | php-fpm.process_manager Preprocessing
|
| Processes, max active | The highest value of "active processes" since the PHP-FPM server was started. |
Dependent item | php-fpm.processes_max_active Preprocessing
|
| Accepted connections per second | The number of accepted requests per second. |
Dependent item | php-fpm.conn_accepted.rate Preprocessing
|
| Slow requests | The number of requests that has exceeded your |
Dependent item | php-fpm.slow_requests Preprocessing
|
| Listen queue | The current number of connections that have been initiated but not yet accepted. |
Dependent item | php-fpm.listen_queue Preprocessing
|
| Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool was started. |
Dependent item | php-fpm.listen_queue_max Preprocessing
|
| Listen queue, len | The size of the socket queue of pending connections. |
Dependent item | php-fpm.listen_queue_len Preprocessing
|
| Max children reached | The number of times that |
Dependent item | php-fpm.max_children Preprocessing
|
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Version has changed | The PHP-FPM version has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by Zabbix agent/php-fpm.version,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.version,#2) and length(last(/PHP-FPM by Zabbix agent/php-fpm.version))>0 |
Info | Manual close: Yes |
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by Zabbix agent/php-fpm.uptime)<10m |
Info | Manual close: Yes |
| PHP-FPM: Queue utilization is high | The queue for this pool has reached |
min(/PHP-FPM by Zabbix agent/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
Warning | |
| PHP-FPM: Manager changed | The PHP-FPM manager has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#2) |
Info | Manual close: Yes |
| PHP-FPM: Detected slow requests | The PHP-FPM has detected a slow request. |
min(/PHP-FPM by Zabbix agent/php-fpm.slow_requests,#3)>0 |
Warning |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| PHP-FPM process discovery | The discovery of the PHP-FPM summary processes. |
Dependent item | php-fpm.proc.discovery |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Get process data | The summary metrics aggregated by a process |
Dependent item | php-fpm.proc.get[{#PHP_FPM.NAME}] Preprocessing
|
| Memory usage (rss) | The summary of resident set size memory used by a process |
Dependent item | php-fpm.proc.rss[{#PHP_FPM.NAME}] Preprocessing
|
| Memory usage (vsize) | The summary of virtual memory used by a process |
Dependent item | php-fpm.proc.vmem[{#PHP_FPM.NAME}] Preprocessing
|
| Memory usage, % | The percentage of real memory used by a process |
Dependent item | php-fpm.proc.pmem[{#PHP_FPM.NAME}] Preprocessing
|
| Number of running processes | The number of running processes |
Dependent item | php-fpm.proc.num[{#PHP_FPM.NAME}] Preprocessing
|
| CPU utilization | The percentage of the CPU utilization by a process |
Zabbix agent | proc.cpu.util[{#PHP_FPM.NAME}] |
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Process is not running | last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])=0 |
High | ||
| PHP-FPM: Failed to fetch info data | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/PHP-FPM by Zabbix agent/php-fpm.uptime,30m)=1 and last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])>0 |
Info | Manual close: Yes |
| PHP-FPM: Service is down | (last(/PHP-FPM by Zabbix agent/php-fpm.ping)=0 or nodata(/PHP-FPM by Zabbix agent/php-fpm.ping,3m)=1) and last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])>0 |
High | Manual close: Yes |
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_agent?at=release/6.4
This template is developed to monitor the FastCGI Process Manager (PHP-FPM) by Zabbix agent that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template PHP-FPM by Zabbix agent - collects metrics by polling the PHP-FPM status-page locally with Zabbix agent.
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get).
It also uses Zabbix agent to collect php-fpm Linux process statistics, such as CPU usage, memory usage, and whether the process is running or not.
Zabbix version: 6.4 and higher.
This template has been tested on:
Zabbix should be configured according to the instructions in the Templates out of the box section.
Note that depending on your OS distribution, the PHP-FPM executable/service name can vary. RHEL-like distributions usually name both process and service as php-fpm, while for Debian/Ubuntu based distributions it may include the version, for example: executable name - php-fpm8.2, systemd service name - php8.2-fpm. Adjust the following instructions accordingly if needed.
pm.status_path = /status
ping.path = /ping
<version> in the command if needed.$ php-fpm -t
or
$ php-fpm<version> -t
php-fpm service to make the change active. Replace the <version> in the command if needed.$ systemctl reload php-fpm
or
$ systemctl reload php<version>-fpm
If you use Nginx, edit the configuration file of your Nginx server block (virtual host) and add the location block below it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
If you use Apache, edit the configuration file of the virtual host and add the following location blocks.
<LocationMatch "/status">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/status"
</LocationMatch>
<LocationMatch "/ping">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/ping"
</LocationMatch>
$ nginx -t
or
$ httpd -t
or
$ apachectl configtest
$ systemctl reload nginx
or
$ systemctl reload httpd
or
$ systemctl reload apache2
curl -L 127.0.0.1/status
curl -L 127.0.0.1/ping
Depending on your OS distribution, the PHP-FPM process name may vary as well. Please check the actual name in the line "Name" from /proc/<pid>/status file (https://www.zabbix.com/documentation/6.4/manual/appendix/items/proc_mem_num_notes) and change the {$PHP_FPM.PROCESS.NAME.PARAMETER} macro if needed.
If you use another location of the status/ping pages, don't forget to change the {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use another web server port for the location of the PHP-FPM status/ping pages, don't forget to change the macro {$PHP_FPM.PORT}.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.PORT} | The port of the PHP-FPM status host or container. |
80 |
| {$PHP_FPM.HOST} | The hostname or IP address of the PHP-FPM status for a host or container. |
localhost |
| {$PHP_FPM.STATUS.PAGE} | The path of the PHP-FPM status page. |
status |
| {$PHP_FPM.PING.PAGE} | The path of the PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | The expected reply to the ping. |
pong |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum percent of the PHP-FPM queue usage for a trigger expression. |
80 |
| {$PHP_FPM.PROCESS_NAME} | The process name filter for the PHP-FPM process discovery. May vary depending on your OS distribution. |
php-fpm |
| {$PHP_FPM.PROCESS.NAME.PARAMETER} | The process name of the PHP-FPM used in the item key |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| PHP-FPM: Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$PHP_FPM.PROCESS.NAME.PARAMETER},,,summary] |
| PHP-FPM: php-fpm_ping | Zabbix agent | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"] | |
| PHP-FPM: Get status page | Zabbix agent | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"] Preprocessing
|
|
| PHP-FPM: Ping | Dependent item | php-fpm.ping Preprocessing
|
|
| PHP-FPM: Processes, active | The total number of active processes. |
Dependent item | php-fpm.processes_active Preprocessing
|
| PHP-FPM: Version | The current version of the PHP. You can get it from the HTTP-Header "X-Powered-By"; it may not work if you have changed the default HTTP-headers. |
Dependent item | php-fpm.version Preprocessing
|
| PHP-FPM: Pool name | The name of the current pool. |
Dependent item | php-fpm.name Preprocessing
|
| PHP-FPM: Uptime | It indicates how long has this pool been running. |
Dependent item | php-fpm.uptime Preprocessing
|
| PHP-FPM: Start time | The time when this pool was started. |
Dependent item | php-fpm.start_time Preprocessing
|
| PHP-FPM: Processes, total | The total number of server processes currently running. |
Dependent item | php-fpm.processes_total Preprocessing
|
| PHP-FPM: Processes, idle | The total number of idle processes. |
Dependent item | php-fpm.processes_idle Preprocessing
|
| PHP-FPM: Queue usage | The utilization of the queue. |
Calculated | php-fpm.listen_queue_usage |
| PHP-FPM: Process manager | The method used by the process manager to control the number of child processes for this pool. |
Dependent item | php-fpm.process_manager Preprocessing
|
| PHP-FPM: Processes, max active | The highest value of "active processes" since the PHP-FPM server was started. |
Dependent item | php-fpm.processes_max_active Preprocessing
|
| PHP-FPM: Accepted connections per second | The number of accepted requests per second. |
Dependent item | php-fpm.conn_accepted.rate Preprocessing
|
| PHP-FPM: Slow requests | The number of requests that has exceeded your |
Dependent item | php-fpm.slow_requests Preprocessing
|
| PHP-FPM: Listen queue | The current number of connections that have been initiated but not yet accepted. |
Dependent item | php-fpm.listen_queue Preprocessing
|
| PHP-FPM: Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool was started. |
Dependent item | php-fpm.listen_queue_max Preprocessing
|
| PHP-FPM: Listen queue, len | The size of the socket queue of pending connections. |
Dependent item | php-fpm.listen_queue_len Preprocessing
|
| PHP-FPM: Max children reached | The number of times that |
Dependent item | php-fpm.max_children Preprocessing
|
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Version has changed | The PHP-FPM version has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by Zabbix agent/php-fpm.version,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.version,#2) and length(last(/PHP-FPM by Zabbix agent/php-fpm.version))>0 |
Info | Manual close: Yes |
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by Zabbix agent/php-fpm.uptime)<10m |
Info | Manual close: Yes |
| PHP-FPM: Queue utilization is high | The queue for this pool has reached |
min(/PHP-FPM by Zabbix agent/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
Warning | |
| PHP-FPM: Manager changed | The PHP-FPM manager has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#2) |
Info | Manual close: Yes |
| PHP-FPM: Detected slow requests | The PHP-FPM has detected a slow request. |
min(/PHP-FPM by Zabbix agent/php-fpm.slow_requests,#3)>0 |
Warning |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| PHP-FPM process discovery | The discovery of the PHP-FPM summary processes. |
Dependent item | php-fpm.proc.discovery |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| PHP-FPM: Get process data | The summary metrics aggregated by a process |
Dependent item | php-fpm.proc.get[{#PHP_FPM.NAME}] Preprocessing
|
| PHP-FPM: Memory usage (rss) | The summary of resident set size memory used by a process |
Dependent item | php-fpm.proc.rss[{#PHP_FPM.NAME}] Preprocessing
|
| PHP-FPM: Memory usage (vsize) | The summary of virtual memory used by a process |
Dependent item | php-fpm.proc.vmem[{#PHP_FPM.NAME}] Preprocessing
|
| PHP-FPM: Memory usage, % | The percentage of real memory used by a process |
Dependent item | php-fpm.proc.pmem[{#PHP_FPM.NAME}] Preprocessing
|
| PHP-FPM: Number of running processes | The number of running processes |
Dependent item | php-fpm.proc.num[{#PHP_FPM.NAME}] Preprocessing
|
| PHP-FPM: CPU utilization | The percentage of the CPU utilization by a process |
Zabbix agent | proc.cpu.util[{#PHP_FPM.NAME}] |
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Process is not running | last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])=0 |
High | ||
| PHP-FPM: Failed to fetch info data | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/PHP-FPM by Zabbix agent/php-fpm.uptime,30m)=1 and last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])>0 |
Info | Manual close: Yes |
| PHP-FPM: Service is down | (last(/PHP-FPM by Zabbix agent/php-fpm.ping)=0 or nodata(/PHP-FPM by Zabbix agent/php-fpm.ping,3m)=1) and last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#PHP_FPM.NAME}])>0 |
High | Manual close: Yes |
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_agent?at=release/6.2
For Zabbix version: 6.2 and higher. This template is developed to monitor the FastCGI Process Manager (PHP-FPM) by Zabbix that works without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template PHP-FPM by Zabbix agent - collects metrics by polling the PHP-FPM status-page locally with Zabbix agent.
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get).
It also uses Zabbix agent to collect PHP-FPM Linux process statistics, such as CPU usage, memory usage, and whether the process is running or not.
This template was tested on:
See Zabbix template operation for basic instructions.
Open the php-fpm configuration file and enable the status page as shown.
pm.status_path = /status
ping.path = /ping
Validate the syntax to ensure it is correct, before you reload the service.
$ php-fpm7 -t
Reload the php-fpm service to make the change active.
$ systemctl reload php-fpm
Next, edit the configuration file of your Nginx server block (virtual host) and add the location block below it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
Check the syntax again.
$ nginx -t
$ systemctl reload nginx
curl -L 127.0.0.1/status
If you use another location of the status/ping page, don't forget to change the {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use an atypical location for the PHP-FPM status-page, don't forget to change the macro {$PHP_FPM.PORT}.
No specific Zabbix configuration is required.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.HOST} | The Hostname or an IP address of the PHP-FPM status for a host or container. |
localhost |
| {$PHP_FPM.PING.PAGE} | The path of the PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | The expected reply to the ping. |
pong |
| {$PHP_FPM.PORT} | The port of the PHP-FPM status host or container. |
80 |
| {$PHP_FPM.PROCESS_NAME} | The name of the PHP-FPM process. |
php-fpm |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum percent of the PHP-FPM queue usage for a trigger expression. |
80 |
| {$PHP_FPM.STATUS.PAGE} | The path of the PHP-FPM status page. |
status |
There are no template links in this template.
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| PHP-FPM process discovery | The discovery of the PHP-FPM summary processes. |
DEPENDENT | php-fpm.proc.discovery Filter: AND- {#NAME} MATCHES_REGEX |
| Group | Name | Description | Type | Key and additional info |
|---|---|---|---|---|
| PHP-FPM | PHP-FPM: Get processes summary | The aggregated data of summary metrics for all processes. |
ZABBIX_PASSIVE | proc.get[,,,summary] |
| PHP-FPM | PHP-FPM: Ping | - |
DEPENDENT | php-fpm.ping Preprocessing: - REGEX: `{$PHP_FPM.PING.REPLY}($ |
| PHP-FPM | PHP-FPM: Processes, active | The total number of active processes. |
DEPENDENT | php-fpm.processes_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Version | The current version of the PHP. You can get it from the HTTP-Header "X-Powered-By"; it may not work if you have changed the default HTTP-headers. |
DEPENDENT | php-fpm.version Preprocessing: - REGEX: ⛔️ON_FAIL: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Pool name | The name of the current pool. |
DEPENDENT | php-fpm.name Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Uptime | It indicates how long has this pool been running. |
DEPENDENT | php-fpm.uptime Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Start time | The time when this pool was started. |
DEPENDENT | php-fpm.start_time Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, total | The total number of server processes running currently. |
DEPENDENT | php-fpm.processes_total Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, idle | The total number of idle processes. |
DEPENDENT | php-fpm.processes_idle Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Queue usage | The utilization of the queue. |
CALCULATED | php-fpm.listen_queue_usage Expression: last(//php-fpm.listen_queue)/(last(//php-fpm.listen_queue_len)+(last(//php-fpm.listen_queue_len)=0))*100 |
| PHP-FPM | PHP-FPM: Process manager | The method used by the process manager to control the number of child processes for this pool. |
DEPENDENT | php-fpm.process_manager Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Processes, max active | The highest value of "active processes" since the PHP-FPM server was started. |
DEPENDENT | php-fpm.processes_max_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Accepted connections per second | The number of accepted requests per second. |
DEPENDENT | php-fpm.conn_accepted.rate Preprocessing: - JSONPATH: - CHANGE_PER_SECOND |
| PHP-FPM | PHP-FPM: Slow requests | The number of requests that has exceeded your |
DEPENDENT | php-fpm.slow_requests Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| PHP-FPM | PHP-FPM: Listen queue | The current number of connections that have been initiated but not yet accepted. |
DEPENDENT | php-fpm.listen_queue Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool was started. |
DEPENDENT | php-fpm.listen_queue_max Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, len | The size of the socket queue of pending connections. |
DEPENDENT | php-fpm.listen_queue_len Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Max children reached | The number of times that |
DEPENDENT | php-fpm.max_children Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| PHP-FPM | PHP-FPM: Get process data | The summary metrics aggregated by a process |
DEPENDENT | php-fpm.proc.get[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
| PHP-FPM | PHP-FPM: Memory usage (rss) | The summary of resident set size memory used by a process |
DEPENDENT | php-fpm.proc.rss[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
| PHP-FPM | PHP-FPM: Memory usage (vsize) | The summary of virtual memory used by a process |
DEPENDENT | php-fpm.proc.vmem[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
| PHP-FPM | PHP-FPM: Memory usage, % | The percentage of real memory used by a process |
DEPENDENT | php-fpm.proc.pmem[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
| PHP-FPM | PHP-FPM: Number of running processes | The number of running processes |
DEPENDENT | php-fpm.proc.num[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: CPU utilization | The percentage of the CPU utilization by a process |
ZABBIX_PASSIVE | proc.cpu.util[{#NAME}] |
| Zabbix raw items | PHP-FPM: php-fpm_ping | - |
ZABBIX_PASSIVE | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"] |
| Zabbix raw items | PHP-FPM: Get status page | - |
ZABBIX_PASSIVE | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"] Preprocessing: - REGEX: |
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Version has changed | The PHP-FPM version has changed. Acknowledge (Ack) to close manually. |
last(/PHP-FPM by Zabbix agent/php-fpm.version,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.version,#2) and length(last(/PHP-FPM by Zabbix agent/php-fpm.version))>0 |
INFO | Manual close: YES |
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by Zabbix agent/php-fpm.uptime)<10m |
INFO | Manual close: YES |
| PHP-FPM: Queue utilization is high | The queue for this pool has reached |
min(/PHP-FPM by Zabbix agent/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
WARNING | |
| PHP-FPM: Manager changed | The PHP-FPM manager has changed. |
last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#2) |
INFO | Manual close: YES |
| PHP-FPM: Detected slow requests | The PHP-FPM has detected a slow request. The slow request means that it took more time to execute than expected (defined in the configuration of your pool). |
min(/PHP-FPM by Zabbix agent/php-fpm.slow_requests,#3)>0 |
WARNING | |
| PHP-FPM: Process is not running | - |
last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#NAME}])=0 |
HIGH | |
| PHP-FPM: Failed to fetch info data | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/PHP-FPM by Zabbix agent/php-fpm.uptime,30m)=1 and last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#NAME}])>0 |
INFO | Manual close: YES |
| PHP-FPM: Service is down | - |
(last(/PHP-FPM by Zabbix agent/php-fpm.ping)=0 or nodata(/PHP-FPM by Zabbix agent/php-fpm.ping,3m)=1) and last(/PHP-FPM by Zabbix agent/php-fpm.proc.num[{#NAME}])>0 |
HIGH | Manual close: YES |
Please report any issues with the template at https://support.zabbix.com.
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_agent?at=release/6.0
This template is developed to monitor the FastCGI Process Manager (PHP-FPM) by Zabbix agent that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template PHP-FPM by Zabbix agent - collects metrics by polling the PHP-FPM status-page locally with Zabbix agent.
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get).
It also uses Zabbix agent to collect php-fpm Linux process statistics, such as CPU usage, memory usage, and whether the process is running or not.
Zabbix version: 6.0 and higher.
This template has been tested on:
Zabbix should be configured according to the instructions in the Templates out of the box section.
Note that depending on your OS distribution, the PHP-FPM executable/service name can vary. RHEL-like distributions usually name both process and service as php-fpm, while for Debian/Ubuntu based distributions it may include the version, for example: executable name - php-fpm8.2, systemd service name - php8.2-fpm. Adjust the following instructions accordingly if needed.
pm.status_path = /status
ping.path = /ping
<version> in the command if needed.$ php-fpm -t
or
$ php-fpm<version> -t
php-fpm service to make the change active. Replace the <version> in the command if needed.$ systemctl reload php-fpm
or
$ systemctl reload php<version>-fpm
If you use Nginx, edit the configuration file of your Nginx server block (virtual host) and add the location block below it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
If you use Apache, edit the configuration file of the virtual host and add the following location blocks.
<LocationMatch "/status">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/status"
</LocationMatch>
<LocationMatch "/ping">
Require ip 127.0.0.1
# Require ip 1.2.3.4 # Your IP here
# Adjust the path to the socket if needed
ProxyPass "unix:/run/php-fpm/www.sock|fcgi://localhost/ping"
</LocationMatch>
$ nginx -t
or
$ httpd -t
or
$ apachectl configtest
$ systemctl reload nginx
or
$ systemctl reload httpd
or
$ systemctl reload apache2
curl -L 127.0.0.1/status
curl -L 127.0.0.1/ping
Depending on your OS distribution, the PHP-FPM process name may vary as well. Please check the actual name in the line "Name" from /proc/<pid>/status file (https://www.zabbix.com/documentation/6.0/manual/appendix/items/proc_mem_num_notes) and change the {$PHP_FPM.PROCESS.NAME.PARAMETER} macro if needed.
If you use another location of the status/ping pages, don't forget to change the {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use another web server port for the location of the PHP-FPM status/ping pages, don't forget to change the macro {$PHP_FPM.PORT}.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.PORT} | The port of the PHP-FPM status host or container. |
80 |
| {$PHP_FPM.HOST} | The hostname or IP address of the PHP-FPM status for a host or container. |
localhost |
| {$PHP_FPM.STATUS.PAGE} | The path of the PHP-FPM status page. |
status |
| {$PHP_FPM.PING.PAGE} | The path of the PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | The expected reply to the ping. |
pong |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum percent of the PHP-FPM queue usage for a trigger expression. |
80 |
| {$PHP_FPM.PROCESS_NAME} | The name of the PHP-FPM process. May vary depending on your OS distribution. |
php-fpm |
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| PHP-FPM: php-fpm_ping | Zabbix agent | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"] | |
| PHP-FPM: Get status page | Zabbix agent | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"] Preprocessing
|
|
| PHP-FPM: Memory usage (rss) | Resident set size memory used by process in bytes. |
Zabbix agent | proc.mem["{$PHP_FPM.PROCESS_NAME}",,,,rss] |
| PHP-FPM: Memory usage, % | Memory used percentage relative to total memory available. |
Zabbix agent | proc.mem["{$PHP_FPM.PROCESS_NAME}",,,,pmem] |
| PHP-FPM: CPU utilization | Process CPU utilization percentage. |
Zabbix agent | proc.cpu.util["{$PHP_FPM.PROCESS_NAME}"] |
| PHP-FPM: Number of running processes | Zabbix agent | proc.num["{$PHP_FPM.PROCESS_NAME}"] | |
| PHP-FPM: Ping | Dependent item | php-fpm.ping Preprocessing
|
|
| PHP-FPM: Processes, active | The total number of active processes. |
Dependent item | php-fpm.processes_active Preprocessing
|
| PHP-FPM: Version | The current version of the PHP. You can get it from the HTTP-Header "X-Powered-By"; it may not work if you have changed the default HTTP-headers. |
Dependent item | php-fpm.version Preprocessing
|
| PHP-FPM: Pool name | The name of the current pool. |
Dependent item | php-fpm.name Preprocessing
|
| PHP-FPM: Uptime | It indicates how long has this pool been running. |
Dependent item | php-fpm.uptime Preprocessing
|
| PHP-FPM: Start time | The time when this pool was started. |
Dependent item | php-fpm.start_time Preprocessing
|
| PHP-FPM: Processes, total | The total number of server processes currently running. |
Dependent item | php-fpm.processes_total Preprocessing
|
| PHP-FPM: Processes, idle | The total number of idle processes. |
Dependent item | php-fpm.processes_idle Preprocessing
|
| PHP-FPM: Queue usage | The utilization of the queue. |
Calculated | php-fpm.listen_queue_usage |
| PHP-FPM: Process manager | The method used by the process manager to control the number of child processes for this pool. |
Dependent item | php-fpm.process_manager Preprocessing
|
| PHP-FPM: Processes, max active | The highest value of "active processes" since the PHP-FPM server was started. |
Dependent item | php-fpm.processes_max_active Preprocessing
|
| PHP-FPM: Accepted connections per second | The number of accepted requests per second. |
Dependent item | php-fpm.conn_accepted.rate Preprocessing
|
| PHP-FPM: Slow requests | The number of requests that has exceeded your |
Dependent item | php-fpm.slow_requests Preprocessing
|
| PHP-FPM: Listen queue | The current number of connections that have been initiated but not yet accepted. |
Dependent item | php-fpm.listen_queue Preprocessing
|
| PHP-FPM: Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool was started. |
Dependent item | php-fpm.listen_queue_max Preprocessing
|
| PHP-FPM: Listen queue, len | The size of the socket queue of pending connections. |
Dependent item | php-fpm.listen_queue_len Preprocessing
|
| PHP-FPM: Max children reached | The number of times that |
Dependent item | php-fpm.max_children Preprocessing
|
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Process is not running | last(/PHP-FPM by Zabbix agent/proc.num["{$PHP_FPM.PROCESS_NAME}"])=0 |
High | ||
| PHP-FPM: Service is down | last(/PHP-FPM by Zabbix agent/php-fpm.ping)=0 or nodata(/PHP-FPM by Zabbix agent/php-fpm.ping,3m)=1 |
High | Manual close: Yes Depends on:
|
|
| PHP-FPM: Version has changed | The PHP-FPM version has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by Zabbix agent/php-fpm.version,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.version,#2) and length(last(/PHP-FPM by Zabbix agent/php-fpm.version))>0 |
Info | Manual close: Yes |
| PHP-FPM: Failed to fetch info data | Zabbix has not received any data for items for the last 30 minutes |
nodata(/PHP-FPM by Zabbix agent/php-fpm.uptime,30m)=1 |
Info | Manual close: Yes Depends on:
|
| PHP-FPM: Pool has been restarted | Uptime is less than 10 minutes. |
last(/PHP-FPM by Zabbix agent/php-fpm.uptime)<10m |
Info | Manual close: Yes |
| PHP-FPM: Queue utilization is high | The queue for this pool has reached |
min(/PHP-FPM by Zabbix agent/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
Warning | |
| PHP-FPM: Manager changed | The PHP-FPM manager has changed. Acknowledge to close the problem manually. |
last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#2) |
Info | Manual close: Yes |
| PHP-FPM: Detected slow requests | The PHP-FPM has detected a slow request. |
min(/PHP-FPM by Zabbix agent/php-fpm.slow_requests,#3)>0 |
Warning |
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_agent?at=release/5.4
For Zabbix version: 5.4 and higher
The template to monitor PHP-FPM by Zabbix that work without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
Template PHP-FPM by Zabbix agent collects metrics by polling PHP-FPM status-page locally with Zabbix agent:
Note that this template doesn't support https and redirects (limitations of web.page.get).
It also uses Zabbix agent to collect php-fpm Linux process stats like CPU usage, memory usage and whether process is running or not.
This template was tested on:
See Zabbix template operation for basic instructions.
Open the php-fpm configuration file and enable the status page as shown.
pm.status_path = /status
ping.path = /ping
Validate the syntax is fine before we reload the service
$ php-fpm7 -t
Reload the php-fpm service to make the change active
$ systemctl reload php-fpm
Next, edit your Nginx server block (virtual host) configuration file and add the location block below in it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
Check the syntax
$ nginx -t
Reload Nginx
$ systemctl reload nginx
Verify
curl -L 127.0.0.1/status
If you use another location of status/ping page, don't forget to change {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use an atypical location for PHP-FPM status-page don't forget to change the macros {$PHP_FPM.PORT}.
No specific Zabbix configuration is required.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.HOST} | Hostname or IP of PHP-FPM status host or container. |
localhost |
| {$PHP_FPM.PING.PAGE} | The path of PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | Expected reply to the ping. |
pong |
| {$PHP_FPM.PORT} | The port of PHP-FPM status host or container. |
80 |
| {$PHP_FPM.PROCESS_NAME} | PHP-FPM process name |
php-fpm |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum PHP-FPM queue usage percent for trigger expression. |
80 |
| {$PHP_FPM.STATUS.PAGE} | The path of PHP-FPM status page. |
status |
There are no template links in this template.
| Group | Name | Description | Type | Key and additional info |
|---|---|---|---|---|
| PHP-FPM | PHP-FPM: Memory usage (rss) | Resident set size memory used by process in bytes. |
ZABBIX_PASSIVE | proc.mem["{$PHP_FPM.PROCESS_NAME}",,,,rss] |
| PHP-FPM | PHP-FPM: Memory usage, % | Memory used percentage relative to total memory available. |
ZABBIX_PASSIVE | proc.mem["{$PHP_FPM.PROCESS_NAME}",,,,pmem] |
| PHP-FPM | PHP-FPM: CPU utilization | Process CPU utilization percentage. |
ZABBIX_PASSIVE | proc.cpu.util["{$PHP_FPM.PROCESS_NAME}"] |
| PHP-FPM | PHP-FPM: Number of processes running | - |
ZABBIX_PASSIVE | proc.num["{$PHP_FPM.PROCESS_NAME}"] |
| PHP-FPM | PHP-FPM: Ping | - |
DEPENDENT | php-fpm.ping Preprocessing: - REGEX: `{$PHP_FPM.PING.REPLY}($ |
| PHP-FPM | PHP-FPM: Processes, active | The total number of active processes. |
DEPENDENT | php-fpm.processes_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Version | Current version PHP. Get from HTTP-Header "X-Powered-By" and may not work if you change default HTTP-headers. |
DEPENDENT | php-fpm.version Preprocessing: - REGEX: ⛔️ON_FAIL: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Pool name | The name of current pool. |
DEPENDENT | php-fpm.name Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Uptime | How long has this pool been running. |
DEPENDENT | php-fpm.uptime Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Start time | The time when this pool was started. |
DEPENDENT | php-fpm.start_time Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, total | The total number of server processes currently running. |
DEPENDENT | php-fpm.processes_total Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, idle | The total number of idle processes. |
DEPENDENT | php-fpm.processes_idle Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Queue usage | Queue utilization |
CALCULATED | php-fpm.listen_queue_usage Expression: last(//php-fpm.listen_queue)/(last(//php-fpm.listen_queue_len)+(last(//php-fpm.listen_queue_len)=0))*100 |
| PHP-FPM | PHP-FPM: Process manager | The method used by the process manager to control the number of child processes for this pool. |
DEPENDENT | php-fpm.process_manager Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Processes, max active | The highest value that 'active processes' has reached since the php-fpm server started. |
DEPENDENT | php-fpm.processes_max_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Accepted connections per second | The number of accepted requests per second. |
DEPENDENT | php-fpm.conn_accepted.rate Preprocessing: - JSONPATH: - CHANGE_PER_SECOND |
| PHP-FPM | PHP-FPM: Slow requests | The number of requests that exceeded your request_slowlog_timeout value. |
DEPENDENT | php-fpm.slow_requests Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| PHP-FPM | PHP-FPM: Listen queue | The current number of connections that have been initiated, but not yet accepted. |
DEPENDENT | php-fpm.listen_queue Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool has started. |
DEPENDENT | php-fpm.listen_queue_max Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, len | Size of the socket queue of pending connections. |
DEPENDENT | php-fpm.listen_queue_len Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Max children reached | The number of times that pm.max_children has been reached since the php-fpm pool started |
DEPENDENT | php-fpm.max_children Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| Zabbix_raw_items | PHP-FPM: php-fpm_ping | - |
ZABBIX_PASSIVE | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"] |
| Zabbix_raw_items | PHP-FPM: Get status page | - |
ZABBIX_PASSIVE | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"] Preprocessing: - REGEX: |
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Process is not running | - |
last(/PHP-FPM by Zabbix agent/proc.num["{$PHP_FPM.PROCESS_NAME}"])=0 |
HIGH | |
| PHP-FPM: Service is down | - |
last(/PHP-FPM by Zabbix agent/php-fpm.ping)=0 or nodata(/PHP-FPM by Zabbix agent/php-fpm.ping,3m)=1 |
HIGH | Manual close: YES Depends on: - PHP-FPM: Process is not running |
| PHP-FPM: Version has changed (new version: {ITEM.VALUE}) | PHP-FPM version has changed. Ack to close. |
last(/PHP-FPM by Zabbix agent/php-fpm.version,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.version,#2) and length(last(/PHP-FPM by Zabbix agent/php-fpm.version))>0 |
INFO | Manual close: YES |
| PHP-FPM: Failed to fetch info data (or no data for 30m) | Zabbix has not received data for items for the last 30 minutes |
nodata(/PHP-FPM by Zabbix agent/php-fpm.uptime,30m)=1 |
INFO | Manual close: YES Depends on: - PHP-FPM: Process is not running |
| PHP-FPM: has been restarted (uptime < 10m) | Uptime is less than 10 minutes |
last(/PHP-FPM by Zabbix agent/php-fpm.uptime)<10m |
INFO | Manual close: YES |
| PHP-FPM: Queue utilization is high (over {$PHP_FPM.QUEUE.WARN.MAX}% for 15m) | The queue for this pool reached {$PHP_FPM.QUEUE.WARN.MAX}% of its maximum capacity. Items in queue represent the current number of connections that have been initiated on this pool, but not yet accepted. |
min(/PHP-FPM by Zabbix agent/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX} |
WARNING | |
| PHP-FPM: Manager changed (new value received: {ITEM.VALUE}) | PHP-FPM manager changed. Ack to close. |
last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#1)<>last(/PHP-FPM by Zabbix agent/php-fpm.process_manager,#2) |
INFO | Manual close: YES |
| PHP-FPM: Detected slow requests | PHP-FPM detected slow request. A slow request means that it took more time to execute than expected (defined in the configuration of your pool). |
min(/PHP-FPM by Zabbix agent/php-fpm.slow_requests,#3)>0 |
WARNING |
Please report any issues with the template at https://support.zabbix.com
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_agent?at=release/5.0
For Zabbix version: 5.0 and higher
This template to monitor PHP-FPM by Zabbix agent works without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
Template PHP-FPM by Zabbix agent collects metrics by polling the PHP-FPM status-page locally using Zabbix agent.
Note that this template doesn't support redirects (limitation of web.page.get).
It also uses Zabbix agent to collect php-fpm Linux process stats, for example, CPU usage, memory usage, and also to find out whether the process is running or not.
This template was tested on:
See Zabbix template operation for basic instructions.
Open the PHP-FPM configuration file and enable the status page as shown.
pm.status_path = /status
ping.path = /ping
Validate the syntax is fine before we reload the service.
$ php-fpm7 -t
Reload the php-fpm service to make the change active.
$ systemctl reload php-fpm
Next, edit your Nginx server block (virtual host) configuration file and add the location block below in it.
# Enable php-fpm status page
location ~ ^/(status|ping)$ {
## disable access logging for request if you prefer
access_log off;
## Only allow trusted IPs for security, deny everyone else
# allow 127.0.0.1;
# allow 1.2.3.4; # your IP here
# deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
## Now the port or socket of the php-fpm pool we want the status of
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/run/php-fpm/your_socket.sock;
}
Check the syntax
$ nginx -t
Reload Nginx
$ systemctl reload nginx
Verify
curl -L 127.0.0.1/status
Note that depending on your OS distribution, the PHP-FPM process name may vary. Please, check the actual name in the line "Name" from /proc/<pid>/status file (https://www.zabbix.com/documentation/5.0/manual/appendix/items/proc_mem_num_notes) and change {$PHP_FPM.PROCESS_NAME} macro if needed.
If you use another location of the status/ping page, don't forget to change {$PHP_FPM.STATUS.PAGE}/{$PHP_FPM.PING.PAGE} macro.
If you use an atypical location for the PHP-FPM status-page, don't forget to change the macros {$PHP_FPM.PORT}.
No specific Zabbix configuration is required.
| Name | Description | Default |
|---|---|---|
| {$PHP_FPM.HOST} | Hostname or IP of PHP-FPM status host or container. |
localhost |
| {$PHP_FPM.PING.PAGE} | The path of PHP-FPM ping page. |
ping |
| {$PHP_FPM.PING.REPLY} | Expected reply to the ping. |
pong |
| {$PHP_FPM.PORT} | The port of PHP-FPM status host or container. |
80 |
| {$PHP_FPM.PROCESS_NAME} | PHP-FPM process name. May vary depending on your OS distribution. |
php-fpm |
| {$PHP_FPM.QUEUE.WARN.MAX} | The maximum PHP-FPM queue usage percent for trigger expression. |
80 |
| {$PHP_FPM.STATUS.PAGE} | The path of PHP-FPM status page. |
status |
There are no template links in this template.
| Group | Name | Description | Type | Key and additional info |
|---|---|---|---|---|
| PHP-FPM | PHP-FPM: Memory usage (rss) | Resident set size memory used by process in bytes. |
ZABBIX_PASSIVE | proc.mem["{$PHP_FPM.PROCESS_NAME}",,,,rss] |
| PHP-FPM | PHP-FPM: Memory usage, % | Memory used percentage relative to total memory available. |
ZABBIX_PASSIVE | proc.mem["{$PHP_FPM.PROCESS_NAME}",,,,pmem] |
| PHP-FPM | PHP-FPM: CPU utilization | Process CPU utilization percentage. |
ZABBIX_PASSIVE | proc.cpu.util["{$PHP_FPM.PROCESS_NAME}"] |
| PHP-FPM | PHP-FPM: Number of processes running | - |
ZABBIX_PASSIVE | proc.num["{$PHP_FPM.PROCESS_NAME}"] |
| PHP-FPM | PHP-FPM: Ping | - |
DEPENDENT | php-fpm.ping Preprocessing: - REGEX: `{$PHP_FPM.PING.REPLY}($ |
| PHP-FPM | PHP-FPM: Processes, active | The total number of active processes. |
DEPENDENT | php-fpm.processes_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Version | Current version PHP. Get from HTTP-Header "X-Powered-By" and may not work if you change default HTTP-headers. |
DEPENDENT | php-fpm.version Preprocessing: - REGEX: ⛔️ON_FAIL: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Pool name | The name of current pool. |
DEPENDENT | php-fpm.name Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Uptime | How long has this pool been running. |
DEPENDENT | php-fpm.uptime Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Start time | The time when this pool was started. |
DEPENDENT | php-fpm.start_time Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, total | The total number of server processes currently running. |
DEPENDENT | php-fpm.processes_total Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Processes, idle | The total number of idle processes. |
DEPENDENT | php-fpm.processes_idle Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Queue usage | Queue utilization |
CALCULATED | php-fpm.listen_queue_usage Expression: last(php-fpm.listen_queue)/(last(php-fpm.listen_queue_len)+(last(php-fpm.listen_queue_len)=0))*100 |
| PHP-FPM | PHP-FPM: Process manager | The method used by the process manager to control the number of child processes for this pool. |
DEPENDENT | php-fpm.process_manager Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
| PHP-FPM | PHP-FPM: Processes, max active | The highest value that 'active processes' has reached since the php-fpm server started. |
DEPENDENT | php-fpm.processes_max_active Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Accepted connections per second | The number of accepted requests per second. |
DEPENDENT | php-fpm.conn_accepted.rate Preprocessing: - JSONPATH: - CHANGE_PER_SECOND |
| PHP-FPM | PHP-FPM: Slow requests | The number of requests that exceeded your request_slowlog_timeout value. |
DEPENDENT | php-fpm.slow_requests Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| PHP-FPM | PHP-FPM: Listen queue | The current number of connections that have been initiated, but not yet accepted. |
DEPENDENT | php-fpm.listen_queue Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, max | The maximum number of requests in the queue of pending connections since this FPM pool has started. |
DEPENDENT | php-fpm.listen_queue_max Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Listen queue, len | Size of the socket queue of pending connections. |
DEPENDENT | php-fpm.listen_queue_len Preprocessing: - JSONPATH: |
| PHP-FPM | PHP-FPM: Max children reached | The number of times that pm.max_children has been reached since the php-fpm pool started |
DEPENDENT | php-fpm.max_children Preprocessing: - JSONPATH: - SIMPLE_CHANGE |
| Zabbix_raw_items | PHP-FPM: php-fpm_ping | - |
ZABBIX_PASSIVE | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"] |
| Zabbix_raw_items | PHP-FPM: Get status page | - |
ZABBIX_PASSIVE | web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"] Preprocessing: - REGEX: |
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| PHP-FPM: Process is not running | - |
{TEMPLATE_NAME:proc.num["{$PHP_FPM.PROCESS_NAME}"].last()}=0 |
HIGH | |
| PHP-FPM: Service is down | - |
{TEMPLATE_NAME:php-fpm.ping.last()}=0 or {TEMPLATE_NAME:php-fpm.ping.nodata(3m)}=1 |
HIGH | Manual close: YES Depends on: - PHP-FPM: Process is not running |
| PHP-FPM: Version has changed (new version: {ITEM.VALUE}) | PHP-FPM version has changed. Ack to close. |
{TEMPLATE_NAME:php-fpm.version.diff()}=1 and {TEMPLATE_NAME:php-fpm.version.strlen()}>0 |
INFO | Manual close: YES |
| PHP-FPM: Failed to fetch info data (or no data for 30m) | Zabbix has not received data for items for the last 30 minutes |
{TEMPLATE_NAME:php-fpm.uptime.nodata(30m)}=1 |
INFO | Manual close: YES Depends on: - PHP-FPM: Process is not running |
| PHP-FPM: Pool has been restarted (uptime < 10m) | Uptime is less than 10 minutes. |
{TEMPLATE_NAME:php-fpm.uptime.last()}<10m |
INFO | Manual close: YES |
| PHP-FPM: Queue utilization is high (over {$PHP_FPM.QUEUE.WARN.MAX}% for 15m) | The queue for this pool reached {$PHP_FPM.QUEUE.WARN.MAX}% of its maximum capacity. Items in queue represent the current number of connections that have been initiated on this pool, but not yet accepted. |
{TEMPLATE_NAME:php-fpm.listen_queue_usage.min(15m)} > {$PHP_FPM.QUEUE.WARN.MAX} |
WARNING | |
| PHP-FPM: Manager changed (new value received: {ITEM.VALUE}) | PHP-FPM manager changed. Ack to close. |
{TEMPLATE_NAME:php-fpm.process_manager.diff()}=1 |
INFO | Manual close: YES |
| PHP-FPM: Detected slow requests | PHP-FPM detected slow request. A slow request means that it took more time to execute than expected (defined in the configuration of your pool). |
{TEMPLATE_NAME:php-fpm.slow_requests.min(#3)}>0 |
WARNING |
Please report any issues with the template at https://support.zabbix.com
| Link | Source | Compatibility | Type, Technology | Created Updated | Rating |
|---|---|---|---|---|---|
| App PHP-FPM (Check the latest version and updates to this doc at the repo: https://github.com/vigrai/zabbix-template-php-fpm )Zabbix 4.0 Template for PHP-FPM PoolsThis is a template for monitoring php-fpm and it´s pools with Zabbix.What´s special about this template, is that it automatically detects (using LLD) ... template_zabbix_4.0_php-fpm_pools_(lld_+_http_agent) |
GitHub Community Templates |
5.0+ |
| ||
| App PHP-FPM English description - https://github.com/tonymadbrain/fcgi_stat_getter/blob/master/README.mdСкрипт для получения статистики из PHP-FPM, который можно использовать в Zabbix. Реализация на Go вот этого скрипта - http://doam.ru/fcgi_monitoring_with_zabbix/.go version go1.7.4 darwin/amd64 template_fcgi_stat_getter._monitor_php-fpm_without_nginx_proxy |
GitHub Community Templates |
5.0+ |
| ||
| PHP-FPM Zabbix Template with Auto Discovery and Multiple Pools Supports auto discovery of PHP-FPM pools (LLD) and automatic detection of sockets used by pools. Supports multiple PHP-FPM pools. Supports multiple PHP versions, i.e. you can use PHP 7.2 and PHP 7.3 on the same server and we will detect them all. Easy configuration. Supports ISPConfig. Script is in pure ... github.com/rvalitov/zabbix-php-fpm |
GitHub |
Template Shell |
2019-08-12 2 y |
Popular
|
|
| Monitoring phpfpm status with zabbix agent. github.com/luohu1/zabbix-template-phpfpm |
GitHub |
Shell |
2018-07-12 4 y |
||
| Zabbix templates and scripts github.com/alfa-safety/zabbix-phpfpm |
GitHub |
Template Python |
2016-09-01 7 y |