[BUG] Cgroup monitoring doesn't support RHEL-9
- Dominant language
- Python
- Stars
- 581
- Forks
- 397
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 9
Description
**Describe the bug: A clear and concise description of what the bug is.**
In RHEL-9, the logs collector cannot be enabled because cgroup monitoring cannot be enabled. It seems there're 2 reasons:
1. Cgroup monitoring is not supported on ['rhel', '9.1', 'Plow', 'Red Hat Enterprise Linux']. The distro_name is 'rhel' but not 'redhat' so that cannot match the condition in the following function:
```
class CGroupsApi(object):
...
return ((distro_name.lower() == 'ubuntu' and distro_version.major >= 16) or
(**distro_name.lower() in ("centos", "redhat")** and
((distro_version.major == 7 and distro_version.minor >= 8) or distro_version.major >= 8)))
```
2. In RHEL-9 it uses cgroup2. And WALA failed to find cpu and memory path.
```
2022-06-20T10:02:13.301737Z INFO ExtHandler ExtHandler [CGW] The CPU cgroup controller is not mounted
2022-06-20T10:02:13.304658Z INFO ExtHandler ExtHandler [CGW] The memory cgroup controller is not mounted
2022-06-20T10:02:13.309621Z INFO ExtHandler ExtHandler [CGI] cgroups v2 mounted at /sys/fs/cgroup. Controllers: [cpuset cpu io memory hugetlb pids rdma misc
]
2022-06-20T10:02:13.310793Z INFO ExtHandler ExtHandler [CGW] The agent's process is not within a CPU cgroup
2022-06-20T10:02:13.311341Z INFO ExtHandler ExtHandler [CGW] The agent's process is not within a memory cgroup
2022-06-20T10:02:13.311828Z INFO ExtHandler ExtHandler [CGI] Agent cgroups enabled: False
```
**Distro and WALinuxAgent details (please complete the following information):**
- Distro and Version: RHEL-9.1
- WALinuxAgent version:
WALinuxAgent-2.7.0.6 running on rhel 9.1
Python: 3.9.10
Goal state agent: 2.7.0.6
Contributor guide
Assessment
This issue has not been assessed yet.