Home Directory Plugins Operating Systems Linux check physical memory

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 physical memory

Rating
4 votes
Favoured:
1
Hits
167918
Files:
FileDescription
check_mem.txtcheck_mem
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Check physical memory using shell script. Memory is displayed as a percentage.
Quick and easy to implement, does not require any additional packages.

Usage: check_mem [-w|--warning] [-c|--critical]


example:

check_mem -w 10 -c 5

Gives WARNING on 10% free phsical memory and CRITICAL on 5% free memory
Reviews (3)
I used Foncu method to get graph, but my graph is stuck on 3.96Kb, not able to get it to display proper values for the Memory Graph inside Nagios, what needs to change for it to display properly?
byfoncu, December 19, 2017
1 of 1 people found this review helpful
Good plugin, I added Perfdata for NagiosGraph replacing the final 3 IF by this code:

if [[ "$percent" -le $critical ]]; then
echo "CRITICAL - $free MB ($percent%) Free Memory | total=${total}MB used=${used}MB"
exit $STATE_CRITICAL
elif [[ "$percent" -le $warning ]]; then
echo "WARNING - $free MB ($percent%) Free Memory | total=${total}MB used=${used}MBÂș"
exit $STATE_WARNING
elif [[ "$percent" -gt $warning ]]; then
echo "OK - $free MB ($percent%) Free Memory | total=${total}MB used=${used}MB"
exit $STATE_OK
fi
byTasslehoff, March 16, 2012
1 of 1 people found this review helpful
Good plugin, on Windows I control paging and physical memory through scripts included into nscclient++, you script is a good way to do the same control on linux.

I made a couple of changes because I found more useful control busy memory without considering cache and buffers, so I changed used variable (lin 60) with this: used=`free -m | head -3 |tail -1 | gawk '{print $3}'`
I changed the free memory variable (line 62) with this: let free=$total-$used

Thanks again for plugin and for your time :)