2019-02-25 14:48:22 +01:00
|
|
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
2015-03-06 13:08:42 +01:00
|
|
|
|
|
|
|
if (!globals.contains("NscpPath")) {
|
2015-05-13 09:46:59 +02:00
|
|
|
NscpPath = dirname(msi_get_component_path("{5C45463A-4AE9-4325-96DB-6E239C034F93}"))
|
2015-03-06 13:08:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
object CheckCommand "nscp-local" {
|
2015-06-19 13:30:26 +02:00
|
|
|
command = [ NscpPath + "\\nscp.exe", "client" ]
|
2015-03-06 13:08:42 +01:00
|
|
|
|
|
|
|
arguments = {
|
2017-06-21 07:06:31 +02:00
|
|
|
"--log" = {
|
|
|
|
value = "$nscp_log_level$"
|
|
|
|
description = "The log level to use"
|
|
|
|
}
|
|
|
|
"--load-all" = {
|
|
|
|
set_if ="$nscp_load_all$"
|
|
|
|
description = "Load all plugins (currently only used with generate)"
|
|
|
|
}
|
2016-09-21 14:04:20 +02:00
|
|
|
"--module" = {
|
|
|
|
value = "$nscp_modules$"
|
|
|
|
description = "Specify which NSClient++ modules are required. 'nscp client' just needs 'CheckSystem' by default."
|
|
|
|
repeat_key = true
|
|
|
|
}
|
2015-03-06 13:08:42 +01:00
|
|
|
"-q" = {
|
|
|
|
value = "$nscp_query$"
|
2017-06-21 07:06:31 +02:00
|
|
|
description = "Run a query with a given name"
|
2015-03-06 13:08:42 +01:00
|
|
|
required = true
|
|
|
|
}
|
|
|
|
"-b" = {
|
|
|
|
set_if = "$nscp_boot$"
|
2017-06-21 07:06:31 +02:00
|
|
|
description = "Boot the client before executing command (similar as running the command from test mode)"
|
2015-03-06 13:08:42 +01:00
|
|
|
}
|
2015-08-24 10:22:40 +02:00
|
|
|
"-a" = {
|
|
|
|
value = "$nscp_arguments$"
|
2016-09-19 14:12:15 +02:00
|
|
|
repeat_key = true
|
2017-06-21 07:06:31 +02:00
|
|
|
description = "List of arguments (arguments gets -- prefixed automatically (--argument foo=bar is the same as setting '--foo bar')"
|
2015-08-24 10:22:40 +02:00
|
|
|
}
|
2015-09-21 10:30:45 +02:00
|
|
|
"--show-all" = {
|
|
|
|
set_if = "$nscp_showall$"
|
2017-06-21 07:06:31 +02:00
|
|
|
description = ""
|
2015-09-21 10:30:45 +02:00
|
|
|
}
|
2015-03-06 13:08:42 +01:00
|
|
|
}
|
|
|
|
|
2015-05-13 08:45:19 +02:00
|
|
|
vars.nscp_log_level = "critical"
|
2016-09-21 14:04:20 +02:00
|
|
|
vars.nscp_load_all = false
|
2015-03-06 13:08:42 +01:00
|
|
|
vars.nscp_boot = true
|
2015-09-21 10:30:45 +02:00
|
|
|
vars.nscp_showall = false
|
2016-09-21 14:04:20 +02:00
|
|
|
vars.nscp_modules = [ "CheckSystem" ]
|
2015-03-06 13:08:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
object CheckCommand "nscp-local-cpu" {
|
|
|
|
import "nscp-local"
|
|
|
|
|
2015-09-21 10:30:45 +02:00
|
|
|
arguments += {
|
|
|
|
"--time" = {
|
|
|
|
value = "$nscp_cpu_time$"
|
|
|
|
repeat_key = true
|
2017-06-21 07:06:31 +02:00
|
|
|
description = "The time to check"
|
2015-09-21 10:30:45 +02:00
|
|
|
}
|
|
|
|
"--warning" = {
|
|
|
|
value = "load>$nscp_cpu_warning$"
|
|
|
|
}
|
|
|
|
"--critical" = {
|
|
|
|
value = "load>$nscp_cpu_critical$"
|
|
|
|
}
|
|
|
|
"-a" = {
|
|
|
|
value = "$nscp_cpu_arguments$"
|
2016-09-19 14:12:15 +02:00
|
|
|
repeat_key = true
|
2015-09-21 10:30:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-06 13:08:42 +01:00
|
|
|
vars.nscp_query = "check_cpu"
|
2015-09-21 10:30:45 +02:00
|
|
|
vars.nscp_showall = "$nscp_cpu_showall$"
|
|
|
|
|
|
|
|
vars.nscp_cpu_time = [ "1m", "5m", "15m" ]
|
|
|
|
vars.nscp_cpu_showall = true
|
|
|
|
vars.nscp_cpu_warning = 80
|
|
|
|
vars.nscp_cpu_critical = 90
|
2015-03-06 13:08:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
object CheckCommand "nscp-local-memory" {
|
|
|
|
import "nscp-local"
|
|
|
|
|
2015-09-21 10:30:45 +02:00
|
|
|
arguments += {
|
|
|
|
"--type=committed" = {
|
|
|
|
set_if = "$nscp_memory_committed$"
|
2017-06-21 07:06:31 +02:00
|
|
|
description = "Total memory (RAM+PAGE)"
|
2015-09-21 10:30:45 +02:00
|
|
|
}
|
|
|
|
"--type=physical" = {
|
|
|
|
set_if = "$nscp_memory_physical$"
|
2017-06-21 07:06:31 +02:00
|
|
|
description = "Physical memory (RAM)"
|
2015-09-21 10:30:45 +02:00
|
|
|
}
|
|
|
|
"--warning" = {
|
|
|
|
value = "$nscp_memory_op$ $nscp_memory_warning$"
|
|
|
|
}
|
|
|
|
"--critical" = {
|
|
|
|
value = "$nscp_memory_op$ $nscp_memory_critical$"
|
|
|
|
}
|
|
|
|
"-a" = {
|
|
|
|
value = "$nscp_memory_arguments$"
|
2016-09-19 14:12:15 +02:00
|
|
|
repeat_key = true
|
2015-09-21 10:30:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-06 13:08:42 +01:00
|
|
|
vars.nscp_query = "check_memory"
|
2015-09-21 10:30:45 +02:00
|
|
|
vars.nscp_showall = "$nscp_memory_showall$"
|
|
|
|
|
|
|
|
vars.nscp_memory_op = {{
|
|
|
|
if (!macro("$nscp_memory_free$")) {
|
|
|
|
return "used >"
|
|
|
|
} else {
|
|
|
|
return "free <"
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
|
2016-09-19 14:12:15 +02:00
|
|
|
vars.nscp_memory_committed = false
|
2015-09-21 10:30:45 +02:00
|
|
|
vars.nscp_memory_physical = true
|
|
|
|
vars.nscp_memory_free = true
|
|
|
|
vars.nscp_memory_warning = {{
|
|
|
|
if (!macro("$nscp_memory_free$")) {
|
|
|
|
return 80
|
|
|
|
} else {
|
|
|
|
return 20
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
vars.nscp_memory_critical = {{
|
|
|
|
if (!macro("$nscp_memory_free$")) {
|
|
|
|
return 90
|
|
|
|
} else {
|
|
|
|
return 10
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
vars.nscp_memory_showall = false
|
2015-03-06 13:08:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
object CheckCommand "nscp-local-os-version" {
|
|
|
|
import "nscp-local"
|
|
|
|
|
|
|
|
vars.nscp_query = "check_os_version"
|
|
|
|
}
|
|
|
|
|
|
|
|
object CheckCommand "nscp-local-pagefile" {
|
|
|
|
import "nscp-local"
|
|
|
|
|
|
|
|
vars.nscp_query = "check_pagefile"
|
|
|
|
}
|
|
|
|
|
|
|
|
object CheckCommand "nscp-local-process" {
|
|
|
|
import "nscp-local"
|
|
|
|
|
|
|
|
vars.nscp_query = "check_process"
|
|
|
|
}
|
|
|
|
|
|
|
|
object CheckCommand "nscp-local-service" {
|
|
|
|
import "nscp-local"
|
|
|
|
|
2015-09-21 10:30:45 +02:00
|
|
|
arguments += {
|
|
|
|
"--service" = {
|
|
|
|
value = "$nscp_service_name$"
|
|
|
|
repeat_key = true
|
|
|
|
}
|
|
|
|
"--ok" = {
|
|
|
|
value = "$nscp_service_otype$='$nscp_service_ok$'"
|
|
|
|
}
|
|
|
|
"--warning" = {
|
|
|
|
value = "$nscp_service_wtype$='$nscp_service_warning$'"
|
|
|
|
}
|
|
|
|
"--critical" = {
|
|
|
|
value = "$nscp_service_ctype$='$nscp_service_critical$'"
|
|
|
|
}
|
|
|
|
"-a" = {
|
|
|
|
value = "$nscp_service_arguments$"
|
2016-09-19 14:12:15 +02:00
|
|
|
repeat_key = true
|
2015-09-21 10:30:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-06 13:08:42 +01:00
|
|
|
vars.nscp_query = "check_service"
|
2015-09-21 10:30:45 +02:00
|
|
|
vars.nscp_showall = "$nscp_service_showall$"
|
|
|
|
|
|
|
|
vars.nscp_service_showall = true
|
|
|
|
vars.nscp_service_type = "state"
|
|
|
|
vars.nscp_service_otype = vars.nscp_service_type
|
|
|
|
vars.nscp_service_wtype = vars.nscp_service_type
|
|
|
|
vars.nscp_service_ctype = vars.nscp_service_type
|
2015-03-06 13:08:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
object CheckCommand "nscp-local-uptime" {
|
|
|
|
import "nscp-local"
|
|
|
|
|
|
|
|
vars.nscp_query = "check_uptime"
|
|
|
|
}
|
|
|
|
|
|
|
|
object CheckCommand "nscp-local-version" {
|
|
|
|
import "nscp-local"
|
|
|
|
|
|
|
|
vars.nscp_query = "check_version"
|
2016-09-21 14:04:20 +02:00
|
|
|
vars.nscp_modules = [ "CheckHelpers" ]
|
2015-03-06 13:08:42 +01:00
|
|
|
}
|
2015-04-21 12:21:01 +02:00
|
|
|
|
|
|
|
object CheckCommand "nscp-local-disk" {
|
2015-04-22 21:58:22 +02:00
|
|
|
import "nscp-local"
|
2015-04-21 12:21:01 +02:00
|
|
|
|
2016-06-20 17:35:43 +02:00
|
|
|
arguments += {
|
|
|
|
"--drive" = {
|
|
|
|
value = "$nscp_disk_drive$"
|
|
|
|
repeat_key = true
|
|
|
|
}
|
2019-01-25 16:38:11 +01:00
|
|
|
"--exclude" = {
|
|
|
|
value = "$nscp_disk_exclude$"
|
|
|
|
repeat_key = true
|
|
|
|
}
|
2016-06-20 17:35:43 +02:00
|
|
|
"--warning" = {
|
|
|
|
value = "$nscp_disk_op$ $nscp_disk_warning$"
|
|
|
|
}
|
|
|
|
"--critical" = {
|
|
|
|
value = "$nscp_disk_op$ $nscp_disk_critical$"
|
|
|
|
}
|
|
|
|
"-a" = {
|
|
|
|
value = "$nscp_disk_arguments$"
|
2016-09-19 14:12:15 +02:00
|
|
|
repeat_key = true
|
2016-06-20 17:35:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-22 21:58:22 +02:00
|
|
|
vars.nscp_query = "check_drivesize"
|
2016-06-20 17:35:43 +02:00
|
|
|
vars.nscp_showall = "$nscp_disk_showall$"
|
|
|
|
|
|
|
|
vars.nscp_disk_op = {{
|
|
|
|
if (!macro("$nscp_disk_free$")) {
|
|
|
|
return "used >"
|
|
|
|
} else {
|
|
|
|
return "free <"
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
|
|
|
|
vars.nscp_disk_showall = true
|
|
|
|
vars.nscp_disk_free = false
|
|
|
|
vars.nscp_disk_warning = {{
|
|
|
|
if (!macro("$nscp_disk_free$")) { return 80 } else { return 20 }
|
|
|
|
}}
|
|
|
|
vars.nscp_disk_critical = {{
|
|
|
|
if (!macro("$nscp_disk_free$")) { return 90 } else { return 10 }
|
|
|
|
}}
|
2016-09-21 14:04:20 +02:00
|
|
|
|
|
|
|
vars.nscp_modules = [ "CheckDisk" ]
|
2015-04-21 12:21:01 +02:00
|
|
|
}
|
2015-08-24 10:36:18 +02:00
|
|
|
|
|
|
|
object CheckCommand "nscp-local-counter" {
|
|
|
|
import "nscp-local"
|
|
|
|
|
2016-06-20 17:35:43 +02:00
|
|
|
arguments += {
|
|
|
|
"--counter" = {
|
|
|
|
value = "$nscp_counter_name$"
|
|
|
|
repeat_key = true
|
|
|
|
}
|
|
|
|
"--warning" = {
|
|
|
|
value = "value $nscp_counter_op$ $nscp_counter_warning$"
|
|
|
|
}
|
|
|
|
"--critical" = {
|
|
|
|
value = "value $nscp_counter_op$ $nscp_counter_critical$"
|
|
|
|
}
|
2016-09-21 14:04:20 +02:00
|
|
|
"--perf-syntax" = {
|
|
|
|
value = "$nscp_counter_perfsyntax$"
|
2016-08-14 15:47:47 +02:00
|
|
|
}
|
2016-06-20 17:35:43 +02:00
|
|
|
"-a" = {
|
|
|
|
value = "$nscp_counter_arguments$"
|
2016-09-19 14:12:15 +02:00
|
|
|
repeat_key = true
|
2016-06-20 17:35:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vars.nscp_counter_op = {{
|
|
|
|
if (!macro("$nscp_counter_less$")) {
|
|
|
|
return ">"
|
|
|
|
} else {
|
|
|
|
return "<"
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
|
2015-08-24 10:36:18 +02:00
|
|
|
vars.nscp_query = "check_pdh"
|
2016-06-20 17:35:43 +02:00
|
|
|
vars.nscp_showall = "$nscp_counter_showall$"
|
|
|
|
vars.nscp_counter_less = false
|
2016-08-14 15:47:47 +02:00
|
|
|
vars.nscp_counter_perfsyntax = "$nscp_counter_name$"
|
2015-08-24 10:36:18 +02:00
|
|
|
}
|
2018-06-19 15:03:18 +02:00
|
|
|
|
|
|
|
object CheckCommand "nscp-local-tasksched" {
|
|
|
|
import "nscp-local"
|
|
|
|
|
|
|
|
arguments += {
|
|
|
|
"--filter" = {
|
|
|
|
set_if = {{
|
|
|
|
var scheduler_name = macro("$nscp_tasksched_name$")
|
|
|
|
if (len(scheduler_name) > 0 ) {
|
|
|
|
return true
|
|
|
|
} else {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
value = "title='$nscp_tasksched_name$'"
|
|
|
|
description = "Name of the task to check."
|
|
|
|
}
|
|
|
|
"--folder" = {
|
|
|
|
value = "$nscp_tasksched_folder$"
|
|
|
|
description = "The folder in which the tasks to check reside."
|
|
|
|
}
|
|
|
|
"--hidden" = {
|
|
|
|
set_if = "$nscp_tasksched_hidden$"
|
|
|
|
description = "Look for hidden tasks."
|
|
|
|
}
|
|
|
|
"--recursive" = {
|
|
|
|
value = "$nscp_tasksched_recursive$"
|
|
|
|
description = "Recurse sub folder (defaults to true)."
|
|
|
|
}
|
|
|
|
"--warning" = {
|
|
|
|
value = "$nscp_tasksched_warning$"
|
|
|
|
description = "Filter which marks items which generates a warning state."
|
|
|
|
}
|
|
|
|
"--critical" = {
|
|
|
|
value = "$nscp_tasksched_critical$"
|
|
|
|
description = "Filter which marks items which generates a critical state."
|
|
|
|
}
|
|
|
|
"--empty-state" = {
|
|
|
|
value = "$nscp_tasksched_emptystate$"
|
|
|
|
description = "Return status to use when nothing matched filter."
|
|
|
|
}
|
|
|
|
"--perf-syntax" = {
|
|
|
|
value = "$nscp_tasksched_perfsyntax$"
|
|
|
|
description = "Performance alias syntax."
|
|
|
|
}
|
|
|
|
"--detail-syntax" = {
|
|
|
|
value = "$nscp_tasksched_detailsyntax$"
|
|
|
|
description = "Detail level syntax."
|
|
|
|
}
|
|
|
|
"-a" = {
|
|
|
|
value = "$nscp_tasksched_arguments$"
|
|
|
|
repeat_key = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vars.nscp_modules = "CheckTaskSched"
|
|
|
|
vars.nscp_query = "check_tasksched"
|
|
|
|
vars.nscp_showall = "$nscp_tasksched_showall$"
|
|
|
|
vars.nscp_tasksched_recursive = true
|
|
|
|
vars.nscp_tasksched_perfsyntax = "%(title)"
|
|
|
|
vars.nscp_tasksched_detailsyntax = "%(folder)/%(title): %(exit_code) != 0"
|
|
|
|
vars.nscp_tasksched_warning = "exit_code != 0"
|
|
|
|
vars.nscp_tasksched_critical = "exit_code < 0"
|
|
|
|
|
|
|
|
}
|