Netdata installed in LXC retrieves statistics from bare-metal

Problem/Question

After installing the netdata agent in the LXC container, the software does not collect statistics from the system in LXC but collects statistics from the entire bare-meta server. The software installed on the server is Proxmox 7.2-7, Ubuntu 20.04 is installed in the LXC container. The problem is very similar to this description..

Configuration files are default, no changes have been made. I would like your help as I want to monitor my LXC containers.

Environment/Browser/Agent’s version etc

http://192.168.100.132:19999/api/v1/info

{
	"version": "v1.35.1",
	"uid": "bd2732cc-125c-11ed-90d6-bb82168db5e1",
	"mirrored_hosts": [
		"netdata-test"
	],
	"mirrored_hosts_status": [
		{ "guid": "bd2732cc-125c-11ed-90d6-bb82168db5e1", "hostname": "netdata-test", "reachable": true, "hops": 0, "claim_id": null, "node_id": null }
	],
	"alarms": {
		"normal": 78,
		"warning": 0,
		"critical": 0
	},
	"os_name": "Ubuntu",
	"os_id": "ubuntu",
	"os_id_like": "debian",
	"os_version": "20.04.4 LTS (Focal Fossa)",
	"os_version_id": "20.04",
	"os_detection": "/etc/os-release",
	"cores_total": "16",
	"total_disk_space": "3925996470272",
	"cpu_freq": "2394000000",
	"ram_total": "1073741824",
	"container_os_name": "none",
	"container_os_id": "none",
	"container_os_id_like": "none",
	"container_os_version": "none",
	"container_os_version_id": "none",
	"container_os_detection": "none",
	"is_k8s_node": "false",
	"kernel_name": "Linux",
	"kernel_version": "5.15.39-2-pve",
	"architecture": "x86_64",
	"virtualization": "none",
	"virt_detection": "systemd-detect-virt",
	"container": "unknown",
	"container_detection": "systemd-detect-virt",
	"cloud_provider_type": "unknown",
	"cloud_instance_type": "unknown",
	"cloud_instance_region": "unknown",
	"host_labels": {
		"_is_parent": "false",
		"_aclk_ng_new_cloud_protocol": "true",
		"_aclk_proxy": "none",
		"_aclk_impl": "Next Generation",
		"_mqtt_version": "3",
		"_aclk_legacy_available": "false",
		"_aclk_ng_available": "true",
		"_prebuilt_dist": " ",
		"_prebuilt_arch": "x86_64",
		"_install_type": "binpkg-deb",
		"_is_k8s_node": "false",
		"_virt_detection": "systemd-detect-virt",
		"_container_detection": "systemd-detect-virt",
		"_container": "unknown",
		"_virtualization": "none",
		"_architecture": "x86_64",
		"_system_disk_space": "3925996470272",
		"_system_ram_total": "1073741824",
		"_system_cpu_freq": "2394000000",
		"_system_cores": "16",
		"_kernel_version": "5.15.39-2-pve",
		"_os_version": "20.04.4 LTS (Focal Fossa)",
		"_os_name": "Ubuntu",
		"_cloud_instance_region": "unknown",
		"_cloud_instance_type": "unknown",
		"_cloud_provider_type": "unknown"
	},
	"collectors": [
		{
			"plugin": "proc.plugin",
			"module": "/proc/net/snmp"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/diskstats"
		},
		{
			"plugin": "cgroups.plugin",
			"module": "systemd"
		},
		{
			"plugin": "netdata",
			"module": "stats"
		},
		{
			"plugin": "python.d.plugin",
			"module": "postfix"
		},
		{
			"plugin": "timex.plugin",
			"module": ""
		},
		{
			"plugin": "python.d.plugin",
			"module": "sensors"
		},
		{
			"plugin": "proc.plugin",
			"module": "ipc"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/spl/kstat/zfs"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/spl/kstat/zfs/arcstats"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/net/stat/nf_conntrack"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/net/softnet_stat"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/net/snmp6"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/net/netstat"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/net/sockstat6"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/net/sockstat"
		},
		{
			"plugin": "proc.plugin",
			"module": "/sys/devices/system/node"
		},
		{
			"plugin": "proc.plugin",
			"module": "/sys/kernel/mm/ksm"
		},
		{
			"plugin": "apps.plugin",
			"module": ""
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/meminfo"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/vmstat"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/softirqs"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/interrupts"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/pressure"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/sys/kernel/random/entropy_avail"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/loadavg"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/uptime"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/stat"
		},
		{
			"plugin": "proc.plugin",
			"module": "/proc/net/dev"
		},
		{
			"plugin": "diskspace.plugin",
			"module": ""
		},
		{
			"plugin": "nfacct.plugin",
			"module": ""
		},
		{
			"plugin": "tc.plugin",
			"module": ""
		},
		{
			"plugin": "statsd.plugin",
			"module": "stats"
		},
		{
			"plugin": "idlejitter.plugin",
			"module": ""
		}
	],
	"cloud-enabled": true,
	"cloud-available": true,
	"aclk-ng-available": true,
	"aclk-ng-new-cloud-protocol": true,
	"aclk-legacy-available": false,
	"aclk-implementation": "Next Generation",
	"agent-claimed": false,
	"aclk-available": false,
	"aclk-available-protocol": null,
	"memory-mode": "dbengine",
	"multidb-disk-quota": 256,
	"page-cache-size": 32,
	"stream-enabled": false,
	"stream-compression": true,
	"hosts-available": null,
	"https-enabled": true,
	"buildinfo": "dbengine|Native HTTPS|Netdata Cloud|ACLK Next Generation|New Cloud Protocol Support|TLS Host Verification|Machine Learning|Stream Compression|protobuf|JSON-C|libcrypto|libm|zlib|apps|cgroup Network Tracking|CUPS|EBPF|IPMI|NFACCT|perf|slabinfo|Prometheus Remote Write",
	"release-channel": "stable",
	"web-enabled": true,
	"notification-methods": null,
	"exporting-enabled": null,
	"exporting-connectors": null,
	"allmetrics-prometheus-used": null,
	"allmetrics-shell-used": null,
	"allmetrics-json-used": null,
	"dashboard-used": 1,
	"charts-count": null,
	"metrics-count": null,
	"ml-info": {
		"enabled": false
}
}

Could you be more specific? I installed Ubuntu and Netdata in a container on Proxmox. The stats I see are related to the container, not the host.

I agree about the virtualization detection though:

	"virtualization": "vmware",
	"virt_detection": "systemd-detect-virt",

Could you be more specific?

What do you want him to specify yet? There is a physical server with proxmox installed, there is an Ubuntu LXC container on it, there is netdata installed in ubuntu showing statistics not from the container but from the physical server. For example, a container has 1 GB of RAM and netdata shows 64 GB, this is what the physical server has.

I agree about the virtualization detection though

For me, the variables you provide look like this:

"virt_detection": "systemd-detect-virt",
	"container": "unknown",

Netdata collects system metrics reading /proc/*. RAM metrics come from /proc/meminfo:

  • free is MemFree.
  • cached is Cached + SReclaimable - Shmem.
  • used is MemTotal - MemFree - MemCached - Buffers.

You can check the values yourself, e.g. grep MemFree /proc/meminfo from inside the container.

Source code link.