Linux

Linux Ram & Swap memory

Description:

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

Compatible With

  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
  • Nagios Fusion

License

GPL


Project Files
Project Notes
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.
Reviews (1) Add a Review
Looks good to consolidate the RAM and SWAP
by mohanpn, October 31, 2018

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



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
4 (1)
Favorites
0
Views
42,028