Memory

check_mem_ng.sh

Description:

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

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


Project Files
Project Photos
Project Notes
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) Add a Review
Needs bc
by CharlesA, June 30, 2017

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



Thank you!
by Lijiman, June 30, 2016

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!!



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
5 (5)
Favorites
3
Views
14,504