Set host-/servicestate via API

As NSCA will be removed in CMK 2.2…

I would like to have a way to set a service state via the checkmk api. This should be independent of whether an agent is installed or not. Some applications can call a URL with parameters in case of an event.
An example of a use case where the checkinterval of an agent is too large:
Opening and closing a door. This is faster than the 1 min check interval. Here the event would not be noticed.

Set host-/servicestate via API - Checkmk

Does anyone have any ideas?

THX Community!!!

You can use the multisite API to send thr same commands that can be sent from the web GUI.

Just look at how the “Fake Check Result” command is implemented.

2 Likes

Thank you for the quick reply. It would be nice to have an official way.

Do you already have a working solution for “injecting” things into the Multisite API?
Code snippets?