diff --git a/README.md b/README.md
index 90b89c3..a00a8ca 100644
--- a/README.md
+++ b/README.md
@@ -406,6 +406,7 @@ In Zabbix frontend go to `"Configuration"->"Templates"->"Import"`:
![Zabbix template import interface](https://github.com/rvalitov/zabbix-php-fpm/raw/master/media/zabbix-import.jpg)
Upload a template file from the [archive](https://github.com/rvalitov/zabbix-php-fpm/archive/master.zip) that corresponds to your version of Zabbix server. For example, use file `/zabbix/zabbix_php_fpm_template_4.0.xml` for Zabbix server 4.0. If there's no version of the template that matches your version of Zabbix server, then try to use the nearest version of the template that is not higher than your version of Zabbix server.
+For example, template version 4.0 also works for higher versions of Zabbix server, such as 4.2 and 4.4. But template version 4.0 will not work for Zabbix 3.x.
#### 2.2. Add the template to your hosts
Add template "Template App PHP-FPM" to the desired hosts.
diff --git a/zabbix/zabbix_php_fpm_template_4.0.xml b/zabbix/zabbix_php_fpm_template_4.0.xml
index 50463a5..012fa93 100644
--- a/zabbix/zabbix_php_fpm_template_4.0.xml
+++ b/zabbix/zabbix_php_fpm_template_4.0.xml
@@ -1411,7 +1411,7 @@
- {Template App PHP-FPM:php-fpm.listen_queue[{#POOLSOCKET}].diff()}=1
+ {Template App PHP-FPM:php-fpm.listen_queue[{#POOLSOCKET}].last(#3)}>0
0
PHP-FPM uses queue on {HOST.NAME} pool {#POOLNAME}
diff --git a/zabbix/zabbix_php_fpm_template_4.2.xml b/zabbix/zabbix_php_fpm_template_4.2.xml
deleted file mode 100644
index 12616bd..0000000
--- a/zabbix/zabbix_php_fpm_template_4.2.xml
+++ /dev/null
@@ -1,1882 +0,0 @@
-
-
- 4.2
- 2019-12-21T12:24:20Z
-
-
- Templates/Applications
-
-
-
-
- Template App PHP-FPM
- Template App PHP-FPM
- PHP-FPM Zabbix Template with Auto Discovery and Multiple Pools
-
-
- Templates/Applications
-
-
-
-
- PHP-FPM
-
-
-
- -
- Number of CPUs
- 0
-
-
- system.cpu.num["online"]
- 1m
- 1h
- 365d
- 0
- 3
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- Number of active CPUs
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
-
-
-
- PHP-FPM Pools Discovery
- 0
-
-
- php-fpm.discover
- 2m
- 0
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
-
- 0
-
-
-
- 30d
-
-
-
- Pool {#POOLNAME}: connections per sec
- 18
-
-
- php-fpm.accepted_conn[{#POOLSOCKET}]
- 0
- 1d
- 365d
- 0
- 0
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- The number of incoming requests per second that the pool has accepted; when a connection is accepted it is removed from the listen queue (displayed in real time).
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['accepted conn']
- 0
-
-
-
- 10
-
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME}: active processes
- 18
-
-
- php-fpm.active_processes[{#POOLSOCKET}]
- 0
- 1d
- 365d
- 0
- 3
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- The number of servers current processing a page - the minimum is 1 (so even on a fully idle server, the result will be not read 0).
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['active processes']
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME}: CPU avg utilization
- 15
-
-
- php-fpm.cpu[{#POOLNAME}]
- 1m
- 1h
- 365d
- 0
- 0
-
- %
-
-
- 0
- 0
-
- 0
-
- last(proc.cpu.util["php-fpm: pool {#POOLNAME}"])/last(system.cpu.num["online"])
-
- 0
-
-
-
-
-
- CPU utilization used by the pool normalized by the number of cores.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
-
-
- Pool {#POOLNAME}: idle processes
- 18
-
-
- php-fpm.idle_processes[{#POOLSOCKET}]
- 0
- 1d
- 365d
- 0
- 3
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- The total number of idle processes.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['idle processes']
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME}: listen queue
- 18
-
-
- php-fpm.listen_queue[{#POOLSOCKET}]
- 0
- 1d
- 365d
- 0
- 3
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- The current number of connections that have been initiated, but not yet accepted. If this value is non-zero it typically means that all the available server processes are currently busy, and there are no processes available to serve the next request. Raising pm.max_children (provided the server can handle it) should help keep this number low. This property follows from the fact that PHP-FPM listens via a socket (TCP or file based), and thus inherits some of the characteristics of sockets.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['listen queue']
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME}: listen queue length
- 18
-
-
- php-fpm.listen_queue_len[{#POOLSOCKET}]
- 0
- 1d
- 365d
- 0
- 3
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- The upper limit on the number of connections that will be queued. Once this limit is reached, subsequent connections will either be refused, or ignored. This value is set by the php-fpm per pool configuration option 'listen.backlog', which defaults to -1 (unlimited). However, this value is also limited by the system (sysctl) value 'net.core.somaxconn', which defaults to 128 on many Linux systems.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['listen queue len']
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME}: max active processes
- 18
-
-
- php-fpm.max_active_processes[{#POOLSOCKET}]
- 0
- 1d
- 365d
- 0
- 3
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- The highest value that 'active processes' has reached since the php-fpm server started. This value should not exceed pm.max_children.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['max active processes']
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME}: max children reached
- 18
-
-
- php-fpm.max_children_reached[{#POOLSOCKET}]
- 0
- 1d
- 365d
- 0
- 3
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- The number of times that pm.max_children has been reached since the php-fpm pool started (only applicable if the process manager is ondemand or dynamic).
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['max children reached']
- 0
-
-
-
- 9
-
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME}: max listen queue
- 18
-
-
- php-fpm.max_listen_queue[{#POOLSOCKET}]
- 0
- 1d
- 365d
- 0
- 3
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- The maximum number of requests in the queue of pending connections since this FPM pool has started.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['max listen queue']
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME}: process manager
- 18
-
-
- php-fpm.process_manager[{#POOLSOCKET}]
- 0
- 1d
- 0
- 0
- 4
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- The method used by the process manager to control the number of child processes (possible values: ondemand, dynamic or static) for this pool.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['process manager']
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME}: queue utilization
- 15
-
-
- php-fpm.queue[{#POOLSOCKET}]
- 1m
- 1h
- 365d
- 0
- 0
-
- %
-
-
- 0
- 0
-
- 0
-
- last(php-fpm.listen_queue[{#POOLSOCKET}])/(last(php-fpm.listen_queue_len[{#POOLSOCKET}])+0.0001)
-
- 0
-
-
-
-
-
- Queue utilization.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
-
-
- Pool {#POOLNAME}: slow requests
- 18
-
-
- php-fpm.slow_requests[{#POOLSOCKET}]
- 0
- 1d
- 365d
- 0
- 3
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- The number of requests that exceeded your request_slowlog_timeout value.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['slow requests']
- 0
-
-
-
- 9
-
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME}: start since
- 18
-
-
- php-fpm.start_since[{#POOLSOCKET}]
- 0
- 1d
- 365d
- 0
- 3
-
- s
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- How long has this pool been running.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['start since']
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME}: start time
- 18
-
-
- php-fpm.start_time[{#POOLSOCKET}]
- 0
- 1d
- 365d
- 0
- 3
-
- unixtime
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- The time when this pool was started.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 12
- $['start time']
- 0
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
-
-
-
- Pool {#POOLNAME} status
- 0
-
-
- php-fpm.status[{#POOLSOCKET},{$PHP_FPM_STATUS_URL}]
- 1m
- 1h
- 0
- 0
- 4
-
-
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
-
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 3s
-
-
-
-
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
-
-
- Pool {#POOLNAME}: CPU utilization
- 0
-
-
- proc.cpu.util["php-fpm: pool {#POOLNAME}"]
- 1m
- 1d
- 365d
- 0
- 0
-
- %
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
- CPU utilization used by the pool. The return value is based on the use of a single CPU core, in percent. For example, CPU utilization of the full use of two cores is 200%.
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
-
-
- Pool {#POOLNAME}: memory utilization
- 0
-
-
- proc.mem["php-fpm: pool {#POOLNAME}",,,,pmem]
- 1m
- 1d
- 365d
- 0
- 0
-
- %
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
-
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
-
-
- Pool {#POOLNAME}: memory used
- 0
-
-
- proc.mem["php-fpm: pool {#POOLNAME}",,,,rss]
- 1m
- 1d
- 365d
- 0
- 0
-
- B
-
-
- 0
- 0
-
- 0
-
-
-
- 0
-
-
-
-
-
-
- 0
-
-
- PHP-FPM
-
-
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
- Pool {#POOLNAME}
-
-
-
-
-
-
-
- {Template App PHP-FPM:php-fpm.accepted_conn[{#POOLSOCKET}].last(0)}>=500
- 0
-
- PHP-FPM: too many connections on {HOST.NAME} pool {#POOLNAME}
- 0
-
-
- 0
- 4
- Too many active connections on pool {#POOLNAME}
- 0
- 0
-
-
-
-
- {Template App PHP-FPM:php-fpm.slow_requests[{#POOLSOCKET}].change()}>0
- 0
-
- PHP-FPM detected slow request on {HOST.NAME} pool {#POOLNAME}
- 0
-
-
- 0
- 2
-
- 0
- 0
-
-
-
-
- {Template App PHP-FPM:php-fpm.process_manager[{#POOLSOCKET}].diff()}=1
- 0
-
- PHP-FPM manager changed on {HOST.NAME} pool {#POOLNAME}
- 0
-
-
- 0
- 1
-
- 0
- 0
-
-
-
-
- {Template App PHP-FPM:php-fpm.listen_queue[{#POOLSOCKET}].diff()}=1
- 0
-
- PHP-FPM uses queue on {HOST.NAME} pool {#POOLNAME}
- 0
-
-
- 0
- 2
-
- 0
- 0
-
-
-
-
- {Template App PHP-FPM:proc.mem["php-fpm: pool {#POOLNAME}",,,,pmem].last()}>=50
- 0
-
- PHP-FPM uses too much memory on {HOST.NAME} pool {#POOLNAME}
- 0
-
-
- 0
- 3
-
- 0
- 0
-
-
-
-
-
-
- Pool {#POOLNAME} Connections
- 900
- 200
- 0.0000
- 100.0000
- 1
- 1
- 0
- 1
- 0
- 0.0000
- 0.0000
- 1
- 0
- 0
- 0
-
-
- 0
- 1
- 90CAF9
- 0
- 2
- 0
- -
- Template App PHP-FPM
- php-fpm.accepted_conn[{#POOLSOCKET}]
-
-
-
-
-
- Pool {#POOLNAME} CPU
- 900
- 200
- 0.0000
- 100.0000
- 1
- 1
- 0
- 1
- 0
- 0.0000
- 0.0000
- 1
- 0
- 0
- 0
-
-
- 0
- 1
- FF8A65
- 0
- 2
- 0
- -
- Template App PHP-FPM
- php-fpm.cpu[{#POOLNAME}]
-
-
-
-
-
- Pool {#POOLNAME} Max Children Reached
- 900
- 200
- 0.0000
- 100.0000
- 1
- 1
- 0
- 1
- 0
- 0.0000
- 0.0000
- 1
- 0
- 0
- 0
-
-
- 0
- 1
- EF5350
- 0
- 2
- 0
- -
- Template App PHP-FPM
- php-fpm.max_children_reached[{#POOLSOCKET}]
-
-
-
-
-
- Pool {#POOLNAME} Memory
- 900
- 200
- 0.0000
- 100.0000
- 1
- 1
- 0
- 1
- 0
- 0.0000
- 0.0000
- 1
- 0
- 0
- 0
-
-
- 0
- 5
- 00BFFF
- 0
- 2
- 0
- -
- Template App PHP-FPM
- proc.mem["php-fpm: pool {#POOLNAME}",,,,rss]
-
-
-
- 1
- 2
- FF0000
- 1
- 2
- 0
- -
- Template App PHP-FPM
- proc.mem["php-fpm: pool {#POOLNAME}",,,,pmem]
-
-
-
-
-
- Pool {#POOLNAME} Process
- 900
- 200
- 0.0000
- 100.0000
- 1
- 1
- 0
- 1
- 0
- 0.0000
- 0.0000
- 1
- 0
- 0
- 0
-
-
- 0
- 0
- FF0080
- 0
- 2
- 0
- -
- Template App PHP-FPM
- php-fpm.active_processes[{#POOLSOCKET}]
-
-
-
- 1
- 0
- 0040FF
- 0
- 2
- 0
- -
- Template App PHP-FPM
- php-fpm.idle_processes[{#POOLSOCKET}]
-
-
-
-
-
- Pool {#POOLNAME} Queue
- 900
- 200
- 0.0000
- 100.0000
- 1
- 1
- 0
- 1
- 0
- 0.0000
- 0.0000
- 1
- 0
- 0
- 0
-
-
- 0
- 5
- FB8C00
- 0
- 2
- 0
- -
- Template App PHP-FPM
- php-fpm.listen_queue[{#POOLSOCKET}]
-
-
-
- 1
- 2
- FF0000
- 1
- 2
- 0
- -
- Template App PHP-FPM
- php-fpm.queue[{#POOLSOCKET}]
-
-
-
-
-
-
-
- 3s
-
-
-
- 200
- 1
- 0
-
-
- 0
- 0
- 0
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
- {$PHP_FPM_STATUS_URL}
- /php-fpm-status
-
-
-
-
-
- PHP-FPM
- 2
- 3
-
-
- 20
- 500
- 100
- 0
- 0
- 1
- 1
- 0
- 0
- 0
-
-
- 0
- 0
-
- Pool {#POOLNAME} Connections
- Template App PHP-FPM
-
- 1
-
-
-
- 20
- 500
- 100
- 1
- 0
- 1
- 1
- 0
- 0
- 0
-
-
- 0
- 0
-
- Pool {#POOLNAME} Process
- Template App PHP-FPM
-
- 1
-
-
-
- 20
- 500
- 100
- 0
- 1
- 1
- 1
- 0
- 0
- 0
-
-
- 0
- 0
-
- Pool {#POOLNAME} CPU
- Template App PHP-FPM
-
- 1
-
-
-
- 20
- 500
- 100
- 1
- 1
- 1
- 1
- 0
- 0
- 0
-
-
- 0
- 0
-
- Pool {#POOLNAME} Memory
- Template App PHP-FPM
-
- 1
-
-
-
- 20
- 500
- 100
- 0
- 2
- 1
- 1
- 0
- 0
- 0
-
-
- 0
- 0
-
- Pool {#POOLNAME} Queue
- Template App PHP-FPM
-
- 1
-
-
-
- 20
- 500
- 100
- 1
- 2
- 1
- 1
- 0
- 0
- 0
-
-
- 0
- 0
-
- Pool {#POOLNAME} Max Children Reached
- Template App PHP-FPM
-
- 1
-
-
-
-
-
-
-
-
-