Check_MK exception: Unable to apply new hosttag configuration


#1

Welcome back :slight_smile:

I have now a complex problem. I added all my host tags with a python script via API and every thing was working as expected. After I switched to HTTPS I wanted to add a new host tag, so I adjusted the url variable to point to the CNAME, unfortunately I keep get the error message:

200 {'result': 'Check_MK exception: Missing required key(s): aux_tags, tag_groups', 'result_code': 1}

which is not the case, It is the same code I used to apply the tags successfully at the first place and I added some more afterwords, but to be more sure I printed the json data just before the python post requests and the supposed missing required keys are there. I thought it is not possible to make API requests through HTTPS, therefor I reset the apache configuration to the default without HTTPS and with the FQDN as ServerName and disabled the 443 vhosts.

After running the script, this time thing are getting more weird, I get a very confusing error message:

200 {'result': 'Check_MK exception: Unable to apply new hosttag configuration. The following tags are still in use, but not mentioned in the updated configuration: 
tag1/None, tag2/None, tag3/None, tag4/None, etc....., 'result_code': 1}

The tags (tag1, tag2, etc…) are my added tags with the API at the first run and those I added successfully afterwords, these tags are there weather on WATO or in the hosttags.mk file.

So I made backup my hosttags.mk file and deleted it from ~$site/etc/check_mk/multisite.d/wato/hosttags.mk and tried to add the tags with the python an API requests and with curl as the ducumentation is saying, unfortunately I keep getting either the two errors above depending weather I am trying to add them over HTTPS or HTTP.

This script should add VM’s automatically to check_mk via API as a Ganeti hook when we deploy new VM’s, and it should manage adding new tags as well. And I used it to add all the hosts we have now (~1700 hosts) located in .mkfiles, which is the old way we are using.

I would like really to know whats is going on here and avoid redeploying the complete environment.
And is it possible to make API requests over HTTPS?

EDIT
I remember that I added one host tag over WATO web interface and deleted it afterwords, it was a test . Could it be the reason for this behavior?

I hope some one can help

Thanks


#2

I found the cause of the problem. One of my colleges added some clusters directly by hand and edited one of the hosts.mk files, that has the effect, that all host tags were set to those clusters, where the nodes which belong to the cluster had only some tags set.
I had to delete all the clusters and them via WATO, the way it should have been done at the first place.

Thanks