API calls for down time no longer working for 2.1?

2.1.0p1cre:
Ubuntu 22.04

Prior to 2.1.0 the following API call would put the host in downtime for the duration specified:

curl --insecure "http://yourhost/yoursite/check_mk/view.py_username=automation&_secret=yoursecret&_transid=-1&_do_confirm=yes&_do_actions=yes&host=yourhost.local&_down_from_now=yes&_down_minutes=30&_down_comment=Backup_Window&view_name=hoststatus"

However since upgrading to 2.1.0 that doesn’t seem to work any longer nor any of the other variations of the call I’ve seen in the forums.

There is no result and the host doesn’t go into downtime.

Any clues as to what’s changed? My goal is to start down time when the call is made for a duration of 30 minutes so I can schedule recurring maintenance every night.

So far all the scripts seem to require you setting a start and end date/time which I don’t understand if you are saying you want it to last for a duration. The curl call above used to work and was the only way to set a downtime for specific duration when the call was made with the free version since it doesn’t include the scheduled down time functionality of the Enterprise version.

I don’t know what has changed.

I am using rest api with bash and cron myself with 2.1 to do recurring downtimes in RAW edition.
Maybe my how to article helps as a possible workaround:

Perhaps a bit OT but that is not an API call. You are using the GUI to set downtime in your URL above, instead you should use the RestAPI.

Fair enough.

So for Yggy’s script seems to be doing the job. Cheers!

You can find an example script downtime.py in the folder $OMD_ROOT/share/doc/check_mk/treasures of your monitoring site.