Memory check in LXC Containers reporting host values

**CMK version: 2.0.0.p19 **
**OS version: LXC: Ubuntu Server 20.04 / Host: Proxmox 7 (Debian 11) **

Hi,

we’ve got some Proxmox servers (Debian), which are running lxc containers. The CMK memory checks of the lxc containers are sometimes going CRIT, because apparently the page table size or size of committed memory is too high. Example:

CRIT - RAM used: 35.49 MB of 1 GB (3.5%), Page tables: 200.88 MB (19.6% of RAM, warn/crit at 8.0%/16.0%)**CRIT**, Committed: 104.69 GB (10468.6% of RAM + Swap, warn/crit at 100.0%/150.0%)**CRIT**

I found out that the memory check inside the container is reporting the same “page table” and “commited” values as the check on the Proxmox host itself. That’s also the case with cat /proc/meminfo |grep PageTables and cat /proc/meminfo |grep Committed_AS. So I’m not sure if this problem can even be properly “fixed” in any kind of way because I guess those values are reported by the kernel, which can’t really differentiate between the host and the container (?). And of course, this isn’t really a CMK problem but rather a LXC problem.

I was just wondering: is there any kind of best practice or tip on how to handle this? Because the memory checks of the containers are basically spamming our monitoring for no reason :slight_smile: But just ignoring / downtiming those checks or increasing the CRIT-threshold doesn’t seem like a good idea either.

Thanks for any kind of feedback!
Simon

Hi,

don’t know if this is the preferred way to do it … but we do it like this.

During install we automatically set a label in the file

/usr/lib/check_mk_agent/plugins/virtual_label

with the content

echo '<<<labels:sep(0)>>>'
echo '{"virtual": "<%= @virtual %>"}'

Now @virtual is a variable we get from foreman so this is included in our autoinstall setup.
Basically what it does is it replaces <%= @virtual %> with lxc resulting in

echo '<<<labels:sep(0)>>>'
echo '{"virtual": "lxc"}'

when deployed to the host.

This label will be discoverd during a new inventory of the host.
We then setup a rule like this.

As i said… not sure if this is the preferred way or “best practice” but that’s how we do it :slight_smile:

best regards

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.