icinga2/itl/command-nscp-local.conf

276 lines
6.4 KiB
Plaintext

/******************************************************************************
* Icinga 2 *
* Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software Foundation *
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/
if (!globals.contains("NscpPath")) {
NscpPath = dirname(msi_get_component_path("{5C45463A-4AE9-4325-96DB-6E239C034F93}"))
}
object CheckCommand "nscp-local" {
command = [ NscpPath + "\\nscp.exe", "client" ]
arguments = {
"--log" = "$nscp_log_level$"
"--load-all" = { set_if ="$nscp_load_all$" }
"-q" = {
value = "$nscp_query$"
required = true
}
"-b" = {
set_if = "$nscp_boot$"
}
"-a" = {
value = "$nscp_arguments$"
skip_key = true
}
"--show-all" = {
set_if = "$nscp_showall$"
}
}
vars.nscp_log_level = "critical"
vars.nscp_load_all = true
vars.nscp_boot = true
vars.nscp_showall = false
}
object CheckCommand "nscp-local-cpu" {
import "nscp-local"
arguments += {
"--time" = {
value = "$nscp_cpu_time$"
repeat_key = true
}
"--warning" = {
value = "load>$nscp_cpu_warning$"
}
"--critical" = {
value = "load>$nscp_cpu_critical$"
}
"-a" = {
value = "$nscp_cpu_arguments$"
skip_key = true
}
}
vars.nscp_query = "check_cpu"
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
}
object CheckCommand "nscp-local-memory" {
import "nscp-local"
arguments += {
"--type=committed" = {
set_if = "$nscp_memory_committed$"
}
"--type=physical" = {
set_if = "$nscp_memory_physical$"
}
"--warning" = {
value = "$nscp_memory_op$ $nscp_memory_warning$"
}
"--critical" = {
value = "$nscp_memory_op$ $nscp_memory_critical$"
}
"-a" = {
value = "$nscp_memory_arguments$"
skip_key = true
}
}
vars.nscp_query = "check_memory"
vars.nscp_showall = "$nscp_memory_showall$"
vars.nscp_memory_op = {{
if (!macro("$nscp_memory_free$")) {
return "used >"
} else {
return "free <"
}
}}
vars.nscp_memory_commited = false
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
}
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"
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$"
skip_key = true
}
}
vars.nscp_query = "check_service"
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
}
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"
}
object CheckCommand "nscp-local-disk" {
import "nscp-local"
arguments += {
"--drive" = {
value = "$nscp_disk_drive$"
repeat_key = true
}
"--warning" = {
value = "$nscp_disk_op$ $nscp_disk_warning$"
}
"--critical" = {
value = "$nscp_disk_op$ $nscp_disk_critical$"
}
"-a" = {
value = "$nscp_disk_arguments$"
skip_key = true
}
}
vars.nscp_query = "check_drivesize"
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 }
}}
}
object CheckCommand "nscp-local-counter" {
import "nscp-local"
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$"
}
"perf-syntax" = {
value = "perf-syntax=$nscp_counter_perfsyntax$"
skip_key = true
}
"-a" = {
value = "$nscp_counter_arguments$"
skip_key = true
}
}
vars.nscp_counter_op = {{
if (!macro("$nscp_counter_less$")) {
return ">"
} else {
return "<"
}
}}
vars.nscp_query = "check_pdh"
vars.nscp_showall = "$nscp_counter_showall$"
vars.nscp_counter_less = false
vars.nscp_counter_perfsyntax = "$nscp_counter_name$"
}