Closed gomusan closed 2 years ago
Hi, I guess that it is happening because shared memory can be calculated by various methods. This script does not pretends on accuracy. I wrote it as simple workaround, unfortunately I don't use zabbix anymore 😀
Unfortunately I can't give you more exact answer, but I think you can find some information here https://www.linuxatemyram.com/
Understood ! To my mind there is no reason to add available and buff/cache then, retriving plain available value should be enough. It looks goo on my servers so I will propose a patch for this. Thanks.
This is right.
Also Why does the used memory include shared tmpfs? Since shared memory isn't part of the total reported, pused isn't right either. I use this:
total=$ 2; used=$ 3; pused=($ 3*100/$ 2); free=$ 4; pfree=($ 4*100/$ 2); shared=$ 5; buffers=$ 6; cached=$ 6; available=$ 7; pavailable=($ 7*100/$ 2);
Hello I wonder why you calculate available memory as buff/cache + available. In the UserParameter I see : "available=($ 6+$ 7)" In my case, it gives weird results on a container with lots of free RAM: free -b total used free shared buff/cache available Mem: 17179869184 897617920 14450495488 1719324672 1831755776 16282251264 Swap: 4294963200 0 4294963200
Thus available is 16282251264 + 1831755776 = 18114007040 which is higher than 17179869184 (total)
Thanks for your answer.