-
Notifications
You must be signed in to change notification settings - Fork 1
/
check_wmi_plus.conf
406 lines (308 loc) · 9.23 KB
/
check_wmi_plus.conf
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
object CheckCommand "check_wmi" {
import "plugin-check-command"
command = [ PluginDir + "/check_wmi_plus.pl" ]
arguments = {
"--inidir" = "$wmi_inidir$"
"-H" = "$address$"
"-A" = "$wmi_authfile_path$"
"-m" = "$check_mode$"
"-s" = "$wmi_submode$"
"-a" = "$wmi_arg1$"
"-o" = "$wmi_arg2$"
"-3" = "$wmi_arg3$"
"-4" = "$wmi_arg4$"
"-5" = "$wmi_arg5$"
"-y" = "$wmi_delay$"
"-w" = "$wmi_warn$"
"-c" = "$wmi_crit$"
"-t" = "$wmi_timeout$"
"-d" = "$wmi_debug$"
"-exc" = "$wmi_exclude$"
"--nodataexit" = "$wmi_nodata$"
"--nodatastring" = "$wmi_nodatastring$"
"--forcetruncateoutput" = "$wmi_truncateoutput$"
"--nodatamode" = {
set_if = "$wmi_nodatamode$"
}
}
vars.wmi_authfile_path = "/etc/icinga2/wmi.auth"
vars.wmi_inidir = "/etc/check_wmi_plus/check_wmi_plus.d"
vars.wmi_nodatamode = false
}
template Service "wmi-service" {
import "generic-service"
check_command = "check_wmi"
check_interval = 60m
retry_interval = 10m
}
apply Service "1: Windows OS" {
import "wmi-service"
vars.check_mode = "info"
vars.wmi_submode = "os"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "1: Windows time" {
import "wmi-service"
vars.check_mode = "checktime"
vars.wmi_warn = "-180:180"
vars.wmi_crit = "-300:300"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "1: Windows uptime" {
import "wmi-service"
vars.check_mode = "checkuptime"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "2: CPU usage average" {
import "wmi-service"
vars.check_mode = "checkcpu"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "2: CPU usage" {
import "wmi-service"
vars.check_mode = "checkeachcpu"
vars.wmi_warn = "80"
vars.wmi_crit = "90"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "3: RAM usage" {
import "wmi-service"
vars.check_mode = "checkmem"
vars.wmi_warn = "80"
vars.wmi_crit = "90"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "4: Disk usage" {
import "wmi-service"
vars.check_mode = "checkdrivesize"
vars.wmi_arg1 = "."
vars.wmi_arg2 = "1"
vars.wmi_warn = "90"
vars.wmi_crit = "95"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "5: Network adapter" {
import "wmi-service"
vars.check_mode = "info"
vars.wmi_submode = "net"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "6: Page file usage" {
import "wmi-service"
vars.check_mode = "checkpage"
vars.wmi_arg1 = "auto"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "7: Process CPU > 25%" {
import "wmi-service"
vars.check_mode = "checkproc"
vars.wmi_submode = "cpuabove"
vars.wmi_arg1 = "%"
vars.wmi_warn = "25"
vars.wmi_exclude = "_AvgCPU=@0:25"
vars.wmi_nodata = "0"
vars.wmi_nodatastring = "No process with high CPU found"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "7: Process count" {
import "wmi-service"
vars.check_mode = "checkproc"
vars.wmi_submode = "count"
vars.wmi_arg1 = "%"
vars.wmi_truncateoutput = 50
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "7: Process RAM > 500MB" {
import "wmi-service"
vars.check_mode = "checkproc"
vars.wmi_submode = "memoryabove"
vars.wmi_arg = "%"
vars.wmi_warn = "_ItemCount>0"
vars.wmi_exclude = "WorkingSet=@0:500M"
vars.wmi_nodata = 0
vars.wmi_nodatastring = "No process with high RAM found"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "8: Event log system" {
import "wmi-service"
vars.check_mode = "checkeventlog"
vars.wmi_arg1 = "system"
vars.wmi_arg2 = "2"
vars.wmi_arg3 = "1"
vars.wmi_warn = "50"
vars.wmi_crit = "100"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "8: Event log application" {
import "wmi-service"
vars.check_mode = "checkeventlog"
vars.wmi_arg1 = "application"
vars.wmi_arg2 = "2"
vars.wmi_arg3 = "1"
vars.wmi_warn = "50"
vars.wmi_crit = "100"
assign where host.vars.os == "Windows"
ignore where host.vars.disable_wmi
}
apply Service "9: RDP sessions" {
import "wmi-service"
vars.check_mode = "checkts"
vars.wmi_submode = "sessions"
assign where host.vars.os == "Windows" && host.vars.osversion >= 2008
ignore where host.vars.disable_wmi
}
apply Service "9: RDP session" {
import "wmi-service"
vars.check_mode = "checkts"
vars.wmi_submode = "sessions2003"
assign where host.vars.os == "Windows" && host.vars.osversion == 2003
ignore where host.vars.disable_wmi
}
apply Service "AD: Replication Status" {
import "wmi-service"
vars.check_mode = "checkad"
vars.wmi_submode = "replication"
vars.wmi_crit = "0"
vars.wmi_nodatamode = true
assign where host.vars.domain_controller
ignore where host.vars.disable_wmi
}
apply Service "AD DNS Statistics" {
import "wmi-service"
vars.check_mode = "checkdns"
vars.wmi_submode = "stats"
vars.wmi_nodatamode = true
assign where host.vars.domain_controller
ignore where host.vars.disable_wmi
}
apply Service "AD: DNS A Records" {
import "wmi-service"
vars.check_mode = "checkdns"
vars.wmi_submode = "arecords"
vars.wmi_nodatamode = true
assign where host.vars.domain_controller
ignore where host.vars.disable_wmi
}
apply Service "AD: DNS CNAME Records" {
import "wmi-service"
vars.check_mode = "checkdns"
vars.wmi_submode = "cnamerecords"
vars.wmi_nodatamode = true
assign where host.vars.domain_controller
ignore where host.vars.disable_wmi
}
apply Service "IIS: Users" {
import "wmi-service"
vars.check_mode = "checkiis"
vars.wmi_submode = "users"
vars.wmi_arg1 = "_Total"
assign where host.vars.iis_server
ignore where host.vars.disable_wmi
}
apply Service "IIS: Requests" {
import "wmi-service"
vars.check_mode = "checkiis"
vars.wmi_submode = "requests"
vars.wmi_arg1 = "_Total"
assign where host.vars.iis_server
ignore where host.vars.disable_wmi
}
apply Service "IIS: Connections" {
import "wmi-service"
vars.check_mode = "checkiis"
vars.wmi_submode = "connections"
vars.wmi_arg1 = "_Total"
assign where host.vars.iis_server
ignore where host.vars.disable_wmi
}
apply Service "IIS: Errors" {
import "wmi-service"
vars.check_mode = "checkiis"
vars.wmi_submode = "errors"
vars.wmi_arg1 = "_Total"
assign where host.vars.iis_server
ignore where host.vars.disable_wmi
}
apply Service "MSSQL: General Statistics" {
import "wmi-service"
vars.check_mode = "checksql"
vars.wmi_submode = "general"
if (host.vars.mssql_edition == "Express") {
vars.wmi_arg1 = "MSSQLSQLEXPRESS_MSSQLSQLEXPRESS"
}
assign where host.vars.mssql_server
ignore where host.vars.disable_wmi
}
apply Service "MSSQL: Buffer Manager" {
import "wmi-service"
vars.check_mode = "checksql"
vars.wmi_submode = "buffermanager"
if (host.vars.mssql_edition == "Express") {
vars.wmi_arg1 = "MSSQLSQLEXPRESS_MSSQLSQLEXPRESS"
}
assign where host.vars.mssql_server
ignore where host.vars.disable_wmi
}
apply Service "MSSQL: Latch Statistics" {
import "wmi-service"
vars.check_mode = "checksql"
vars.wmi_submode = "latches"
if (host.vars.mssql_edition == "Express") {
vars.wmi_arg1 = "MSSQLSQLEXPRESS_MSSQLSQLEXPRESS"
}
assign where host.vars.mssql_server
ignore where host.vars.disable_wmi
}
apply Service "MSSQL: Lock Statistics" {
import "wmi-service"
vars.check_mode = "checksql"
vars.wmi_submode = "locks"
if (host.vars.mssql_edition == "Express") {
vars.wmi_arg1 = "MSSQLSQLEXPRESS_MSSQLSQLEXPRESS"
}
assign where host.vars.mssql_server
ignore where host.vars.disable_wmi
}
apply Service "MSSQL: SQL Statistics" {
import "wmi-service"
vars.check_mode = "checksql"
vars.wmi_submode = "sqlstats"
if (host.vars.mssql_edition == "Express") {
vars.wmi_arg1 = "MSSQLSQLEXPRESS_MSSQLSQLEXPRESS"
}
assign where host.vars.mssql_server
ignore where host.vars.disable_wmi
}
apply Service "MSSQL: Memory Statistics" {
import "wmi-service"
vars.check_mode = "checksql"
vars.wmi_submode = "memory"
if (host.vars.mssql_edition == "Express") {
vars.wmi_arg1 = "MSSQLSQLEXPRESS_MSSQLSQLEXPRESS"
}
assign where host.vars.mssql_server
ignore where host.vars.disable_wmi
}
apply Service "MSSQL: Cache Statistics" {
import "wmi-service"
vars.check_mode = "checksql"
vars.wmi_submode = "cache"
if (host.vars.mssql_edition == "Express") {
vars.wmi_arg1 = "MSSQLSQLEXPRESS_MSSQLSQLEXPRESS"
}
assign where host.vars.mssql_server
ignore where host.vars.disable_wmi
}