From 25f2636a7707966d35d9e10996ead3bf4d51fde1 Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Mon, 2 Feb 2015 15:11:11 +0100 Subject: [PATCH] Fix check_swap returning wrong status without thresholds. --- plugins/check_swap.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/check_swap.cpp b/plugins/check_swap.cpp index d627e41f2..bc3a81b93 100644 --- a/plugins/check_swap.cpp +++ b/plugins/check_swap.cpp @@ -143,6 +143,7 @@ int parseArguments(int ac, wchar_t **av, po::variables_map& vm, printInfoStruct& cout << e.what() << endl; return 3; } + printInfo.warn.legal = !printInfo.warn.legal; } if (vm.count("critical")) { @@ -152,6 +153,7 @@ int parseArguments(int ac, wchar_t **av, po::variables_map& vm, printInfoStruct& cout << e.what() << endl; return 3; } + printInfo.crit.legal = !printInfo.crit.legal; } if (vm.count("debug")) @@ -168,10 +170,10 @@ int printOutput(printInfoStruct& printInfo) state state = OK; double fswap = (printInfo.aSwap / printInfo.tSwap) * 100.0; - if (!printInfo.warn.rend(printInfo.aSwap, printInfo.tSwap)) + if (printInfo.warn.rend(printInfo.aSwap, printInfo.tSwap)) state = WARNING; - if (!printInfo.crit.rend(printInfo.aSwap, printInfo.tSwap)) + if (printInfo.crit.rend(printInfo.aSwap, printInfo.tSwap)) state = CRITICAL; switch (state) { -- 2.40.0