0

I want to be able to set a service in Check_MK into downtime via a curl command.

This is quite well documented here: https://mathias-kettner.de/checkmk_multisite_automation.html

So I followed the guide above and created the following curlcommand to execute from a remote server.

curl -d "_do_confirm=yes" -d "_transid=-1" -d "_do_actions=yes" -d "service=Logins" -d "host=<HOSTNAME>" -d "view_name=service" -d "_down_minutes=5" -d "_down_comment=TEST" -d "_username=apiuser" -d "_secret=<SECRET>" "<MY_CHECK_MK>/check_mk/view.py"

I have the correct hostname and secret entered above too.

When I execute the above command it just returns a load of HTML from the page but it doesn't actually perform the action of entering the service into downtime.

I'm not really sure where I'm going wrong here...

Any help would be greatly appreciated. Thanks

Zanmato
  • 235
  • 8
  • 13
  • If i enter the above URL into the browser I get an error message of: `No rows selected to perform actions for` – Zanmato Jun 22 '16 at 08:58
  • I'm obviously missing an input of some kinds here but I can't see mention of anything to do with rows in the documentation. – Zanmato Jun 22 '16 at 08:58

1 Answers1

0

I had the exact same issue today and it turned out in my case that the user I'd created didn't have sufficient rights to be able to perform the action. Making it an admin fixed this. Not ideal, and there may be more granular rights I can give once I look into it. Since then, I've been able to get the same error by specifying say, a none existent host, or host group (via a typo). A more helpful error would have saved me a lot of time in all of these cases - so hopefully this helps someone out.