Files
templates-default/PHP-FPM_by_Zabbix_agent_active.yaml
T

669 lines
26 KiB
YAML

zabbix_export:
version: '7.0'
template_groups:
- uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
name: Templates/Applications
templates:
- uuid: a9e83f950e9f41a78474d523c8376338
template: 'PHP-FPM by Zabbix agent active'
name: 'PHP-FPM by Zabbix agent active'
description: |
Get PHP-FPM metrics using Zabbix agent running on Linux.
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/7.0/manual/appendix/items/proc_mem_num_notes) and change {$PHP_FPM.PROCESS.NAME.PARAMETER} macro if needed.
Generated by official Zabbix template tool "Templator"
vendor:
name: Zabbix
version: 7.0-1
groups:
- name: Templates/Applications
items:
- uuid: b7e7fa57f21a440da82f4cecd2ee4354
name: 'Accepted connections per second'
type: DEPENDENT
key: php-fpm.conn_accepted.rate
delay: '0'
value_type: FLOAT
description: 'The number of accepted requests per second.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''accepted conn'']'
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: connections
- uuid: 0f340ff9525d4c6ca842defe43bdfcd1
name: 'Listen queue'
type: DEPENDENT
key: php-fpm.listen_queue
delay: '0'
description: 'The current number of connections that have been initiated but not yet accepted.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''listen queue'']'
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: listen-queue
- uuid: 1d49d094424b428595b712a8f9d9debd
name: 'Listen queue, len'
type: DEPENDENT
key: php-fpm.listen_queue_len
delay: '0'
description: 'The size of the socket queue of pending connections.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''listen queue len'']'
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: listen-queue
- uuid: 27e0a653944e42f7a83536460e25ddc6
name: 'Listen queue, max'
type: DEPENDENT
key: php-fpm.listen_queue_max
delay: '0'
description: 'The maximum number of requests in the queue of pending connections since this FPM pool was started.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''max listen queue'']'
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: listen-queue
- uuid: bea3630fd88448228cd3e6b5808bac5f
name: 'Queue usage'
type: CALCULATED
key: php-fpm.listen_queue_usage
value_type: FLOAT
units: '%'
params: 'last(//php-fpm.listen_queue)/(last(//php-fpm.listen_queue_len)+(last(//php-fpm.listen_queue_len)=0))*100'
description: 'The utilization of the queue.'
tags:
- tag: component
value: application
triggers:
- uuid: ffe46ce6fa4545ac8b2f035488c1b7ba
expression: 'min(/PHP-FPM by Zabbix agent active/php-fpm.listen_queue_usage,15m) > {$PHP_FPM.QUEUE.WARN.MAX}'
name: 'PHP-FPM: Queue utilization is high'
event_name: 'PHP-FPM: Queue utilization is high (over {$PHP_FPM.QUEUE.WARN.MAX}% for 15m)'
priority: WARNING
description: |
The queue for this pool has reached `{$PHP_FPM.QUEUE.WARN.MAX}%` of its maximum capacity.
Items in the queue represent the current number of connections that have been initiated on this pool but not yet accepted.
tags:
- tag: scope
value: capacity
- uuid: 66c7229e59504c5ba2e669e46bf74630
name: 'Max children reached'
type: DEPENDENT
key: php-fpm.max_children
delay: '0'
description: 'The number of times that `pm.max_children` has been reached since the PHP-FPM pool was started.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''max children reached'']'
- type: SIMPLE_CHANGE
parameters:
- ''
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: application
- uuid: b7d1aa5426ef45ca939e9de82f495008
name: 'Pool name'
type: DEPENDENT
key: php-fpm.name
delay: '0'
value_type: CHAR
trends: '0'
description: 'The name of the current pool.'
preprocessing:
- type: JSONPATH
parameters:
- $.pool
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: application
- uuid: 1385ea3b68944c30b0ce427ead889902
name: Ping
type: DEPENDENT
key: php-fpm.ping
delay: '0'
valuemap:
name: 'Service state'
preprocessing:
- type: REGEX
parameters:
- '{$PHP_FPM.PING.REPLY}($|\r?\n)'
- '1'
error_handler: CUSTOM_VALUE
error_handler_params: '0'
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: health
- uuid: 22535e01c27b498bae7fc1738760a4a3
name: 'Processes, active'
type: DEPENDENT
key: php-fpm.processes_active
delay: '0'
description: 'The total number of active processes.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''active processes'']'
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: system
- uuid: ab4d02aafd3241549e2224d287c19962
name: 'Processes, idle'
type: DEPENDENT
key: php-fpm.processes_idle
delay: '0'
description: 'The total number of idle processes.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''idle processes'']'
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: system
- uuid: 057b859639cb4fcc92896cb144b1a709
name: 'Processes, max active'
type: DEPENDENT
key: php-fpm.processes_max_active
delay: '0'
description: 'The highest value of "active processes" since the PHP-FPM server was started.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''max active processes'']'
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: application
- uuid: 269355114f664ee5947382f62216ce1a
name: 'Processes, total'
type: DEPENDENT
key: php-fpm.processes_total
delay: '0'
description: 'The total number of server processes currently running.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''total processes'']'
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: system
- uuid: 7bd25d99f654482f9e86d50546e51aa2
name: 'Process manager'
type: DEPENDENT
key: php-fpm.process_manager
delay: '0'
value_type: CHAR
trends: '0'
description: 'The method used by the process manager to control the number of child processes for this pool.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''process manager'']'
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: application
triggers:
- uuid: 380943ae41cd48e5b903f433216f3cd1
expression: 'last(/PHP-FPM by Zabbix agent active/php-fpm.process_manager,#1)<>last(/PHP-FPM by Zabbix agent active/php-fpm.process_manager,#2)'
name: 'PHP-FPM: Manager changed'
event_name: 'PHP-FPM: Manager changed (new value received: {ITEM.VALUE})'
priority: INFO
description: 'The PHP-FPM manager has changed. Acknowledge to close the problem manually.'
manual_close: 'YES'
tags:
- tag: scope
value: notice
- uuid: ae81f04c1f9a4f53a09815690d5d43ac
name: 'Slow requests'
type: DEPENDENT
key: php-fpm.slow_requests
delay: '0'
description: 'The number of requests that has exceeded your `request_slowlog_timeout` value.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''slow requests'']'
- type: SIMPLE_CHANGE
parameters:
- ''
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: application
triggers:
- uuid: 4a25c3fecad74df7ba59be94dd1df7cf
expression: 'min(/PHP-FPM by Zabbix agent active/php-fpm.slow_requests,#3)>0'
name: 'PHP-FPM: Detected slow requests'
priority: WARNING
description: |
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).
tags:
- tag: scope
value: performance
- uuid: cbd3d52676694f5f807310919511ee51
name: 'Start time'
type: DEPENDENT
key: php-fpm.start_time
delay: '0'
units: unixtime
description: 'The time when this pool was started.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''start time'']'
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: application
- uuid: 4b730deac04448a68dfdcea90a83c0b4
name: Uptime
type: DEPENDENT
key: php-fpm.uptime
delay: '0'
units: s
description: 'It indicates how long has this pool been running.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[''start since'']'
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: application
triggers:
- uuid: 77e61db3d40d4bd1ba518d27dfd05491
expression: 'last(/PHP-FPM by Zabbix agent active/php-fpm.uptime)<10m'
name: 'PHP-FPM: Pool has been restarted'
event_name: 'PHP-FPM: Pool has been restarted (uptime < 10m)'
priority: INFO
description: 'Uptime is less than 10 minutes.'
manual_close: 'YES'
tags:
- tag: scope
value: notice
- uuid: 0807e0c9c77f45ff9b39f6c587b33107
name: Version
type: DEPENDENT
key: php-fpm.version
delay: '0'
value_type: CHAR
trends: '0'
description: '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.'
preprocessing:
- type: REGEX
parameters:
- '^[.\s\S]*X-Powered-By: PHP/([.\d]{1,})'
- \1
error_handler: DISCARD_VALUE
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 3h
master_item:
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"]'
tags:
- tag: component
value: application
triggers:
- uuid: 27684ff67232429dad79e0eae323945d
expression: 'last(/PHP-FPM by Zabbix agent active/php-fpm.version,#1)<>last(/PHP-FPM by Zabbix agent active/php-fpm.version,#2) and length(last(/PHP-FPM by Zabbix agent active/php-fpm.version))>0'
name: 'PHP-FPM: Version has changed'
event_name: 'PHP-FPM: Version has changed (new version: {ITEM.VALUE})'
priority: INFO
description: 'The PHP-FPM version has changed. Acknowledge to close the problem manually.'
manual_close: 'YES'
tags:
- tag: scope
value: notice
- uuid: 2e72b191ec3b481f800e100e69a85691
name: 'Get processes summary'
type: ZABBIX_ACTIVE
key: 'proc.get[{$PHP_FPM.PROCESS.NAME.PARAMETER},,,summary]'
history: '0'
value_type: TEXT
trends: '0'
description: 'The aggregated data of summary metrics for all processes.'
tags:
- tag: component
value: raw
- uuid: ca300d24e4434dd8bc5e86ea859eb9f6
name: php-fpm_ping
type: ZABBIX_ACTIVE
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.PING.PAGE}","{$PHP_FPM.PORT}"]'
history: '0'
value_type: TEXT
trends: '0'
tags:
- tag: component
value: health
- uuid: de356fd730494b27a701cb900cd5c9b1
name: 'Get status page'
type: ZABBIX_ACTIVE
key: 'web.page.get["{$PHP_FPM.HOST}","{$PHP_FPM.STATUS.PAGE}?json","{$PHP_FPM.PORT}"]'
history: '0'
value_type: TEXT
trends: '0'
preprocessing:
- type: REGEX
parameters:
- '^[.\s\S]*({.+})'
- \1
tags:
- tag: component
value: raw
discovery_rules:
- uuid: 57c2c152cf1e4a84863d77bd05289f50
name: 'PHP-FPM process discovery'
type: DEPENDENT
key: php-fpm.proc.discovery
delay: '0'
filter:
evaltype: AND
conditions:
- macro: '{#PHP_FPM.NAME}'
value: '{$PHP_FPM.PROCESS_NAME}'
formulaid: A
description: 'The discovery of the PHP-FPM summary processes.'
item_prototypes:
- uuid: 42cac727ddf24220bf93f8b987450694
name: 'Get process data'
type: DEPENDENT
key: 'php-fpm.proc.get[{#PHP_FPM.NAME}]'
delay: '0'
history: '0'
value_type: TEXT
trends: '0'
description: 'The summary metrics aggregated by a process `{#PHP_FPM.NAME}`.'
preprocessing:
- type: JSONPATH
parameters:
- '$.[?(@["name"]=="{#PHP_FPM.NAME}")].first()'
error_handler: CUSTOM_VALUE
error_handler_params: 'Failed to retrieve process {#PHP_FPM.NAME} data'
master_item:
key: 'proc.get[{$PHP_FPM.PROCESS.NAME.PARAMETER},,,summary]'
tags:
- tag: component
value: raw
- uuid: 95e07134044443c894a4ea47404b548e
name: 'Number of running processes'
type: DEPENDENT
key: 'php-fpm.proc.num[{#PHP_FPM.NAME}]'
delay: '0'
description: 'The number of running processes `{#PHP_FPM.NAME}`.'
preprocessing:
- type: JSONPATH
parameters:
- $.processes
error_handler: CUSTOM_VALUE
error_handler_params: '0'
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
master_item:
key: 'php-fpm.proc.get[{#PHP_FPM.NAME}]'
tags:
- tag: component
value: system
trigger_prototypes:
- uuid: 86aabcdb709c4199b6c64e321875c60d
expression: 'last(/PHP-FPM by Zabbix agent active/php-fpm.proc.num[{#PHP_FPM.NAME}])=0'
name: 'PHP-FPM: Process is not running'
priority: HIGH
tags:
- tag: scope
value: availability
- uuid: cceec896a859443e9323a8d738e5620f
name: 'Memory usage, %'
type: DEPENDENT
key: 'php-fpm.proc.pmem[{#PHP_FPM.NAME}]'
delay: '0'
value_type: FLOAT
units: '%'
description: 'The percentage of real memory used by a process `{#PHP_FPM.NAME}`.'
preprocessing:
- type: JSONPATH
parameters:
- $.pmem
error_handler: DISCARD_VALUE
master_item:
key: 'php-fpm.proc.get[{#PHP_FPM.NAME}]'
tags:
- tag: component
value: memory
- uuid: 2001d850797548389aca5d2b90e68dc1
name: 'Memory usage (rss)'
type: DEPENDENT
key: 'php-fpm.proc.rss[{#PHP_FPM.NAME}]'
delay: '0'
units: B
description: 'The summary of resident set size memory used by a process `{#PHP_FPM.NAME}` expressed in bytes.'
preprocessing:
- type: JSONPATH
parameters:
- $.rss
error_handler: DISCARD_VALUE
master_item:
key: 'php-fpm.proc.get[{#PHP_FPM.NAME}]'
tags:
- tag: component
value: memory
- uuid: 8a1114f7c4604d43b16627fcc9cc7604
name: 'Memory usage (vsize)'
type: DEPENDENT
key: 'php-fpm.proc.vmem[{#PHP_FPM.NAME}]'
delay: '0'
units: B
description: 'The summary of virtual memory used by a process `{#PHP_FPM.NAME}` expressed in bytes.'
preprocessing:
- type: JSONPATH
parameters:
- $.vsize
error_handler: DISCARD_VALUE
master_item:
key: 'php-fpm.proc.get[{#PHP_FPM.NAME}]'
tags:
- tag: component
value: memory
- uuid: 65c8bd5634d84552b401c15237b74de8
name: 'CPU utilization'
type: ZABBIX_ACTIVE
key: 'proc.cpu.util[{#PHP_FPM.NAME}]'
value_type: FLOAT
units: '%'
description: 'The percentage of the CPU utilization by a process `{#PHP_FPM.NAME}`.'
tags:
- tag: component
value: cpu
trigger_prototypes:
- uuid: f28aac156ea142c4b92e8d5a29ed79f2
expression: 'nodata(/PHP-FPM by Zabbix agent active/php-fpm.uptime,30m)=1 and last(/PHP-FPM by Zabbix agent active/php-fpm.proc.num[{#PHP_FPM.NAME}])>0'
name: 'PHP-FPM: Failed to fetch info data'
event_name: 'PHP-FPM: Failed to fetch info data (or no data for 30m)'
priority: INFO
description: 'Zabbix has not received any data for items for the last 30 minutes.'
manual_close: 'YES'
tags:
- tag: scope
value: notice
- uuid: f33109ac78a84debb66fa4ed92384f99
expression: '(last(/PHP-FPM by Zabbix agent active/php-fpm.ping)=0 or nodata(/PHP-FPM by Zabbix agent active/php-fpm.ping,3m)=1) and last(/PHP-FPM by Zabbix agent active/php-fpm.proc.num[{#PHP_FPM.NAME}])>0'
name: 'PHP-FPM: Service is down'
priority: HIGH
manual_close: 'YES'
tags:
- tag: scope
value: availability
graph_prototypes:
- uuid: 3e0a2769bfd74c72bba0736e483fa3a1
name: 'PHP-FPM: Memory usage[{#PHP_FPM.NAME}]'
graph_items:
- drawtype: BOLD_LINE
color: 199C0D
item:
host: 'PHP-FPM by Zabbix agent active'
key: 'php-fpm.proc.vmem[{#PHP_FPM.NAME}]'
- sortorder: '1'
drawtype: BOLD_LINE
color: F63100
item:
host: 'PHP-FPM by Zabbix agent active'
key: 'php-fpm.proc.rss[{#PHP_FPM.NAME}]'
master_item:
key: 'proc.get[{$PHP_FPM.PROCESS.NAME.PARAMETER},,,summary]'
lld_macro_paths:
- lld_macro: '{#PHP_FPM.NAME}'
path: $.name
tags:
- tag: class
value: application
- tag: target
value: php-fpm
macros:
- macro: '{$PHP_FPM.HOST}'
value: localhost
description: 'The hostname or IP address of the PHP-FPM status for a host or container.'
- macro: '{$PHP_FPM.PING.PAGE}'
value: ping
description: 'The path of the PHP-FPM ping page.'
- macro: '{$PHP_FPM.PING.REPLY}'
value: pong
description: 'The expected reply to the ping.'
- macro: '{$PHP_FPM.PORT}'
value: '80'
description: 'The port of the PHP-FPM status host or container.'
- macro: '{$PHP_FPM.PROCESS.NAME.PARAMETER}'
description: 'The process name of the PHP-FPM used in the item key `proc.get`. It could be specified if the correct process name is known.'
- macro: '{$PHP_FPM.PROCESS_NAME}'
value: php-fpm
description: 'The process name filter for the PHP-FPM process discovery. May vary depending on your OS distribution.'
- macro: '{$PHP_FPM.QUEUE.WARN.MAX}'
value: '80'
description: 'The maximum percent of the PHP-FPM queue usage for a trigger expression.'
- macro: '{$PHP_FPM.STATUS.PAGE}'
value: status
description: 'The path of the PHP-FPM status page.'
dashboards:
- uuid: 62e8b6d8dfe04592b4fe73cb251990ae
name: 'PHP-FPM: Overview'
pages:
- name: Main
widgets:
- type: graph
width: '36'
height: '5'
fields:
- type: GRAPH
name: graphid.0
value:
host: 'PHP-FPM by Zabbix agent active'
name: 'PHP-FPM: Process'
- type: STRING
name: reference
value: AAAAA
- type: graph
x: '36'
width: '36'
height: '5'
fields:
- type: GRAPH
name: graphid.0
value:
host: 'PHP-FPM by Zabbix agent active'
name: 'PHP-FPM: Queue'
- type: STRING
name: reference
value: AAAAB
valuemaps:
- uuid: a4bc71640e694328a20fe200c7c5fece
name: 'Service state'
mappings:
- value: '0'
newvalue: Down
- value: '1'
newvalue: Up
graphs:
- uuid: 493023e7a76b4bbba062c7fa79c6395c
name: 'PHP-FPM: Process'
graph_items:
- color: 199C0D
item:
host: 'PHP-FPM by Zabbix agent active'
key: php-fpm.processes_max_active
- sortorder: '1'
color: F63100
item:
host: 'PHP-FPM by Zabbix agent active'
key: php-fpm.processes_idle
- sortorder: '2'
color: 00611C
item:
host: 'PHP-FPM by Zabbix agent active'
key: php-fpm.processes_total
- sortorder: '3'
color: F7941D
item:
host: 'PHP-FPM by Zabbix agent active'
key: php-fpm.processes_active
- uuid: 4555442cca864b45ba34904f4e8d44d8
name: 'PHP-FPM: Queue'
graph_items:
- color: 199C0D
item:
host: 'PHP-FPM by Zabbix agent active'
key: php-fpm.listen_queue_len
- sortorder: '1'
color: F63100
item:
host: 'PHP-FPM by Zabbix agent active'
key: php-fpm.listen_queue
- sortorder: '2'
color: 00611C
item:
host: 'PHP-FPM by Zabbix agent active'
key: php-fpm.listen_queue_max