[icinga-checkins] icinga.org: icinga2/master: Add vars for all check_swap args

git at icinga.org git at icinga.org
Wed Aug 10 15:41:29 CEST 2016


Module: icinga2
Branch: master
Commit: 9517abba8406aa41409b5aafba83980d7f011a15
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=9517abba8406aa41409b5aafba83980d7f011a15

Author: Jean-Louis Dupond <jean-louis at dupond.be>
Date:   Tue Aug  9 16:59:01 2016 +0200

Add vars for all check_swap args

fixes #12392

Signed-off-by: Gunnar Beutner <gunnar.beutner at netways.de>

---

 itl/command-plugins.conf |   27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf
index 0c04133..676f9c9 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" {



More information about the icinga-checkins mailing list