]> granicus.if.org Git - icinga2/blob - itl/command-nscp-local.conf
ITL: Add perfsyntax parameter to nscp-local-counter CheckCommand
[icinga2] / itl / command-nscp-local.conf
1 /******************************************************************************
2  * Icinga 2                                                                   *
3  * Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/)  *
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
25 object CheckCommand "nscp-local" {
26         import  "plugin-check-command"
27
28         command = [ NscpPath + "\\nscp.exe", "client" ]
29
30         arguments = {
31                 "--log" = "$nscp_log_level$"
32                 "--load-all" = { set_if ="$nscp_load_all$" }
33                 "-q" = {
34                         value = "$nscp_query$"
35                         required = true
36                 }
37                 "-b" = {
38                         set_if = "$nscp_boot$"
39                 }
40                 "-a" = {
41                         value = "$nscp_arguments$"
42                         skip_key = true
43                 }
44                 "--show-all" = {
45                         set_if = "$nscp_showall$"
46                 }
47
48         }
49
50         vars.nscp_log_level = "critical"
51         vars.nscp_load_all = true
52         vars.nscp_boot = true
53         vars.nscp_showall = false
54 }
55
56 object CheckCommand "nscp-local-cpu" {
57         import  "nscp-local"
58
59         arguments += {
60                 "--time" = {
61                         value = "$nscp_cpu_time$"
62                         repeat_key = true
63                 }
64                 "--warning" = {
65                         value = "load>$nscp_cpu_warning$"
66                 }
67                 "--critical" = {
68                         value = "load>$nscp_cpu_critical$"
69                 }
70                 "-a" = {
71                         value = "$nscp_cpu_arguments$"
72                         skip_key = true
73                 }
74         }
75
76         vars.nscp_query = "check_cpu"
77         vars.nscp_showall = "$nscp_cpu_showall$"
78
79         vars.nscp_cpu_time = [ "1m", "5m", "15m" ]
80         vars.nscp_cpu_showall = true
81         vars.nscp_cpu_warning = 80
82         vars.nscp_cpu_critical = 90
83 }
84
85 object CheckCommand "nscp-local-memory" {
86         import  "nscp-local"
87
88         arguments += {
89                 "--type=committed" = {
90                         set_if = "$nscp_memory_committed$"
91                 }
92                 "--type=physical" = {
93                         set_if = "$nscp_memory_physical$"
94                 }
95                 "--warning" = {
96                         value = "$nscp_memory_op$ $nscp_memory_warning$"
97                 }
98                 "--critical" = {
99                         value = "$nscp_memory_op$ $nscp_memory_critical$"
100                 }
101                 "-a" = {
102                         value = "$nscp_memory_arguments$"
103                         skip_key = true
104                 }
105         }
106
107         vars.nscp_query = "check_memory"
108         vars.nscp_showall = "$nscp_memory_showall$"
109
110         vars.nscp_memory_op = {{
111                 if (!macro("$nscp_memory_free$")) {
112                         return "used >"
113                 } else {
114                         return "free <"
115                 }
116         }}
117
118         vars.nscp_memory_commited = false
119         vars.nscp_memory_physical = true
120         vars.nscp_memory_free = true
121         vars.nscp_memory_warning = {{
122                 if (!macro("$nscp_memory_free$")) {
123                         return 80
124                 } else {
125                         return 20
126                 }
127         }}
128         vars.nscp_memory_critical = {{
129                 if (!macro("$nscp_memory_free$")) {
130                         return 90
131                 } else {
132                         return 10
133                 }
134         }}
135         vars.nscp_memory_showall = false
136 }
137
138 object CheckCommand "nscp-local-os-version" {
139         import  "nscp-local"
140
141         vars.nscp_query = "check_os_version"
142 }
143
144 object CheckCommand "nscp-local-pagefile" {
145         import  "nscp-local"
146
147         vars.nscp_query = "check_pagefile"
148 }
149
150 object CheckCommand "nscp-local-process" {
151         import  "nscp-local"
152
153         vars.nscp_query = "check_process"
154 }
155
156 object CheckCommand "nscp-local-service" {
157         import  "nscp-local"
158
159         arguments += {
160                 "--service" = {
161                         value = "$nscp_service_name$"
162                         repeat_key = true
163                 }
164                 "--ok" = {
165                         value = "$nscp_service_otype$='$nscp_service_ok$'"
166                 }
167                 "--warning" = {
168                         value = "$nscp_service_wtype$='$nscp_service_warning$'"
169                 }
170                 "--critical" = {
171                         value = "$nscp_service_ctype$='$nscp_service_critical$'"
172                 }
173                 "-a" = {
174                         value = "$nscp_service_arguments$"
175                         skip_key = true
176                 }
177         }
178
179         vars.nscp_query = "check_service"
180         vars.nscp_showall = "$nscp_service_showall$"
181
182         vars.nscp_service_showall = true
183         vars.nscp_service_type = "state"
184         vars.nscp_service_otype = vars.nscp_service_type
185         vars.nscp_service_wtype = vars.nscp_service_type
186         vars.nscp_service_ctype = vars.nscp_service_type
187 }
188
189 object CheckCommand "nscp-local-uptime" {
190         import  "nscp-local"
191
192         vars.nscp_query = "check_uptime"
193 }
194
195 object CheckCommand "nscp-local-version" {
196         import  "nscp-local"
197
198         vars.nscp_query = "check_version"
199 }
200
201 object CheckCommand "nscp-local-disk" {
202         import "nscp-local"
203
204         arguments += {
205                 "--drive" = {
206                         value = "$nscp_disk_drive$"
207                         repeat_key = true
208                 }
209                 "--warning" = {
210                         value = "$nscp_disk_op$ $nscp_disk_warning$"
211                 }
212                 "--critical" = {
213                         value = "$nscp_disk_op$ $nscp_disk_critical$"
214                 }
215                 "-a" = {
216                         value = "$nscp_disk_arguments$"
217                         skip_key = true
218                 }
219         }
220
221         vars.nscp_query = "check_drivesize"
222         vars.nscp_showall = "$nscp_disk_showall$"
223
224         vars.nscp_disk_op = {{
225                 if (!macro("$nscp_disk_free$")) {
226                         return "used >"
227                 } else {
228                         return "free <"
229                 }
230         }}
231
232         vars.nscp_disk_showall = true
233         vars.nscp_disk_free = false
234         vars.nscp_disk_warning = {{
235                 if (!macro("$nscp_disk_free$")) { return 80 } else { return 20 }
236         }}
237         vars.nscp_disk_critical = {{
238                 if (!macro("$nscp_disk_free$")) { return 90 } else { return 10 }
239         }}
240 }
241
242 object CheckCommand "nscp-local-counter" {
243         import "nscp-local"
244
245         arguments += {
246                 "--counter" = {
247                         value = "$nscp_counter_name$"
248                         repeat_key = true
249                 }
250                 "--warning" = {
251                         value = "value $nscp_counter_op$ $nscp_counter_warning$"
252                 }
253                 "--critical" = {
254                         value = "value $nscp_counter_op$ $nscp_counter_critical$"
255                 }
256                 "perf-syntax" = {
257                         value = "perf-syntax=$nscp_counter_perfsyntax$"
258                         skip_key = true
259                 }
260                 "-a" = {
261                         value = "$nscp_counter_arguments$"
262                         skip_key = true
263                 }
264         }
265
266         vars.nscp_counter_op = {{
267                 if (!macro("$nscp_counter_less$")) {
268                         return ">"
269                 } else {
270                         return "<"
271                 }
272         }}
273
274         vars.nscp_query = "check_pdh"
275         vars.nscp_showall = "$nscp_counter_showall$"
276         vars.nscp_counter_less = false
277         vars.nscp_counter_perfsyntax = "$nscp_counter_name$"
278 }