REST-API calls in distributed monitoring

Hi,

I have a distributed setup and would like to use the REST-API to set downtimes, when running ansible tasks (patchruns).
As API url I am using the master/central GUI. In the cmc.log I can see that it tries to set the downtime but fails

Executing external command: SCHEDULE_HOST_DOWNTIME;myhost;1634135372;1634136572;0;0;1200;automation;Security updates
Cannot execute command on non-existing host myhost

My guess is, that since the target host (myhost) is on different site, it cannot set the downtime. Is the API on the central site not able to set this on the corresponding host/site? When doing this manually in the master GUI directly, this does not seem to be a problem.
The thing is, that the master site does have connection to all it’s sites, but the host that is running the ansible tasks does not.
Or maybe I am just on the wrong track here, …

Cheers
Benjamin

Obviously. The current implementation of the REST API still lacks some functionality.

Hi,

thanks. I know the REST-API is very new, but I thought this case was already considered, since the base ability of downtiming was there. I will have to use the “old” method for now, but I’m looking forward to have this ability. I think the REST-API is a great improvement, per se.

BR
Benjamin

1 Like

Hi @benjamin.alfery ,
We are also stuck similar to your case. which is OLD method are you using, if possible share some thoughts so we can also try it.

Hi,

we utilized the downtime script, which can be found in ~/share/doc/check_mk/treasures/downtime.py, in an ansible playbook, to set downtimes just ahead of patch runs.

BR
Benjamin

1 Like

is that script able to put the server of remote site into downtime from Central Site?

and 2nd thing, how to use this script.

if possible, can you please share more or give some clue to we can test

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.