From: Jean-Louis Dupond Date: Tue, 9 Aug 2016 14:59:01 +0000 (+0200) Subject: Add vars for all check_swap args X-Git-Tag: v2.5.0~97 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9517abba8406aa41409b5aafba83980d7f011a15;p=icinga2 Add vars for all check_swap args fixes #12392 Signed-off-by: Gunnar Beutner --- diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 0c0413355..676f9c9fc 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -1256,12 +1256,31 @@ object CheckCommand "swap" { command = [ PluginDir + "/check_swap" ] arguments = { - "-w" = "$swap_wfree$%" - "-c" = "$swap_cfree$%" + "-w" = {{ + if (macro("$swap_integer$")) { + return macro("$swap_wfree$") + } else { + return macro("$swap_wfree$%") + } + }} + "-c" = {{ + if (macro("$swap_integer$")) { + return macro("$swap_cfree$") + } else { + return macro("$swap_cfree$%") + } + }} + "-a" = { + set_if = "$swap_allswaps$" + } + "-n" = "$swap_noswap$" } - vars.swap_wfree = 50 - vars.swap_cfree = 25 + vars.swap_wfree = "50%" + vars.swap_cfree = "25%" + vars.swap_integer = false + vars.swap_allswaps = false + vars.swap_noswap = "critical" } object CheckCommand "load" {