Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
Your review has been submitted and is pending approval.
Simple shell script that checks for Ram (- buffers/cache) and Swap memory at the same time comparing them with the specified thresholds.
Current Version
1.0.1
Last Release Date
2013-06-01
Owner
Vittorio Memmo
Website
http://www.exinlab.com
Download URL
http://www.exinlab.it/Downloads/Nagios_Exchange/check_memory.sh
License
GPL
Compatible With
This simple but useful plugin is a bash shell script that collects information about the free and used Ram and Swap memory on a Linux box and calculates the relative (percent) values for each. It then compares the two percent values with the two thresholds specified as parameters alerting with a "Warning" state if at least one of the values exceeds the related threshold or with a "Critical" state if both the values exceed them. The relative values for free and used Ram memory are calculated on the base of the memory actaully used by the system itself and by the applications i.e. without the portion of Ram dedicated to the disk I/O blocks (buffers) and to page cache (cache) or shorthly, without the portion of Ram that the system can purge and flush in response of memory pressure. The script makes use of 'bc' , that extends the bash shell capabilities to a full floating point/arbitrary precision calculator. Note: bc normally requires Glibc,ncurses-libs,readline.
Thank you for such a simple script that can make the life easy. Just observed that at times one may face ZERO DIVIDE error (in case SWAP is ZERO). So added minor check in the script to get over that error. if [ $ram_tot -eq 0 ] then ram_tot=1 fi if [ $swap_tot -eq 0 ] then swap_tot=1 fi
You must be logged in to submit a review.
To:
From: