]> granicus.if.org Git - icinga2/commitdiff
ITL: Fix check commands nscp-local-disk and nscp-local-counter
authorLennart Betz <lennart.betz@netways.de>
Mon, 20 Jun 2016 15:35:43 +0000 (17:35 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Mon, 20 Jun 2016 15:46:34 +0000 (17:46 +0200)
fixes #9264

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
itl/command-nscp-local.conf

index f38e3eb1a3459b753974643a6b26d68d5b530c14..405f111cdcc4ce1e174897869fd97c019b2a9a5a 100644 (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
 }