Check_mk-interfaces no perfdata

Hello,

after updating to Version 2.0 we don’t got performance metrics on some SNMP-hosts. The ouput of the check looks like this:

Operational state: up
MAC: 38:21:C7:BB:BE:92
Speed: 1 GBit/s
In: 0.00 B/s (0%)
Out: 0.00 B/s (0%)
Errors in: 0%
Multicast in: 0 packets/s
Broadcast in: 0 packets/s
Unicast in: 0 packets/s
Non-unicast in: 0 packets/s
Discards in: 0 packets/s
Errors out: 0%
Multicast out: 0 packets/s
Broadcast out: 0 packets/s
Unicast out: 0 packets/s
Non-unicast out: 0 packets/s
Discards out: 0 packets/s


During update I got the following failure updating the configuration:
Initializing application…
Loading GUI plugins…
Traceback (most recent call last):
File “/omd/sites/monitoring/lib/python3/cmk/base/config.py”, line 1986, in _extract_agent_and_snmp_sections
create_snmp_section_plugin_from_legacy(
File “/omd/sites/monitoring/lib/python3/cmk/base/api/agent_based/register/section_plugins_legacy/init.py”, line 235, in create_snmp_section_plugin_from_legacy
detect_spec = create_detect_spec(
File “/omd/sites/monitoring/lib/python3/cmk/base/api/agent_based/register/section_plugins_legacy/convert_scan_functions.py”, line 397, in create_detect_spec
_compute_detect_spec(
File “/omd/sites/monitoring/lib/python3/cmk/base/api/agent_based/register/section_plugins_legacy/convert_scan_functions.py”, line 373, in _compute_detect_spec
return _ast_convert_dispatcher(expression_ast)
File “/omd/sites/monitoring/lib/python3/cmk/base/api/agent_based/register/section_plugins_legacy/convert_scan_functions.py”, line 323, in _ast_convert_dispatcher
return _ast_convert_compare(arg)
File “/omd/sites/monitoring/lib/python3/cmk/base/api/agent_based/register/section_plugins_legacy/convert_scan_functions.py”, line 222, in _ast_convert_compare
assert isinstance(comp_ast.comparators[0], ast.Str)
AssertionError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/omd/sites/monitoring/bin/cmk-update-config”, line 12, in
sys.exit(main(sys.argv[1:]))
File “/omd/sites/monitoring/lib/python3/cmk/update_config.py”, line 936, in main
UpdateConfig(logger, arguments).run()
File “/omd/sites/monitoring/lib/python3/cmk/update_config.py”, line 135, in run
self._initialize_base_environment()
File “/omd/sites/monitoring/lib/python3/cmk/update_config.py”, line 178, in _initialize_base_environment
cmk.base.config.load_all_agent_based_plugins(cmk.base.check_api.get_check_api_context)
File “/omd/sites/monitoring/lib/python3/cmk/base/config.py”, line 1415, in load_all_agent_based_plugins
errors.extend(load_checks(get_check_api_context, filelist))
File “/omd/sites/monitoring/lib/python3/cmk/base/config.py”, line 1563, in load_checks
errors = (_extract_agent_and_snmp_sections(validate_creation_kwargs=did_compile) +
File “/omd/sites/monitoring/lib/python3/cmk/base/config.py”, line 2005, in _extract_agent_and_snmp_sections
raise MKGeneralException(exc) from exc

Is the preormance data missing because of the error during update?

We have the same problem with multiple devices with SNMP query with a new installation of Checkmk V. 2.0

What type of check do you see if you go to the service configuration.
Is ist “if64” or “interface”?

we use “interface” check

We are using the check interfaces too.

How can I switch to the if64 plugin?

I think it depends on the settings for the interface discovery. I had no time to investigate the differences between these two versions.

anyone else have an idea what we can change?

Hi, how SNMP is configured in checkmk? If you using V1, no if64 will used. You need to check with V2C instead of V1. Please try that.

Cheers,
Christian

When I switch the Sophos XG to SNMPv2 or v3, checkmk no longer reads any services at all.
With SNMPV1 it detected the interfaces, CPU, Memory etc…
What am I doing wrong?

In the connection test the following data is read out, bot shows no services.

sysDescr: Linux localhost 4.14.38 #2 SMP Sun Dec 6 01:19:34 UTC 2020 x86_64
sysContact: Company
sysName: SG1
sysLocation: Location 1

When i do a cmk --snmpwalk and look at he data, everything is ok, but looks like that counters are not work. I think we need a bug report here.

Cheers,
Christian

@ChristianM Can you open a ticket please, so that we can investigate this issue.

Hi Fabian,
My guess would be that you have some local change, and are running into one of the issues described here: Auto migration of check plugins to new section definitions
What’s the output of cmk -R?

1 Like

We solved it with changing the check type to if64 instead of interfaces. There was an old rule enforcing SNMP V1 in our configuration.

I saw the same problem as @SebastianSimon with the new interface check - no values and i cannot remember if it was also an SNMPv1 problem.

I found another bug today that could lead to this problem. I suggest waiting for the upcoming patch release and then re-assessing the problem. I expect it to disappear with the fix I am working on.
Unfortunately, the bug is quite fundamental, and I can’t think of a (practical) workaround.
The impractical workaround is: Run cmk -vvn --plugins interfaces <HOST> and cmk -vvI --plugins interfaces <HOST>, compare the reported sections 2 lines after the line Source: SourceType.HOST/FetcherType.SNMP, and set up a WATO Host rule to disable all interface sections that are listed in the former call, but not in the latter (e.g. if_lancom).

1 Like

Thanks @moritz for the information. If i have “some time” i can also take a look at the problem in my systems.

is the bug in 2.0.0p1 fixed?

I didn’t make it into p1, sorry :frowning:
It will be merged today, Werk 12359.

2 Likes

Hello,

any update when this fix would be ready for download?

BR Gerald