Add hosts/services to host/service groups via Check_MK HTTP API

This is the reason why i said - please use a language binding like the Python API from GitHub - brennerm/check-mk-web-api: Python library to talk to the Check_Mk Web API

If you want to use PHP there is also something available GitHub - i-doit/checkmk-web-api-client-php: Easy-to-use, but feature-rich client library for Check_MK's Web API (set_ruleset is missing there at the moment)

What you get back from the get_ruleet is nothing else than a Python dictionary.
You can modify or search the dictionary for conditions and add your own entries. At the end you use the API functions to write the modified dictionary back to the system.

I would say it is not recommended to have so many rules inside one ruleset. The system will get very slow at activation time and if you search for rules inside WATO.

If i look at my bigger systems then the maximum i have is around 100-200 rules in one set and this some active check like HTTP.

2 Likes