ITL: Fix check commands nscp-local-disk and nscp-local-counter

fixes #9264

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
This commit is contained in:
Lennart Betz 2016-06-20 17:35:43 +02:00 committed by Michael Friedrich
parent 409a385590
commit c393a3678f
1 changed files with 62 additions and 0 deletions

View File

@ -201,11 +201,73 @@ object CheckCommand "nscp-local-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$"
}
"-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
}