Check_MK Discovery crash

CMK version: 2.3.0p23
OS version: RHEL9.5

I am currently using version 2.2.0p32 of CheckMK. The services on my servers (agent 2.2.0p32) are performing fine. I am testing version 2.3.0p23, and I notice that on these same servers, the Check_MK Discovery service is crashing :frowning_face: with exception TypeError (argument of type 'int' is not iterable')
Traceback :
File "/omd/sites/testsite/lib/python3/cmk/base/cee/keepalive/checker.py", line 224, in _process_fetch_entry checks_result = execute_check_discovery( File "/omd/sites/testsite/lib/python3/cmk/checkengine/discovery/_impl.py", line 104, in execute_check_discovery discovery_mode = DiscoverySettings.from_vs(params.rediscovery.get("mode")) File "/omd/sites/testsite/lib/python3/cmk/checkengine/discovery/_utils.py", line 59, in from_vs if "update_everything" in mode:

Local variables:
{'cls': <class 'cmk.checkengine.discovery._utils.DiscoverySettings'>, 'mode': 2}

Has anyone encountered this issue and found a way to resolve it?
Thank you

The problem comes from a Periodic Service discovery rule made by the API.
When the same rule is made with GUI, there is no pb.

Difference between the 2 files rules.mk
GUI :
'inventory_rediscovery': { 'mode': ('custom', {'add_new_services': True, 'remove_vanished_services': True, 'update_changed_service_labels': False, 'update_host_labels': True}), 'group_time': 900, ...

API:
'inventory_rediscovery': { 'mode': 2, 'group_time': 900, ...

Where am I wrong?

Can you share the code that you used to create the rule through the API?

Hello,
Thank you for your interest.
I’m using the API for Periodic service discovery rule creation.
Upon further investigation, I realized that the expected format for the API had changed.
2.2.0p32 version, I used this as input:
..., 'inventory_rediscovery': {'mode': 2, 'group_time': 900, 'excluded_time': [],....
With 2.3.0p23 version, I need to use:
..., 'inventory_rediscovery': {'mode': ('custom', {'add_new_services': True, 'remove_vanished_services': True, 'update_changed_service_labels': False, 'update_host_labels': True}), 'group_time': 900, 'excluded_time': [],....
No problems since I made this change.

2 Likes

ITS working , thanks for this solution post.