pmp-check-unix-memory results to empty memory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Monitoring Plugins |
Fix Released
|
High
|
Unassigned |
Bug Description
In version procps-ng 3.3.10, the format has been changed and has removed the "+ buffers/cache" section which is considered wrong to base free memory calculation which includes non-freeable page cache. See https:/
Using the command below:
[root@localhost plugins]# /usr/lib64/
OK Memory % used | memory_
This is because the format has been changed from 3.3.10 which shows an example below:
total used free shared buff/cache available
Mem: 144887 6892 137542 8 453 137656
Swap: 4095 0 4095
having the "available" column as explained below:
available
So I added this workaround:
95 get_used_
96 if [[ $( free -V|awk -F '.' '{print $NF}') -lt 10 ]]; then
97 awk '/Mem:/ {total = $2;}
98 /cache:/ {printf "%d\n", $3 / total * 100}' "$1"
99 else
100 # Better to use memavailable. See
101 # https:/
102 awk '/Mem:/{total=$2; printf "%d\n", $7 / total * 100}' "$1"
103 fi
104
[root@qddbs86 plugins]# /usr/lib64/
OK Memory 74% used | memory_
Changed in percona-monitoring-plugins: | |
status: | Fix Committed → Fix Released |
Thanks Paul, I will check this out.