Modification for CentOS/RHEL 6.x Buffer and Cache

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!