-
Notifications
You must be signed in to change notification settings - Fork 41
/
Template_App_systemd_Services_v5.xml
115 lines (115 loc) · 4.88 KB
/
Template_App_systemd_Services_v5.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>5.0</version>
<date>2021-02-18T21:01:32Z</date>
<groups>
<group>
<name>Templates/Applications</name>
</group>
</groups>
<templates>
<template>
<template>SystemD service monitoring template</template>
<name>SystemD service monitoring template</name>
<description>Discovery enabled systemd services, checks status every 1m, and checks systemd service active time to determine if service has restarted.</description>
<groups>
<group>
<name>Templates/Applications</name>
</group>
</groups>
<applications>
<application>
<name>systemd</name>
</application>
</applications>
<discovery_rules>
<discovery_rule>
<name>Service Discovery</name>
<type>ZABBIX_ACTIVE</type>
<key>systemd.service.discovery</key>
<delay>5m</delay>
<lifetime>1d</lifetime>
<item_prototypes>
<item_prototype>
<name>{#SERVICE} Restart</name>
<type>ZABBIX_ACTIVE</type>
<key>systemd.service.restart[{#SERVICE}]</key>
<history>1d</history>
<trends>1d</trends>
<description>Checks to see if the service has restarted recently</description>
<applications>
<application>
<name>systemd</name>
</application>
</applications>
<valuemap>
<name>Restart status</name>
</valuemap>
<trigger_prototypes>
<trigger_prototype>
<expression>{last()}=1</expression>
<name>{#SERVICE} service has restarted</name>
<priority>WARNING</priority>
<description>Triggers an alert if a service has restarted</description>
<manual_close>YES</manual_close>
</trigger_prototype>
</trigger_prototypes>
</item_prototype>
<item_prototype>
<name>{#SERVICE} Status</name>
<type>ZABBIX_ACTIVE</type>
<key>systemd.service.status[{#SERVICE}]</key>
<history>1d</history>
<trends>1d</trends>
<description>Returns the status of the systemd service</description>
<applications>
<application>
<name>systemd</name>
</application>
</applications>
<valuemap>
<name>Service state</name>
</valuemap>
<trigger_prototypes>
<trigger_prototype>
<expression>{last()}=0</expression>
<name>{#SERVICE} service not running</name>
<priority>HIGH</priority>
<manual_close>YES</manual_close>
</trigger_prototype>
</trigger_prototypes>
</item_prototype>
</item_prototypes>
</discovery_rule>
</discovery_rules>
</template>
</templates>
<value_maps>
<value_map>
<name>Restart status</name>
<mappings>
<mapping>
<value>0</value>
<newvalue>stable</newvalue>
</mapping>
<mapping>
<value>1</value>
<newvalue>restarted</newvalue>
</mapping>
</mappings>
</value_map>
<value_map>
<name>Service state</name>
<mappings>
<mapping>
<value>0</value>
<newvalue>Down</newvalue>
</mapping>
<mapping>
<value>1</value>
<newvalue>Up</newvalue>
</mapping>
</mappings>
</value_map>
</value_maps>
</zabbix_export>