]> granicus.if.org Git - icinga2/blob - itl/command-nscp-local.conf
Add check_logfile to ITL
[icinga2] / itl / command-nscp-local.conf
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 if (!globals.contains("NscpPath")) {
4         NscpPath = dirname(msi_get_component_path("{5C45463A-4AE9-4325-96DB-6E239C034F93}"))
5 }
6
7 object CheckCommand "nscp-local" {
8         command = [ NscpPath + "\\nscp.exe", "client" ]
9
10         arguments = {
11                 "--log" = {
12                         value = "$nscp_log_level$"
13                         description = "The log level to use"
14                 }
15                 "--load-all" = {
16                         set_if ="$nscp_load_all$"
17                         description = "Load all plugins (currently only used with generate)"
18                 }
19                 "--module" = {
20                         value = "$nscp_modules$"
21                         description = "Specify which NSClient++ modules are required. 'nscp client' just needs 'CheckSystem' by default."
22                         repeat_key = true
23                 }
24                 "-q" = {
25                         value = "$nscp_query$"
26                         description = "Run a query with a given name"
27                         required = true
28                 }
29                 "-b" = {
30                         set_if = "$nscp_boot$"
31                         description = "Boot the client before executing command (similar as running the command from test mode)"
32                 }
33                 "-a" = {
34                         value = "$nscp_arguments$"
35                         repeat_key = true
36                         description = "List of arguments (arguments gets -- prefixed automatically (--argument foo=bar is the same as setting '--foo bar')"
37                 }
38                 "--show-all" = {
39                         set_if = "$nscp_showall$"
40                         description = ""
41                 }
42         }
43
44         vars.nscp_log_level = "critical"
45         vars.nscp_load_all = false
46         vars.nscp_boot = true
47         vars.nscp_showall = false
48         vars.nscp_modules = [ "CheckSystem" ]
49 }
50
51 object CheckCommand "nscp-local-cpu" {
52         import  "nscp-local"
53
54         arguments += {
55                 "--time" = {
56                         value = "$nscp_cpu_time$"
57                         repeat_key = true
58                         description = "The time to check"
59                 }
60                 "--warning" = {
61                         value = "load>$nscp_cpu_warning$"
62                 }
63                 "--critical" = {
64                         value = "load>$nscp_cpu_critical$"
65                 }
66                 "-a" = {
67                         value = "$nscp_cpu_arguments$"
68                         repeat_key = true
69                 }
70         }
71
72         vars.nscp_query = "check_cpu"
73         vars.nscp_showall = "$nscp_cpu_showall$"
74
75         vars.nscp_cpu_time = [ "1m", "5m", "15m" ]
76         vars.nscp_cpu_showall = true
77         vars.nscp_cpu_warning = 80
78         vars.nscp_cpu_critical = 90
79 }
80
81 object CheckCommand "nscp-local-memory" {
82         import  "nscp-local"
83
84         arguments += {
85                 "--type=committed" = {
86                         set_if = "$nscp_memory_committed$"
87                         description = "Total memory (RAM+PAGE)"
88                 }
89                 "--type=physical" = {
90                         set_if = "$nscp_memory_physical$"
91                         description = "Physical memory (RAM)"
92                 }
93                 "--warning" = {
94                         value = "$nscp_memory_op$ $nscp_memory_warning$"
95                 }
96                 "--critical" = {
97                         value = "$nscp_memory_op$ $nscp_memory_critical$"
98                 }
99                 "-a" = {
100                         value = "$nscp_memory_arguments$"
101                         repeat_key = true
102                 }
103         }
104
105         vars.nscp_query = "check_memory"
106         vars.nscp_showall = "$nscp_memory_showall$"
107
108         vars.nscp_memory_op = {{
109                 if (!macro("$nscp_memory_free$")) {
110                         return "used >"
111                 } else {
112                         return "free <"
113                 }
114         }}
115
116         vars.nscp_memory_committed = false
117         vars.nscp_memory_physical = true
118         vars.nscp_memory_free = true
119         vars.nscp_memory_warning = {{
120                 if (!macro("$nscp_memory_free$")) {
121                         return 80
122                 } else {
123                         return 20
124                 }
125         }}
126         vars.nscp_memory_critical = {{
127                 if (!macro("$nscp_memory_free$")) {
128                         return 90
129                 } else {
130                         return 10
131                 }
132         }}
133         vars.nscp_memory_showall = false
134 }
135
136 object CheckCommand "nscp-local-os-version" {
137         import  "nscp-local"
138
139         vars.nscp_query = "check_os_version"
140 }
141
142 object CheckCommand "nscp-local-pagefile" {
143         import  "nscp-local"
144
145         vars.nscp_query = "check_pagefile"
146 }
147
148 object CheckCommand "nscp-local-process" {
149         import  "nscp-local"
150
151         vars.nscp_query = "check_process"
152 }
153
154 object CheckCommand "nscp-local-service" {
155         import  "nscp-local"
156
157         arguments += {
158                 "--service" = {
159                         value = "$nscp_service_name$"
160                         repeat_key = true
161                 }
162                 "--ok" = {
163                         value = "$nscp_service_otype$='$nscp_service_ok$'"
164                 }
165                 "--warning" = {
166                         value = "$nscp_service_wtype$='$nscp_service_warning$'"
167                 }
168                 "--critical" = {
169                         value = "$nscp_service_ctype$='$nscp_service_critical$'"
170                 }
171                 "-a" = {
172                         value = "$nscp_service_arguments$"
173                         repeat_key = true
174                 }
175         }
176
177         vars.nscp_query = "check_service"
178         vars.nscp_showall = "$nscp_service_showall$"
179
180         vars.nscp_service_showall = true
181         vars.nscp_service_type = "state"
182         vars.nscp_service_otype = vars.nscp_service_type
183         vars.nscp_service_wtype = vars.nscp_service_type
184         vars.nscp_service_ctype = vars.nscp_service_type
185 }
186
187 object CheckCommand "nscp-local-uptime" {
188         import  "nscp-local"
189
190         vars.nscp_query = "check_uptime"
191 }
192
193 object CheckCommand "nscp-local-version" {
194         import  "nscp-local"
195
196         vars.nscp_query = "check_version"
197         vars.nscp_modules = [ "CheckHelpers" ]
198 }
199
200 object CheckCommand "nscp-local-disk" {
201         import "nscp-local"
202
203         arguments += {
204                 "--drive" = {
205                         value = "$nscp_disk_drive$"
206                         repeat_key = true
207                 }
208                 "--exclude" = {
209                         value = "$nscp_disk_exclude$"
210                         repeat_key = true
211                 }
212                 "--warning" = {
213                         value = "$nscp_disk_op$ $nscp_disk_warning$"
214                 }
215                 "--critical" = {
216                         value = "$nscp_disk_op$ $nscp_disk_critical$"
217                 }
218                 "-a" = {
219                         value = "$nscp_disk_arguments$"
220                         repeat_key = true
221                 }
222         }
223
224         vars.nscp_query = "check_drivesize"
225         vars.nscp_showall = "$nscp_disk_showall$"
226
227         vars.nscp_disk_op = {{
228                 if (!macro("$nscp_disk_free$")) {
229                         return "used >"
230                 } else {
231                         return "free <"
232                 }
233         }}
234
235         vars.nscp_disk_showall = true
236         vars.nscp_disk_free = false
237         vars.nscp_disk_warning = {{
238                 if (!macro("$nscp_disk_free$")) { return 80 } else { return 20 }
239         }}
240         vars.nscp_disk_critical = {{
241                 if (!macro("$nscp_disk_free$")) { return 90 } else { return 10 }
242         }}
243
244         vars.nscp_modules = [ "CheckDisk" ]
245 }
246
247 object CheckCommand "nscp-local-counter" {
248         import "nscp-local"
249
250         arguments += {
251                 "--counter" = {
252                         value = "$nscp_counter_name$"
253                         repeat_key = true
254                 }
255                 "--warning" = {
256                         value = "value $nscp_counter_op$ $nscp_counter_warning$"
257                 }
258                 "--critical" = {
259                         value = "value $nscp_counter_op$ $nscp_counter_critical$"
260                 }
261                 "--perf-syntax" = {
262                         value = "$nscp_counter_perfsyntax$"
263                 }
264                 "-a" = {
265                         value = "$nscp_counter_arguments$"
266                         repeat_key = true
267                 }
268         }
269
270         vars.nscp_counter_op = {{
271                 if (!macro("$nscp_counter_less$")) {
272                         return ">"
273                 } else {
274                         return "<"
275                 }
276         }}
277
278         vars.nscp_query = "check_pdh"
279         vars.nscp_showall = "$nscp_counter_showall$"
280         vars.nscp_counter_less = false
281         vars.nscp_counter_perfsyntax = "$nscp_counter_name$"
282 }
283
284 object CheckCommand "nscp-local-tasksched" {
285         import "nscp-local"
286
287         arguments += {
288                 "--filter" = {
289                         set_if = {{
290                                 var scheduler_name = macro("$nscp_tasksched_name$")
291                                 if (len(scheduler_name) > 0 ) {
292                                         return true
293                                 } else {
294                                         return false
295                                 }
296                         }}
297                         value = "title='$nscp_tasksched_name$'"
298                         description = "Name of the task to check."
299                 }
300                 "--folder" = {
301                         value = "$nscp_tasksched_folder$"
302                         description = "The folder in which the tasks to check reside."
303                 }
304                 "--hidden" = {
305                         set_if = "$nscp_tasksched_hidden$"
306                         description = "Look for hidden tasks."
307                 }
308                 "--recursive" = {
309                         value = "$nscp_tasksched_recursive$"
310                         description = "Recurse sub folder (defaults to true)."
311                 }
312                 "--warning" = {
313                         value = "$nscp_tasksched_warning$"
314                         description = "Filter which marks items which generates a warning state."
315                 }
316                 "--critical" = {
317                         value = "$nscp_tasksched_critical$"
318                         description = "Filter which marks items which generates a critical state."
319                 }
320                 "--empty-state" = {
321                         value = "$nscp_tasksched_emptystate$"
322                         description = "Return status to use when nothing matched filter."
323                 }
324                 "--perf-syntax" = {
325                         value = "$nscp_tasksched_perfsyntax$"
326                         description = "Performance alias syntax."
327                 }
328                 "--detail-syntax" = {
329                         value = "$nscp_tasksched_detailsyntax$"
330                         description = "Detail level syntax."
331                 }
332                 "-a" = {
333                         value = "$nscp_tasksched_arguments$"
334                         repeat_key = true
335                 }
336         }
337
338         vars.nscp_modules = "CheckTaskSched"
339         vars.nscp_query = "check_tasksched"
340         vars.nscp_showall = "$nscp_tasksched_showall$"
341         vars.nscp_tasksched_recursive = true
342         vars.nscp_tasksched_perfsyntax = "%(title)"
343         vars.nscp_tasksched_detailsyntax = "%(folder)/%(title): %(exit_code) != 0"
344         vars.nscp_tasksched_warning = "exit_code != 0"
345         vars.nscp_tasksched_critical = "exit_code < 0"
346
347 }