-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzbx_dpm.yaml
301 lines (301 loc) · 10.2 KB
/
zbx_dpm.yaml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
zabbix_export:
version: '5.2'
date: '2020-12-24T12:50:49Z'
groups:
-
name: Services
templates:
-
template: 'Template DPM alerts'
name: 'Template DPM alerts'
groups:
-
name: Services
applications:
-
name: 'DPM Alerts'
-
name: 'DPM Services'
items:
-
name: 'Export result Xml dpm'
type: ZABBIX_ACTIVE
key: 'system.run[powershell -NoProfile -ExecutionPolicy Bypass -File "C:\Program Files\Zabbix Agent\scripts\zabbix_dpm.ps1" ExportDPMAlerts,nowait]'
delay: '180'
history: 5d
trends: 15d
applications:
-
name: 'DPM Alerts'
triggers:
-
expression: '{last()}<1'
recovery_mode: RECOVERY_EXPRESSION
recovery_expression: '{last()}=1'
name: 'Export DPM Error'
priority: WARNING
manual_close: 'YES'
discovery_rules:
-
name: 'DPM discovery alerts'
key: 'dpm["DiscoveryAlerts"]'
delay: '1800'
lifetime: 1h
item_prototypes:
-
name: AffectedArea
key: 'dpm["GetAlertInfo","{#ALERTID}","AffectedArea"]'
delay: '1800'
history: 7d
trends: '0'
value_type: CHAR
applications:
-
name: 'DPM Alerts'
-
name: Datasource
key: 'dpm["GetAlertInfo","{#ALERTID}","Datasource"]'
delay: '1800'
history: 7d
trends: '0'
value_type: CHAR
applications:
-
name: 'DPM Alerts'
-
name: DatasourceId
key: 'dpm["GetAlertInfo","{#ALERTID}","DatasourceId"]'
delay: '1800'
history: 7d
trends: '0'
value_type: CHAR
applications:
-
name: 'DPM Alerts'
-
name: ErrorInfo
key: 'dpm["GetAlertInfo","{#ALERTID}","ErrorInfo"]'
delay: '1800'
history: 7d
trends: '0'
value_type: TEXT
applications:
-
name: 'DPM Alerts'
-
name: IsResolved
key: 'dpm["GetAlertInfo","{#ALERTID}","IsResolved"]'
delay: '1800'
history: 7d
applications:
-
name: 'DPM Alerts'
valuemap:
name: dpmIsResolved
preprocessing:
-
type: BOOL_TO_DECIMAL
parameters:
- ''
-
type: CHECK_NOT_SUPPORTED
parameters:
- ''
error_handler: CUSTOM_VALUE
error_handler_params: '5'
-
name: OccurredSince
key: 'dpm["GetAlertInfo","{#ALERTID}","OccurredSince"]'
delay: '1800'
history: 7d
trends: '0'
value_type: LOG
applications:
-
name: 'DPM Alerts'
-
name: PS
key: 'dpm["GetAlertInfo","{#ALERTID}","PS"]'
delay: '1800'
history: 7d
trends: '0'
value_type: CHAR
applications:
-
name: 'DPM Alerts'
-
name: Resolution
key: 'dpm["GetAlertInfo","{#ALERTID}","Resolution"]'
delay: '1800'
history: 7d
trends: '0'
value_type: CHAR
applications:
-
name: 'DPM Alerts'
-
name: ResolvedDateTime
key: 'dpm["GetAlertInfo","{#ALERTID}","ResolvedDateTime"]'
delay: '1800'
history: 7d
trends: '0'
value_type: LOG
applications:
-
name: 'DPM Alerts'
-
name: ServerName
key: 'dpm["GetAlertInfo","{#ALERTID}","ServerName"]'
delay: '1800'
history: 7d
trends: '0'
value_type: CHAR
applications:
-
name: 'DPM Alerts'
-
name: Severity
key: 'dpm["GetAlertInfo","{#ALERTID}","Severity"]'
delay: '1800'
history: 7d
applications:
-
name: 'DPM Alerts'
valuemap:
name: dpmSeverity
preprocessing:
-
type: CHECK_NOT_SUPPORTED
parameters:
- ''
error_handler: CUSTOM_VALUE
error_handler_params: '5'
-
name: Type
key: 'dpm["GetAlertInfo","{#ALERTID}","Type"]'
delay: '1800'
history: 7d
trends: '0'
value_type: CHAR
applications:
-
name: 'DPM Alerts'
-
name: Visible
key: 'dpm["GetAlertInfo","{#ALERTID}","Visible"]'
delay: '1800'
history: 7d
applications:
-
name: 'DPM Alerts'
preprocessing:
-
type: BOOL_TO_DECIMAL
parameters:
- ''
trigger_prototypes:
-
expression: '{Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","Severity"].last()}=2 and {Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=0'
recovery_mode: RECOVERY_EXPRESSION
recovery_expression: '{Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=1 or ({Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=-1 and {Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","Severity"].last()}=-1)'
name: 'Severity of alert for {#ALERTID} (Error)'
priority: HIGH
manual_close: 'YES'
tags:
-
tag: Service
value: dpm
-
expression: '{Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","Severity"].last()}=0 and {Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=0'
recovery_mode: RECOVERY_EXPRESSION
recovery_expression: '{Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=1 or ({Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=-1 and {Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","Severity"].last()}=-1)'
name: 'Severity of alert for {#ALERTID} (Information)'
priority: INFO
manual_close: 'YES'
tags:
-
tag: Service
value: dpm
-
expression: '{Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","Severity"].last()}=3 and {Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=0'
recovery_mode: RECOVERY_EXPRESSION
recovery_expression: '{Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=1 or ({Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=-1 and {Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","Severity"].last()}=-1)'
name: 'Severity of alert for {#ALERTID} (Unknown)'
priority: WARNING
description: 'unknown error'
manual_close: 'YES'
tags:
-
tag: Service
value: dpm
-
expression: '{Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","Severity"].last()}=1 and {Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=0'
recovery_mode: RECOVERY_EXPRESSION
recovery_expression: '{Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=1 or ({Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","IsResolved"].last()}=-1 and {Template DPM alerts:dpm["GetAlertInfo","{#ALERTID}","Severity"].last()}=-1)'
name: 'Severity of alert for {#ALERTID} (Warning)'
priority: AVERAGE
manual_close: 'YES'
tags:
-
tag: Service
value: dpm
-
name: 'DPM Services'
key: service.discovery
delay: 1h
filter:
evaltype: AND
conditions:
-
macro: '{#SERVICE.NAME}'
value: '@DPM'
formulaid: A
-
macro: '{#SERVICE.STARTUP}'
value: '0'
formulaid: B
item_prototypes:
-
name: 'Status {#SERVICE.DISPLAYNAME}'
key: 'service.info[{#SERVICE.NAME},state]'
delay: '60'
applications:
-
name: 'DPM Services'
trigger_prototypes:
-
expression: '{min(3)}<>0'
recovery_mode: RECOVERY_EXPRESSION
recovery_expression: '{min(#3)}=0'
name: '{#SERVICE.DISPLAYNAME} is not running (start type {#SERVICE.STARTUPNAME})'
priority: AVERAGE
manual_close: 'YES'
tags:
-
tag: Service
value: dpm
value_maps:
-
name: dpmIsResolved
mappings:
-
value: '0'
newvalue: Unresolved
-
value: '1'
newvalue: Resolved
-
name: dpmSeverity
mappings:
-
value: '0'
newvalue: Information
-
value: '1'
newvalue: Warning
-
value: '2'
newvalue: Error
-
value: '3'
newvalue: Unknown