Nagios Plugin to check memory consumption
For some reason the Nagios package in Debian / Ubuntu does not provide a plugin to check the memory consumption so I built a simple script to do that. It ignores swap space (since if your machine starts swapping you’re lost anyway) and caches (it’s nice to have memory available for caches but this isn’t really required). That way only the real memory consumption is checked and if that passes a certain threshold you can rest assured that you’re in for trouble.
Get the file here: check_memory (it’s got an .txt ending due to WordPress restrictions; rename to .sh or just remove the ending altogether).
The default warning and critical thresholds are triggered when more than 90% / 95% of the memory are in use. You can change these thresholds by passing in the well known -w and -c arguments.
The plugin was developed in cooperation with FINDOLOGIC GmbH.
Tweet
[…] el uso real de memoria por las aplicaciones y no las caches de disco. Me he encontrado con un plugin de Georg M. Sorst que lo hace, pero no reportaba bien el estado, asi que lo he modificado un poco y aqui lo dejo: […]
Hello,
just to make a small correction on your script, the test to know if the value is greater than the warning one will never return a good value leading to a warning as $STATE_WARN doesn’t exist in /usr/lib/nagios/plugins/utils.sh, it should be $STATE_WARNING.
Otherwise the script is perfectly working 🙂
Thanks a lot
Pierre-Alain,
thanks, I never get this one right 🙂