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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

schmidax
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants