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>
On a PC with >4GB of RAM, check_memory utility returns
an incorrect amount of RAM:
MEMORY OK - 100% free | memory=4096MB;;;0;4096
This patch uses GlobalMemoryStatusEx instead of GlobalMemoryStatus
[https://msdn.microsoft.com/en-us/library/windows/desktop/aa366586%28v=vs.85%29.aspx]
Following patch output of check_memory is as follows:
MEMORY OK - 32.4873% free | memory=5312MB;;;0;16351
fixes#8559
Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
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