Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for problem that files like bonding_masters are not skipped #733

Closed
wants to merge 1 commit into from

Conversation

schmidax
Copy link
Contributor

General information

This pull request fixes the problem that the script lnx_container_host_if.linux does not ignore possible files like bonding_masters as expected but generates empty values that are sent to the check_mk server which causes the plugin to crash:

Error message:
ValueError (not enough values to unpack (expected 2, got 1))

Traceback:

File "/omd/sites/nms_k8s/lib/python3/cmk/base/agent_based/data_provider.py", line 106, in _parse_raw_data
    return parse_function(list(raw_data))
  File "/omd/sites/nms_k8s/lib/python3/cmk/base/plugins/agent_based/section_lnx_container_host_if.py", line 138, in parse_lnx_container_host_if
    return [_create_interface(_parse_raw_stats(i)) for i in string_table], {}
  File "/omd/sites/nms_k8s/lib/python3/cmk/base/plugins/agent_based/section_lnx_container_host_if.py", line 138, in <listcomp>
    return [_create_interface(_parse_raw_stats(i)) for i in string_table], {}
  File "/omd/sites/nms_k8s/lib/python3/cmk/base/plugins/agent_based/section_lnx_container_host_if.py", line 47, in _parse_raw_stats
    k, v = stats.split("\v")

Bug reports

Read following Post:
Network monitoring using Kubernetes Agent fails due to network bonding

Proposed changes

Now the bash script checks first whether the path is a folder or a file and then checks whether the folder is empty or not.

CheckmkCI pushed a commit that referenced this pull request Nov 13, 2024
Change-Id: I8732752afe894adb393d62ae8237a64671751632
Closes: #733
Co-Authored-By: Moritz Kiemer <[email protected]>
@CheckmkCI CheckmkCI closed this in 9215d9b Nov 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants