This fixes the check_swap percentage calculation. When the pagefile is
turned off the available swap and total swap are 0 which leads to a
wrong calculation and misformated output.
refs #6913
This fixes the state conditions in check_memory and check_swap. This
turns the if/else if/else statements in simple if statements, since they
won't work properly when both thresholds are broken.
This also implements a new function to get a given state as wstring.
What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
The check_memory and check_swap plugins on Windows were incorrectly
rounding the memory/swap measurements to the nearest unit prior to
calculating a percentage. This was causing imprecise percentage
values when the unit selected meant that the values in question had
few significant figures.
fixes#10497
Signed-off-by: Jean Flach <jean-marcel.flach@netways.de>
Adds check_memory which works like check_swap which has been updated to work like check_memory
Both sport a -u(nit) option with MB as default, like their linux versions.
A possible bug with all plugins having the -u(nit) option when using -u kB has been fixed. Don't use icinga to monitor you commodore though.
refs #8287#8060
check_swap should now be faster and more accurate, it also checks against free space instead of taken swap.
The output and CMakeLists have been updated accordingly.
fixes#8287 refs #8060