Build precise queries to find exactly what you need
Press ESC to close
Hi,
Here is a modification for more accurate results on CentOS/RHEL 6.x. This changes the memUsed_m variable to use a custom calculation instead of just using the Used number from free -m.
This is similar to what the other reviewer did for 7.x systems. It uses the number from memTotal_m and then subtracts memFree_m, memBuffer_m, and memCache_m to come up with memUsed_m. You need to comment the original memUsed_m line then add a line after memCache_m as shown:
memTotal_m=`echo “$FreeM” |grep Mem |awk ‘{print $2}’`
# Comment This Line #memUsed_m=`echo “$FreeM” |grep Mem |awk ‘{print $3}’`
memFree_m=`echo “$FreeM” |grep Mem |awk ‘{print $4}’` memBuffer_m=`echo “$FreeM” |grep Mem |awk ‘{print $6}’` memCache_m=`echo “$FreeM” |grep Mem |awk ‘{print $7}’`
#Add the following line:
memUsed_m=$(($memTotal_m-$memFree_m-$memBuffer_m-$memCache_m))
memUsedPrc=`echo $((($memUsed_m*100)/$memTotal_m))||cut -d. -f1`
Thanks for the great plugin!
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!