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

check_mem_ng.sh

Rating
5 votes
Favoured:
3
Current Version
1.1
Last Release Date
2015-07-20
Compatible With
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
License
MIT
Hits
8865
Files:
FileDescription
check_mem_ng.shPlugin check_mem_ng.sh
LICENSELICENSE
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Compatible with Linux including RHEL 7+

This plugin is loosely inspired by check_mem v1.1 from Lukasz Gogolin
https://exchange.nagios.org/directory/Plugins/System-Metrics/Memory/check_mem-2Esh/details

I did a code rewrite and added a check of "free" version, because since procps-ng 3.3.0+ (RHEL 7+) check_mem.sh doesn't work anymore as it is (buff/cache column)

See Github or website for last version
check_mem_ng.sh 1.1

Usage:
* check_mem_ng.sh [-w ] [-c ] [-v] [-l]
- checks local host available memory
- warnlevel and critlevel is percentage value without %
- defaults being respectively 80 et 90
- add -v for verbose (debuging purpose)
- add -l for legacy perfdata mode (or change LEGACY_PERFDATA variable in script)
* check_mem_ng.sh -V
- prints version
* check_mem_ng.sh -h
- prints help (this message)

Similarities/differences between check_mem.sh:
- Both don't need much to run: only bash, free and awk
- Compatible with "free" binary from either procps AND procps-ng (newer) whereas check_mem.sh is not
- Same basic syntax, you can exchange both scripts without changing your Nagios(r) configuration much
- You can choose to keep perfdata identical to check_mem.sh OR display a modern graph with min/max bounds and warning/critical lines
- Added defaults to warn and critical, and help/version/verbose/legacy_perfdata flags

Output:
./check_mem_ng.sh
OK: Memory below thresholds. Total: 7984 MB - Used: 288 MB - 3% used. | Memory_Used=302661632;6698119987;7535384985;0;8372649984
./check_mem_ng.sh -w 70 -c 85
OK: Memory below thresholds. Total: 7984 MB - Used: 288 MB - 3% used. | Memory_Used=302796800;5860854988;7116752486;0;8372649984
./check_mem_ng.sh -w 70 -c 85 -l
OK: Memory below thresholds. Total: 7984 MB - Used: 289 MB - 3% used. | TOTAL=8372649984;;;; USED=303390720;;;; CACHE=7834243072;;;; BUFFER=613666816;;;;
Reviews (2)
byCharlesA, June 22, 2017
1 of 1 people found this review helpful
check_mem_ng.sh needs bc which is not installed by default on Debian

LEGACY_PERFDATA prints buffer and cache separately. I guess that is for backwards compatibility with check_mem.sh
byLijiman, June 16, 2016
1 of 1 people found this review helpful
I just today ran into the problem you noted about procps-ng and the buff/cache column and subsequently found this new version! Working great! Thank you!!