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.
| Print article | This entry was posted by georg on April 15, 2010 at 11:38 pm, and is filed under admin. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about 6 months ago
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
about 5 months ago
Pierre-Alain,
thanks, I never get this one right