I've seen in the code you are computing memory used from Total
mem_used = mem_total - (mem_free + mem_buffered + mem_cached + mem_slab_total);
and finally the total memory are not output written.
https://github.com/collectd/collectd/blob/master/src/memory.c#L351-L363
INHO when working with VM's and when you need %used and also the size it is important to have the total.
This calculation is really a kludge. On modern Systems you can use MemAvailable to get a better representation of "(mem_free + mem_buffered + mem_cached + mem_slab_total)"
[root@haproxy1-lb1 ~]# cat /proc/meminfo
MemTotal: 3883056 kB
MemFree: 2339100 kB
MemAvailable: 2648232 kB
...
Link to commit with explanation:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
TLDR extract:
"User space really should not be expected to know kernel internals to come up with an estimate for the amount of free memory. It is more convenient to provide such an estimate in /proc/meminfo. If things change in the future, we only have to change it in one place."
hi @dennisjac What I'm asking for is MemTotal of /proc/meminfo not available at the output plugin , this is "phisical / installed RAM".
I can not understand what are you referring in your last comment
@toni-moreno
I'm also looking for the total memory to make the graph complete.
Do you found any work around for this ?
Total memory info would be great
+1
This would be nice to have it.
+1
+1
I also need this feature: "memory" plugin reports "total amount of memory".
Is there any workaround? Or manual way?
+1
What about using aggregation plugin? It looks like it would be possible to get the total memory from a calculated sum from the rest of the values reported by memory
@rralleres No, the values reported by memory does not sum up to total.
Most helpful comment
hi @dennisjac What I'm asking for is MemTotal of /proc/meminfo not available at the output plugin , this is "phisical / installed RAM".
I can not understand what are you referring in your last comment