Best way to setup netdata in a proxmox host with some lxc containers?

I have a physical debian box with proxmox and some lxc containers for nextclaud. iredmail , git and some Websites.
I isntalled netdata on all nodes and use the netdata cloud. All is fine so far.

But if there occurs for example a problem with one of the physical disks i get alarms from every lxc container.

I assume that I have to cofigure them all to suppress the helthchecks in which I am not interested or is ethe a better way ?`

Related or not : in netdata cloud all nodes, even the lxc containers show in thei ā€˜Node Informationā€™ ā€˜Bare Metalā€™ which is for the lxc containers wrong.

!!1601457448090-netdata-cloud.png

During the migration, I uncovered this little feedback gem @Manos_Saratsis. The LXC containers show as bare metal on the cloud.

Thanks, @OdysLam. I can think of a reason why this doesnā€™t work, but we are going to look at it.

The cloud uses the information that the agent provides regarding virtualization.

It would be useful to know what the agent returns in http://localhost:19999/api/v1/info response. In particular these fields:

	"virtualization": "hypervisor",
	"virt_detection": "/proc/cpuinfo",
	"container": "docker",
	"container_detection": "dockerenv",

(In my example it has detected)

The space name or agent claim id would be useful in the investigation as well.

Sorry for the very late response : here is the information from the inside of one of the lxc containers:

     "container_os_name": "none",
    "container_os_id": "none",
    "container_os_id_like": "none",
    "container_os_version": "none",
    "container_os_version_id": "none",
    "kernel_name": "Linux",
    "kernel_version": "5.4.73-1-pve",
    "architecture": "x86_64",
    "virtualization": "none",
    "virt_detection": "systemd-detect-virt",
    "container": "unknown",
    "container_detection": "none",

I upgraded netdata just now

ā€¦ but this is intersting :

# systemd-detect-virt
lxc

and lxc is indeed correct

Is the Netdata Cloud UI still showing the incorrect environment?

Yes it does. It still shows ā€˜bare metalā€™

Thanks @nklamann,

Pinging @Manos_Saratsis, senior PM here at Netdata so that he is aware of this. It could be a bug that we need to file in our GitHub repository:
Issues Ā· netdata/netdata-cloud Ā· GitHub

@nklamann fyi [BUG] Virtualisation/Containerisation technology wrongly shown on Nodes table Ā· Issue #34 Ā· netdata/netdata-cloud Ā· GitHub

This isnā€™t an issue with the cloud, but with the virtualization technology detection. The script netdata runs to get such info is usually under /usr/libexec/netdata/plugins.d/ and called system-info.sh. The command executed for the virtualization technology is systemd-detect-virt -v.

Can you please verify run that script or just the systemd-detect-virt -v command as the netdata user, to see if youā€™re getting any errors? I can only imagine some kind of access rights issue, given that the command does give you lxc without the -v argument, but please let us know what you see.

/netdata/plugins.d# ./system-info.sh
in a container
Gives
NETDATA_CONTAINER_OS_NAME=none
NETDATA_CONTAINER_OS_ID=none
NETDATA_CONTAINER_OS_ID_LIKE=none
NETDATA_CONTAINER_OS_VERSION=none
NETDATA_CONTAINER_OS_VERSION_ID=none
NETDATA_CONTAINER_OS_DETECTION=none
NETDATA_HOST_OS_NAME=Debian GNU/Linux
NETDATA_HOST_OS_ID=debian
NETDATA_HOST_OS_ID_LIKE=unknown
NETDATA_HOST_OS_VERSION=10 (buster)
NETDATA_HOST_OS_VERSION_ID=10
NETDATA_HOST_OS_DETECTION=/etc/os-release
NETDATA_SYSTEM_KERNEL_NAME=Linux
NETDATA_SYSTEM_KERNEL_VERSION=5.4.73-1-pve
NETDATA_SYSTEM_ARCHITECTURE=x86_64
NETDATA_SYSTEM_VIRTUALIZATION=none
NETDATA_SYSTEM_VIRT_DETECTION=systemd-detect-virt
NETDATA_SYSTEM_CONTAINER=unknown
NETDATA_SYSTEM_CONTAINER_DETECTION=none
NETDATA_SYSTEM_CPU_LOGICAL_CPU_COUNT=8
NETDATA_SYSTEM_CPU_VENDOR=GenuineIntel
NETDATA_SYSTEM_CPU_MODEL=Intel(R) Coreā„¢ i7-4770 CPU @ 3.40GHz
NETDATA_SYSTEM_CPU_FREQ=3900000000
NETDATA_SYSTEM_CPU_DETECTION=lscpu
NETDATA_SYSTEM_TOTAL_RAM=2147483648
NETDATA_SYSTEM_RAM_DETECTION=procfs
NETDATA_SYSTEM_TOTAL_DISK_SIZE=4000797868032
NETDATA_SYSTEM_DISK_DETECTION=sysfs

Consider

root@core1:.../netdata/plugins.d# systemd-detect-virt -v
none
1 root@core1:.../netdata/plugins.d# systemd-detect-virt
lxc

Wow, the only relevant thing I could find was this from the man page:

If multiple virtualization solutions are used, only the "innermost" is detected and identified. That means if both machine and container virtualization are used in conjunction, only the latter will be identified (unless
**--vm** is passed).

But even if you do have both machine and container virtualization, you still shouldnā€™t be getting ā€œnoneā€, right? Iā€™ve asked our experts to see if they have any insights on why this might happen and if we should remove the ā€œ-vā€ option, but if anyone else in the community has a clue, it would be great.

1 Like

I tried this and got :
root@core1:ā€¦/netdata/plugins.d# systemd-detect-virt --vm
none

-v is the same as -vm, so no surprise there :slightly_smiling_face:
I should be able to get an answer today from our inhouse Linux wizards. Removing the option is simple of course, but I donā€™t know enough to ensure it wonā€™t break other use cases.

Please run systemd-detect-virt -c and tell me if you see lxc there. I believe I found the bug.

I created Fix container detection from systemd-detect-virt by cakrit Ā· Pull Request #10569 Ā· netdata/netdata Ā· GitHub which should fix it, waiting for your feedback @nklamann so we can merge. It was really obvious once I looked at the code.

Weā€™re merging the fix.

1 Like

root@cloud:/usr/libexec/netdata# systemd-detect-virt -c
lxc

Pleas excuse the late reply and thanks a lot for your work

1 Like

Hi, thanks for the guide to everyone,
now my setup is working perfectly
setiabudi,best regards

A current install of Netdata on LXC containers in Proxmox VE is doing the same bug in this thread - reporting all my LXC containers as Bare Metal in Netdata Cloud.

Looking at the questions in this thread:

  • systemd-detect-virt -c And systemd-detect-virt report as LXC
  • systemd-detect-virt -v report as None

Any suggestions on how to have them show correctly as containers?