Need help with the WEB-API

How can I set a single service in Downtime using the Webapi, for example using a command on bash like this:

curl -k "https://some.url.net/some_site/check_mk/view.py?
_username=USER
&_secret=PASSWORD
&filled_in=actions
&actions=yes
&_transid=-1
&_do_confirm=yes
&_do_actions=yes
&view_name=service
&host=server01
&_down_from_now=yes
&_down_minutes=1
&_down_comment=In_Downtime
&service=Check_MK"

This command above unfortunately does not work and I also can’t figure it out using the docu.

Best regards!

Unfamiliar with the web api, I am using rest api myself.

I had several issues popping up as soon as I went for SSL, since we use self signed certification on intern network.
Wrote a how to for it a while ago, maybe it helps you.

1 Like

You are missing this:
_do_confirm_service_downtime=yes

If you are using 2.0, then adding the above should work.
On 2.1.0p17, we also fixed a bug with the _transid Fix usage of "_trans_id=-1" in automation calls

1 Like

Wonderfull, thanks, this was the life saver.

One thing to note, using “_do_confirm_service_downtime=yes” for the service,
“&_do_confirm=yes” seems not to be needed.

It finally worked like this:

curl -k "https://some.url.net/some_site/check_mk/view.py?
_username=USER
&_secret=PASSWORD
&filled_in=actions
&actions=yes
&_transid=-1
&_do_confirm_service_downtime=yes
&_do_actions=yes
&view_name=service
&host=server01
&_down_from_now=yes
&_down_minutes=1
&_down_comment=In_Downtime
&service=Check_MK"

Could there be any side effect leaving the “&_do_confirm=yes” option?