# OS processes by Zabbix agent ## Overview This template is designed to monitor processes by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection. For example, by specifying "zabbix" as macro value, you can monitor all zabbix processes. ## Requirements Zabbix version: 7.0 and higher. ## Tested versions This template has been tested on: - CentOS Linux 8 - Ubuntu 22.04.1 LTS ## Configuration > Zabbix should be configured according to the instructions in the [Templates out of the box](https://www.zabbix.com/documentation/7.0/manual/config/templates_out_of_the_box) section. ## Setup Install and setup [Zabbix agent](https://www.zabbix.com/documentation/7.0/manual/installation/install_from_packages). Custom processes set in macros: - {$PROC.NAME.MATCHES} - {$PROC.NAME.NOT_MATCHES} ### Macros used |Name|Description|Default| |----|-----------|-------| |{$PROC.NAME.MATCHES}|
This macro is used in the discovery of processes. It can be overridden on a host-level or on a linked template-level.
|`This macro is used in the discovery of processes. It can be overridden on a host-level or on a linked template-level.
|`The summary of data metrics for all processes.
|Zabbix agent|proc.get[,,,summary]| ### LLD rule Processes discovery |Name|Description|Type|Key and additional info| |----|-----------|----|-----------------------| |Processes discovery|Discovery of OS summary processes.
|Dependent item|custom.proc.discovery| ### Item prototypes for Processes discovery |Name|Description|Type|Key and additional info| |----|-----------|----|-----------------------| |Process [{#NAME}]: Get data|Summary metrics collected during the process {#NAME}.
|Dependent item|custom.proc.get[{#NAME}]**Preprocessing**
JSON Path: `$.[?(@["name"]=="{#NAME}")].first()`
⛔️Custom on fail: Set value to: `Failed to retrieve process {#NAME} data`
The summary of Resident Set Size (RSS) memory used by the process {#NAME} in bytes.
|Dependent item|custom.proc.rss[{#NAME}]**Preprocessing**
JSON Path: `$.rss`
⛔️Custom on fail: Discard value
The summary of virtual memory used by process {#NAME} in bytes.
|Dependent item|custom.proc.vmem[{#NAME}]**Preprocessing**
JSON Path: `$.vsize`
⛔️Custom on fail: Discard value
The percentage of real memory used by the process {#NAME}.
|Dependent item|custom.proc.pmem[{#NAME}]**Preprocessing**
JSON Path: `$.pmem`
⛔️Custom on fail: Discard value
The number of running processes {#NAME}.
|Dependent item|custom.proc.num[{#NAME}]**Preprocessing**
JSON Path: `$.processes`
⛔️Custom on fail: Set value to: `0`
Discard unchanged with heartbeat: `1h`
The number of threads {#NAME}.
|Dependent item|custom.proc.thread[{#NAME}]**Preprocessing**
JSON Path: `$.threads`
⛔️Custom on fail: Discard value
The number of page faults {#NAME}.
|Dependent item|custom.proc.page[{#NAME}]**Preprocessing**
JSON Path: `$.page_faults`
⛔️Custom on fail: Discard value
The size of locked memory {#NAME}.
|Dependent item|custom.proc.mem.locked[{#NAME}]**Preprocessing**
JSON Path: `$.lck`
⛔️Custom on fail: Discard value
The swap space used by {#NAME}.
|Dependent item|custom.proc.swap[{#NAME}]**Preprocessing**
JSON Path: `$.swap`
⛔️Custom on fail: Discard value