1 /******************************************************************************
3 * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
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. *
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. *
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 ******************************************************************************/
20 if (!globals.contains("NscpPath")) {
21 NscpPath = dirname(msi_get_component_path("{5C45463A-4AE9-4325-96DB-6E239C034F93}"))
24 object CheckCommand "nscp-local" {
25 command = [ NscpPath + "\\nscp.exe", "client" ]
29 value = "$nscp_log_level$"
30 description = "The log level to use"
33 set_if ="$nscp_load_all$"
34 description = "Load all plugins (currently only used with generate)"
37 value = "$nscp_modules$"
38 description = "Specify which NSClient++ modules are required. 'nscp client' just needs 'CheckSystem' by default."
42 value = "$nscp_query$"
43 description = "Run a query with a given name"
47 set_if = "$nscp_boot$"
48 description = "Boot the client before executing command (similar as running the command from test mode)"
51 value = "$nscp_arguments$"
53 description = "List of arguments (arguments gets -- prefixed automatically (--argument foo=bar is the same as setting '--foo bar')"
56 set_if = "$nscp_showall$"
61 vars.nscp_log_level = "critical"
62 vars.nscp_load_all = false
64 vars.nscp_showall = false
65 vars.nscp_modules = [ "CheckSystem" ]
68 object CheckCommand "nscp-local-cpu" {
73 value = "$nscp_cpu_time$"
75 description = "The time to check"
78 value = "load>$nscp_cpu_warning$"
81 value = "load>$nscp_cpu_critical$"
84 value = "$nscp_cpu_arguments$"
89 vars.nscp_query = "check_cpu"
90 vars.nscp_showall = "$nscp_cpu_showall$"
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
98 object CheckCommand "nscp-local-memory" {
102 "--type=committed" = {
103 set_if = "$nscp_memory_committed$"
104 description = "Total memory (RAM+PAGE)"
106 "--type=physical" = {
107 set_if = "$nscp_memory_physical$"
108 description = "Physical memory (RAM)"
111 value = "$nscp_memory_op$ $nscp_memory_warning$"
114 value = "$nscp_memory_op$ $nscp_memory_critical$"
117 value = "$nscp_memory_arguments$"
122 vars.nscp_query = "check_memory"
123 vars.nscp_showall = "$nscp_memory_showall$"
125 vars.nscp_memory_op = {{
126 if (!macro("$nscp_memory_free$")) {
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$")) {
143 vars.nscp_memory_critical = {{
144 if (!macro("$nscp_memory_free$")) {
150 vars.nscp_memory_showall = false
153 object CheckCommand "nscp-local-os-version" {
156 vars.nscp_query = "check_os_version"
159 object CheckCommand "nscp-local-pagefile" {
162 vars.nscp_query = "check_pagefile"
165 object CheckCommand "nscp-local-process" {
168 vars.nscp_query = "check_process"
171 object CheckCommand "nscp-local-service" {
176 value = "$nscp_service_name$"
180 value = "$nscp_service_otype$='$nscp_service_ok$'"
183 value = "$nscp_service_wtype$='$nscp_service_warning$'"
186 value = "$nscp_service_ctype$='$nscp_service_critical$'"
189 value = "$nscp_service_arguments$"
194 vars.nscp_query = "check_service"
195 vars.nscp_showall = "$nscp_service_showall$"
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
204 object CheckCommand "nscp-local-uptime" {
207 vars.nscp_query = "check_uptime"
210 object CheckCommand "nscp-local-version" {
213 vars.nscp_query = "check_version"
214 vars.nscp_modules = [ "CheckHelpers" ]
217 object CheckCommand "nscp-local-disk" {
222 value = "$nscp_disk_drive$"
226 value = "$nscp_disk_op$ $nscp_disk_warning$"
229 value = "$nscp_disk_op$ $nscp_disk_critical$"
232 value = "$nscp_disk_arguments$"
237 vars.nscp_query = "check_drivesize"
238 vars.nscp_showall = "$nscp_disk_showall$"
240 vars.nscp_disk_op = {{
241 if (!macro("$nscp_disk_free$")) {
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 }
253 vars.nscp_disk_critical = {{
254 if (!macro("$nscp_disk_free$")) { return 90 } else { return 10 }
257 vars.nscp_modules = [ "CheckDisk" ]
260 object CheckCommand "nscp-local-counter" {
265 value = "$nscp_counter_name$"
269 value = "value $nscp_counter_op$ $nscp_counter_warning$"
272 value = "value $nscp_counter_op$ $nscp_counter_critical$"
275 value = "$nscp_counter_perfsyntax$"
278 value = "$nscp_counter_arguments$"
283 vars.nscp_counter_op = {{
284 if (!macro("$nscp_counter_less$")) {
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$"