mirror of https://github.com/Icinga/icinga2.git
Merge pull request #6940 from Icinga/bugfix/fix-check-swap-6913
Fix check_swap percentage calculation
This commit is contained in:
commit
501d807956
|
@ -229,7 +229,10 @@ static int check_swap(printInfoStruct& printInfo)
|
||||||
printInfo.aSwap += round(pageFiles.at(i).availableSpwap / pow(1024.0, printInfo.unit));
|
printInfo.aSwap += round(pageFiles.at(i).availableSpwap / pow(1024.0, printInfo.unit));
|
||||||
}
|
}
|
||||||
|
|
||||||
printInfo.percentFree = 100.0 * printInfo.aSwap / printInfo.tSwap;
|
if (printInfo.aSwap > 0 && printInfo.tSwap > 0)
|
||||||
|
printInfo.percentFree = 100.0 * printInfo.aSwap / printInfo.tSwap;
|
||||||
|
else
|
||||||
|
printInfo.percentFree = 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue