Open evgeniy-pupkov opened 6 years ago
I find this problem too,Script memory_zabbix_master_item.sh must suit CentOS 6.X,Not CentOS 7.X.
MemUsage=`free | awk 'NR==2 {printf("%d %d %d %d",$2,$4,$6,$7)}'`
Cached=`echo $MemUsage | awk '{print $4}'`
On CentOS 7.x,Command free
seventh column is available
Hello! I'm receiving negative values for used memory item. It is related to '-w ' key for 'free' command in a script.
But running 'free' with no -w gives:
And so, $2-$4-$6-$7 gives negative value.
Running 'free' with -w gives values, that are good after arithmetics:
$2-$4-$6-$7 = 345320
I gonna remove this check in my setup and hardcode free -w, but it's kind a crutch. May be it's better to check 'free' version instead of release?