ITL: Add more parameters for nscp-local check commands

nscp-local-cpu, -memory, -disk, -service and -counter

fixes #9264

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
This commit is contained in:
Lennart Betz 2015-09-21 10:30:45 +02:00 committed by Michael Friedrich
parent ff0c44d435
commit 765e91dcaf
2 changed files with 147 additions and 5 deletions

View File

@ -1391,18 +1391,33 @@ nscp_load_all | **Optional.** Whether to load all modules. Defaults to true.
nscp_boot | **Optional.** Whether to use the --boot option. Defaults to true. nscp_boot | **Optional.** Whether to use the --boot option. Defaults to true.
nscp_query | **Required.** The NSClient++ query. Try `nscp client -q x` for a list. nscp_query | **Required.** The NSClient++ query. Try `nscp client -q x` for a list.
nscp_arguments | **Optional.** An array of query arguments. nscp_arguments | **Optional.** An array of query arguments.
nscp_showall | **Optional.** Shows more details in plugin output, default to false.
### <a id="nscp-check-local-cpu"></a> nscp-local-cpu ### <a id="nscp-check-local-cpu"></a> nscp-local-cpu
Check command object for the `check_cpu` NSClient++ plugin. Check command object for the `check_cpu` NSClient++ plugin.
This command has the same custom attributes like the `nscp-local` check command. Name | Description
--------------------|------------------
nscp_cpu_time | **Optional.** Calculate avarage usage for the given time intervals. Value has to be an array, default to [ "1m", "5m", "15m" ].
nscp_cpu_warning | **Optional.** Threshold for WARNING state in percent, default to 80.
nscp_cpu_critical | **Optional.** Threshold for CRITICAL state in percent, default to 90.
nscp_cpu_arguments | **Optional.** Additional arguments.
nscp_cpu_showall | **Optional.** Shows more details in plugin output, default to false.
### <a id="nscp-check-local-memory"></a> nscp-local-memory ### <a id="nscp-check-local-memory"></a> nscp-local-memory
Check command object for the `check_memory` NSClient++ plugin. Check command object for the `check_memory` NSClient++ plugin.
This command has the same custom attributes like the `nscp-local` check command. Name | Description
----------------------|------------------
nscp_memory_committed | **Optional.** Check for committed memory, default to false.
nscp_memory_physical | **Optional.** Check for physical memory, default to true.
nscp_memory_free | **Optional.** Switch between checking free (true) or used memory (false), default to false.
nscp_memory_warning | **Optional.** Threshold for WARNING state in percent or absolut (use MB, GB, ...), default to 80 (free=false) or 20 (free=true).
nscp_memory_critical | **Optional.** Threshold for CRITICAL state in percent or absolut (use MB, GB, ...), default to 90 (free=false) or 10 (free=true).
nscp_memory_arguments | **Optional.** Additional arguments.
nscp_memory_showall | **Optional.** Shows more details in plugin output, default to false.
### <a id="nscp-check-local-os-version"></a> nscp-local-os-version ### <a id="nscp-check-local-os-version"></a> nscp-local-os-version
@ -1426,7 +1441,18 @@ This command has the same custom attributes like the `nscp-local` check command.
Check command object for the `check_service` NSClient++ plugin. Check command object for the `check_service` NSClient++ plugin.
This command has the same custom attributes like the `nscp-local` check command. Name | Description
-----------------------|------------------
nscp_service_name | **Required.** Name of service to check.
nscp_service_type | **Optional.** Type to check, default to state.
nscp_service_ok | **Optional.** State for return an OK, i.e. for type=state running, stopped, ...
nscp_service_otype | **Optional.** Dedicate type for nscp_service_ok, default to nscp_service_state.
nscp_service_warning | **Optional.** State for return an WARNING.
nscp_service_wtype | **Optional.** Dedicate type for nscp_service_warning, default to nscp_service_state.
nscp_service_critical | **Optional.** State for return an CRITICAL.
nscp_service_ctype | **Optional.** Dedicate type for nscp_service_critical, default to nscp_service_state.
nscp_service_arguments | **Optional.** Additional arguments.
nscp_service_showall | **Optional.** Shows more details in plugin output, default to true.
### <a id="nscp-check-local-uptime"></a> nscp-local-uptime ### <a id="nscp-check-local-uptime"></a> nscp-local-uptime
@ -1444,13 +1470,26 @@ This command has the same custom attributes like the `nscp-local` check command.
Check command object for the `check_drivesize` NSClient++ plugin. Check command object for the `check_drivesize` NSClient++ plugin.
This command has the same custom attributes like the `nscp-local` check command. Name | Description
-----------------------|------------------
nscp_disk_drive | **Optional.** Drive character, default to all drives.
nscp_disk_free | **Optional.** Switch between checking free space (free=true) or used space (free=false), default to false.
nscp_disk_warning | **Optional.** Threshold for WARNING in percent or absolut (use MB, GB, ...), default to 80 (used) or 20 percent (free).
nscp_disk_critical | **Optional.** Threshold for CRITICAL in percent or absolut (use MB, GB, ...), default to 90 (used) or 10 percent (free).
nscp_disk_arguments | **Optional.** Additional arguments.
nscp_disk_showall | **Optional.** Shows more details in plugin output, default to true.
### <a id="nscp-check-local-counter"></a> nscp-local-counter ### <a id="nscp-check-local-counter"></a> nscp-local-counter
Check command object for the `check_pdh` NSClient++ plugin. Check command object for the `check_pdh` NSClient++ plugin.
This command has the same custom attributes like the `nscp-local` check command. Name | Description
-----------------------|------------------
nscp_counter_name | **Required.** Performance counter name.
nscp_counter_warning | **Optional.** WARNING Threshold.
nscp_counter_critical | **Optional.** CRITICAL Threshold.
nscp_counter_arguments | **Optional.** Additional arguments.
nscp_counter_showall | **Optional.** Shows more details in plugin output, default to false.

View File

@ -21,6 +21,7 @@ if (!globals.contains("NscpPath")) {
NscpPath = dirname(msi_get_component_path("{5C45463A-4AE9-4325-96DB-6E239C034F93}")) NscpPath = dirname(msi_get_component_path("{5C45463A-4AE9-4325-96DB-6E239C034F93}"))
} }
object CheckCommand "nscp-local" { object CheckCommand "nscp-local" {
import "plugin-check-command" import "plugin-check-command"
@ -40,23 +41,98 @@ object CheckCommand "nscp-local" {
value = "$nscp_arguments$" value = "$nscp_arguments$"
skip_key = true skip_key = true
} }
"--show-all" = {
set_if = "$nscp_showall$"
}
} }
vars.nscp_log_level = "critical" vars.nscp_log_level = "critical"
vars.nscp_load_all = true vars.nscp_load_all = true
vars.nscp_boot = true vars.nscp_boot = true
vars.nscp_showall = false
} }
object CheckCommand "nscp-local-cpu" { object CheckCommand "nscp-local-cpu" {
import "nscp-local" 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_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" { object CheckCommand "nscp-local-memory" {
import "nscp-local" 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_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" { object CheckCommand "nscp-local-os-version" {
@ -80,7 +156,34 @@ object CheckCommand "nscp-local-process" {
object CheckCommand "nscp-local-service" { object CheckCommand "nscp-local-service" {
import "nscp-local" 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_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" { object CheckCommand "nscp-local-uptime" {