Fix Beszel Agent Reporting Host RAM in LXC Containers

Agents on LXC containers show RAM usage of the Proxmox host instead of the container itself — it's reading /proc/meminfo and getting the host's numbers. Annoying, but fixable: point the Beszel agent at the container's cgroup memory stats.

Why this happens
Inside an LXC, /proc/meminfo is not virtualized by default. So any tool that reads it sees the host's total memory, not the container's limit. Beszel's agent does exactly that. It's not a Beszel bug per se — it's just how LXCs work — but it makes your dashboard useless for monitoring actual container usage.

The fix
You need to make the agent read from cgroup memory stats instead. Here's what to do:
- Mount the cgroup memory info into the container. On the Proxmox host, edit the container config (usually /etc/pve/lxc/<CTID>.conf) and add:
Restart the container after this.lxc.mount.entry: /sys/fs/cgroup/memory sys/fs/cgroup/memory none bind,optional,create=dir 0 0 - Configure the Beszel agent to use the cgroup file. In the agent's config (or environment variables), set the memory stat path to
/sys/fs/cgroup/memory/memory.stator/sys/fs/cgroup/memory.currentdepending on cgroup v1/v2. Check which one exists inside the container — if you seememory.stat, use that; if you seememory.current, use that. - Restart the agent and check the dashboard. It should now show the container's RAM usage.
If the agent doesn't have a config option for this, you can work around it by replacing /proc/meminfo with a script that reads cgroup data, but that's hacky. Better to switch to an agent that supports cgroup natively, or just use Proxmox's own metrics for LXC memory — it's already there and accurate.
My take
Honestly, this is a pain in the ass. You'd think monitoring tools would handle containers by now, but nope. If you're just checking RAM usage occasionally, skip the agent and look at the Proxmox summary page — it's right there. If you really need it in Beszel, the cgroup mount is the cleanest way. And if you're resizing containers often, you might want to check how to resize a Linux container in Proxmox so the limits match what you expect.