From c393a3678fab50ef145cfe65c171ebc3b0d6312b Mon Sep 17 00:00:00 2001 From: Lennart Betz Date: Mon, 20 Jun 2016 17:35:43 +0200 Subject: [PATCH] ITL: Fix check commands nscp-local-disk and nscp-local-counter fixes #9264 Signed-off-by: Michael Friedrich --- itl/command-nscp-local.conf | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/itl/command-nscp-local.conf b/itl/command-nscp-local.conf index f38e3eb1a..405f111cd 100644 --- a/itl/command-nscp-local.conf +++ b/itl/command-nscp-local.conf @@ -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 } -- 2.40.0