API add_host unicode issue when disable Services

Hi all

checkmk Version 1.6.0.p8

I got the following issue, if i add a host via API. entry in hosts.mk has a prefix for unicode :
all_hosts += [u’hostviaapi.mydomain.test’]

while a host added via WATO does not:
all_hosts += [‘hostviawato.mydomain.test’]

Everything seems to work fine, even service discovery is possible, but as soon as i try to “disable” a service, the following issue occurs:

Unable to read current conditions of this rule. Falling back to default values. When saving this rule now, your previous settings will be overwritten. Problem was: Explicit hosts: The value must be of type str, but it has type unicode, Previous conditions:

{‘service_description’: [{’$regex’: u’Disk\ IO\ SUMMARY$’}], ‘host_folder’: ‘server/non-prod/linux’, ‘host_name’: [u’hostviaapi.mydomain.test’]}

If i remove the “u” in the hosts.mk it works as expected.

anyone also hit this issue ?

Kind Regards

Did you try add_host 2.2

https://checkmk.de/cms_web_api_references.html#add_host

Hi
Yes i did it with exactly like this, Host is added, everything is working,
but for some functions (like the disable Service) the error occurs
Kind regards

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.