zabbix_export: version: '6.0' date: '2021-11-21T21:59:14Z' groups: - uuid: 57b7ae836ca64446ba2c296389c009b7 name: Templates/Modules templates: - uuid: 1c24f65bbb834e32a12817fc2f2ac22f template: 'Module Linux systemd by Zabbix agent 2' name: 'Module Linux systemd by Zabbix agent 2' description: | ## Overview This is template for native monitoring systemd services via Zabbix Agent 2. Zabbix agent 2 is a new generation of Zabbix agent and may be used in place of Zabbix agent. Template is for Zabbix 4.4+ New version for zabbix 5.0.6 and 5.2.2 has ben uploaded + fixed regular expression in preprocessing. ## Author Tomas Hermanek groups: - name: Templates/Modules discovery_rules: - uuid: 4836700862a94363a27c1d80d142b29c name: 'Systemd services discovery' key: systemd.unit.discovery delay: 1h filter: evaltype: AND conditions: - macro: '{#UNIT.LOADSTATE}' value: loaded formulaid: A - macro: '{#UNIT.NAME}' value: systemd-timesyncd.service|systemd-fsck-root.service|rsync.service operator: NOT_MATCHES_REGEX formulaid: B - macro: '{#UNIT.UNITFILESTATE}' value: enabled|generated formulaid: C item_prototypes: - uuid: be8ac5f420bf4867a9a619e565449203 name: 'State of service: {#UNIT.NAME}' key: 'systemd.unit.info["{#UNIT.NAME}"]' trends: '0' value_type: CHAR description: | Description: {#UNIT.DESCRIPTION} Path: {#UNIT.PATH} valuemap: name: 'Service state' preprocessing: - type: REGEX parameters: - ^active$ - '1' error_handler: CUSTOM_VALUE error_handler_params: '0' tags: - tag: Application value: Systemd trigger_prototypes: - uuid: 86c21f1fa1014f6e8f6fe7522ec2c02a expression: 'last(/Module Linux systemd by Zabbix agent 2/systemd.unit.info["{#UNIT.NAME}"])<>1' name: 'Service {#UNIT.NAME} is not running!' opdata: 'Service current state: {ITEM.LASTVALUE}' priority: WARNING description: | Description: {#UNIT.DESCRIPTION} Path: {#UNIT.PATH} valuemaps: - uuid: 0af62e80c7284017912d353bf96bea1e name: 'Service state' mappings: - value: '0' newvalue: Down - value: '1' newvalue: Up