Fix check_swap returning wrong status without thresholds.

This commit is contained in:
Jean Flach 2015-02-02 15:11:11 +01:00
parent 0e7b8d16e2
commit 25f2636a77
1 changed files with 4 additions and 2 deletions

View File

@ -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) {