Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_used_mem

Current Version
0.93
Last Release Date
2014-10-31
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
License
GPL
Hits
22722
Files:
FileDescription
check_used_memcheck_used_mem
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
check_used_mem is a Nagios plugin for checking memory and swap usage on Linux and UNIX platforms.

Atention: It reports the USED memory, not the free memory. If you want to measure the free memory, you may want to take a look at another plugin I wrote, which is called check_free_mem
http://exchange.nagios.org/directory/Plugins/Network-and-Systems-Management/check_free_mem/details

It has separate thresholds (warning and critical) for RAM and swap usage.
It uses the output of "free" command and needs only grep and awk - no Perl, Python, PHP or SNMP.
The script makes all internal processing with float numbers, so the thresholds may be specified as float numbers, for an increased precision.

It reports the following performance data:
- used memory (as an absolute number and in percents)
- total memory
- free memory
- shared memory
- buffers
- cached memory
- used swap (as an absolute number and in percents)

Usage:
check_used_mem [-v] [-h] [-w MemWarning] [-c MemCritical] [-W SwapWarning] [-C SwapCritical]

Options:
--version|-v)
prints the program version
--help|-h)
prints this help information
-w)
specifies the warning threshold for memory usage
-c)
specifies the critical threshold for memory usage
-W)
specifies the warning threshold for swap usage
-C)
specifies the critical threshold for swap usage

Example:

# ./check_used_mem -w 90.5 -c 99.9 -W 1 -C 10

OK; Memory: total 996.8MB, used 274.1MB (27.5%), free 722.7MB (72.5%); Swap: total 1024.0MB, used 0B (0.0%), free 1024.0MB (100.0%) | 'used memory'=287461376B;945947586;1044200706;0;1045245952 'used memory (pct.)'=27.5%;90.5;99.9;0;100 'free memory'=757784576B;;;0;1045245952 'shared memory'=0B;;;0;1045245952 'buffers memory'=73318400B;;;0;1045245952 'cached memory'=122691584B;;;0;1045245952 'used swap'=0B;10737336;107373363;0;1073733632 'used swap (pct.)'=0.0%;1;10;0;100

=============
Oct. 31, 2014 What's new in version 0.93
- the path for binary executables is no more hard coded, which makes the script capable to run on virtually any Linux or UNIX system, without the need to edit it.
- the path for binary executables (grep, awk, free) can be overwritten in the parameters section, at the beginning of the script
- introduced a new function for bringing the size strings to humanly readable format (ex.: 1024 bytes=>1KB)
Reviews (1)
bykogepathic, September 15, 2014
1 of 1 people found this review helpful
This module needs a lot of work before it can be considered acceptable.

The author has hard-coded "/usr/bin/awk", "/bin/awk" and "awk" into multiple places in the script. I had to fix this before it would even run.

When you do get it running you'll find that the percentage warnings don't operate as expected. Instead of percentage free it's percentage used (eg. warn when percent used is over -w %) which is counter intuitive to almost every other nagios memory plugin.

Furthermore the plugin does not differentiate between used memory and used memory+- buffers/cache.

I do not recommend using this plugin until the author fixes the above points.
Owner's reply

@kogepathic:
This plugin IS INTENDED to measure the used memory, not the free memory - hence the name! So, it operates as expected, just not as you expected ;-) Read the description carefully before using stuff, mate!
Otherwise, you are perfectly right: the plugin needs work, it is not a final and stable version. I will upload a newer version soon.
Thank you for taking the time to write a review for my work, I really appreciate it!
Radu