]> granicus.if.org Git - icinga2/blob - itl/command-nscp-local.conf
Fix nullptr deref in cluster events
[icinga2] / itl / command-nscp-local.conf
1 /******************************************************************************
2  * Icinga 2                                                                   *
3  * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/)  *
4  *                                                                            *
5  * This program is free software; you can redistribute it and/or              *
6  * modify it under the terms of the GNU General Public License                *
7  * as published by the Free Software Foundation; either version 2             *
8  * of the License, or (at your option) any later version.                     *
9  *                                                                            *
10  * This program is distributed in the hope that it will be useful,            *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
13  * GNU General Public License for more details.                               *
14  *                                                                            *
15  * You should have received a copy of the GNU General Public License          *
16  * along with this program; if not, write to the Free Software Foundation     *
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
18  ******************************************************************************/
19
20 if (!globals.contains("NscpPath")) {
21         NscpPath = dirname(msi_get_component_path("{5C45463A-4AE9-4325-96DB-6E239C034F93}"))
22 }
23
24 object CheckCommand "nscp-local" {
25         command = [ NscpPath + "\\nscp.exe", "client" ]
26
27         arguments = {
28                 "--log" = {
29                         value = "$nscp_log_level$"
30                         description = "The log level to use"
31                 }
32                 "--load-all" = {
33                         set_if ="$nscp_load_all$"
34                         description = "Load all plugins (currently only used with generate)"
35                 }
36                 "--module" = {
37                         value = "$nscp_modules$"
38                         description = "Specify which NSClient++ modules are required. 'nscp client' just needs 'CheckSystem' by default."
39                         repeat_key = true
40                 }
41                 "-q" = {
42                         value = "$nscp_query$"
43                         description = "Run a query with a given name"
44                         required = true
45                 }
46                 "-b" = {
47                         set_if = "$nscp_boot$"
48                         description = "Boot the client before executing command (similar as running the command from test mode)"
49                 }
50                 "-a" = {
51                         value = "$nscp_arguments$"
52                         repeat_key = true
53                         description = "List of arguments (arguments gets -- prefixed automatically (--argument foo=bar is the same as setting '--foo bar')"
54                 }
55                 "--show-all" = {
56                         set_if = "$nscp_showall$"
57                         description = ""
58                 }
59         }
60
61         vars.nscp_log_level = "critical"
62         vars.nscp_load_all = false
63         vars.nscp_boot = true
64         vars.nscp_showall = false
65         vars.nscp_modules = [ "CheckSystem" ]
66 }
67
68 object CheckCommand "nscp-local-cpu" {
69         import  "nscp-local"
70
71         arguments += {
72                 "--time" = {
73                         value = "$nscp_cpu_time$"
74                         repeat_key = true
75                         description = "The time to check"
76                 }
77                 "--warning" = {
78                         value = "load>$nscp_cpu_warning$"
79                 }
80                 "--critical" = {
81                         value = "load>$nscp_cpu_critical$"
82                 }
83                 "-a" = {
84                         value = "$nscp_cpu_arguments$"
85                         repeat_key = true
86                 }
87         }
88
89         vars.nscp_query = "check_cpu"
90         vars.nscp_showall = "$nscp_cpu_showall$"
91
92         vars.nscp_cpu_time = [ "1m", "5m", "15m" ]
93         vars.nscp_cpu_showall = true
94         vars.nscp_cpu_warning = 80
95         vars.nscp_cpu_critical = 90
96 }
97
98 object CheckCommand "nscp-local-memory" {
99         import  "nscp-local"
100
101         arguments += {
102                 "--type=committed" = {
103                         set_if = "$nscp_memory_committed$"
104                         description = "Total memory (RAM+PAGE)"
105                 }
106                 "--type=physical" = {
107                         set_if = "$nscp_memory_physical$"
108                         description = "Physical memory (RAM)"
109                 }
110                 "--warning" = {
111                         value = "$nscp_memory_op$ $nscp_memory_warning$"
112                 }
113                 "--critical" = {
114                         value = "$nscp_memory_op$ $nscp_memory_critical$"
115                 }
116                 "-a" = {
117                         value = "$nscp_memory_arguments$"
118                         repeat_key = true
119                 }
120         }
121
122         vars.nscp_query = "check_memory"
123         vars.nscp_showall = "$nscp_memory_showall$"
124
125         vars.nscp_memory_op = {{
126                 if (!macro("$nscp_memory_free$")) {
127                         return "used >"
128                 } else {
129                         return "free <"
130                 }
131         }}
132
133         vars.nscp_memory_committed = false
134         vars.nscp_memory_physical = true
135         vars.nscp_memory_free = true
136         vars.nscp_memory_warning = {{
137                 if (!macro("$nscp_memory_free$")) {
138                         return 80
139                 } else {
140                         return 20
141                 }
142         }}
143         vars.nscp_memory_critical = {{
144                 if (!macro("$nscp_memory_free$")) {
145                         return 90
146                 } else {
147                         return 10
148                 }
149         }}
150         vars.nscp_memory_showall = false
151 }
152
153 object CheckCommand "nscp-local-os-version" {
154         import  "nscp-local"
155
156         vars.nscp_query = "check_os_version"
157 }
158
159 object CheckCommand "nscp-local-pagefile" {
160         import  "nscp-local"
161
162         vars.nscp_query = "check_pagefile"
163 }
164
165 object CheckCommand "nscp-local-process" {
166         import  "nscp-local"
167
168         vars.nscp_query = "check_process"
169 }
170
171 object CheckCommand "nscp-local-service" {
172         import  "nscp-local"
173
174         arguments += {
175                 "--service" = {
176                         value = "$nscp_service_name$"
177                         repeat_key = true
178                 }
179                 "--ok" = {
180                         value = "$nscp_service_otype$='$nscp_service_ok$'"
181                 }
182                 "--warning" = {
183                         value = "$nscp_service_wtype$='$nscp_service_warning$'"
184                 }
185                 "--critical" = {
186                         value = "$nscp_service_ctype$='$nscp_service_critical$'"
187                 }
188                 "-a" = {
189                         value = "$nscp_service_arguments$"
190                         repeat_key = true
191                 }
192         }
193
194         vars.nscp_query = "check_service"
195         vars.nscp_showall = "$nscp_service_showall$"
196
197         vars.nscp_service_showall = true
198         vars.nscp_service_type = "state"
199         vars.nscp_service_otype = vars.nscp_service_type
200         vars.nscp_service_wtype = vars.nscp_service_type
201         vars.nscp_service_ctype = vars.nscp_service_type
202 }
203
204 object CheckCommand "nscp-local-uptime" {
205         import  "nscp-local"
206
207         vars.nscp_query = "check_uptime"
208 }
209
210 object CheckCommand "nscp-local-version" {
211         import  "nscp-local"
212
213         vars.nscp_query = "check_version"
214         vars.nscp_modules = [ "CheckHelpers" ]
215 }
216
217 object CheckCommand "nscp-local-disk" {
218         import "nscp-local"
219
220         arguments += {
221                 "--drive" = {
222                         value = "$nscp_disk_drive$"
223                         repeat_key = true
224                 }
225                 "--warning" = {
226                         value = "$nscp_disk_op$ $nscp_disk_warning$"
227                 }
228                 "--critical" = {
229                         value = "$nscp_disk_op$ $nscp_disk_critical$"
230                 }
231                 "-a" = {
232                         value = "$nscp_disk_arguments$"
233                         repeat_key = true
234                 }
235         }
236
237         vars.nscp_query = "check_drivesize"
238         vars.nscp_showall = "$nscp_disk_showall$"
239
240         vars.nscp_disk_op = {{
241                 if (!macro("$nscp_disk_free$")) {
242                         return "used >"
243                 } else {
244                         return "free <"
245                 }
246         }}
247
248         vars.nscp_disk_showall = true
249         vars.nscp_disk_free = false
250         vars.nscp_disk_warning = {{
251                 if (!macro("$nscp_disk_free$")) { return 80 } else { return 20 }
252         }}
253         vars.nscp_disk_critical = {{
254                 if (!macro("$nscp_disk_free$")) { return 90 } else { return 10 }
255         }}
256
257         vars.nscp_modules = [ "CheckDisk" ]
258 }
259
260 object CheckCommand "nscp-local-counter" {
261         import "nscp-local"
262
263         arguments += {
264                 "--counter" = {
265                         value = "$nscp_counter_name$"
266                         repeat_key = true
267                 }
268                 "--warning" = {
269                         value = "value $nscp_counter_op$ $nscp_counter_warning$"
270                 }
271                 "--critical" = {
272                         value = "value $nscp_counter_op$ $nscp_counter_critical$"
273                 }
274                 "--perf-syntax" = {
275                         value = "$nscp_counter_perfsyntax$"
276                 }
277                 "-a" = {
278                         value = "$nscp_counter_arguments$"
279                         repeat_key = true
280                 }
281         }
282
283         vars.nscp_counter_op = {{
284                 if (!macro("$nscp_counter_less$")) {
285                         return ">"
286                 } else {
287                         return "<"
288                 }
289         }}
290
291         vars.nscp_query = "check_pdh"
292         vars.nscp_showall = "$nscp_counter_showall$"
293         vars.nscp_counter_less = false
294         vars.nscp_counter_perfsyntax = "$nscp_counter_name$"
295 }