Sending downtime commands from windows server

I have a requirement wherein whenever the server gets restarted for any kind of maintenance activity, it should send a downtime command to Checkmk monitoring server.

How do you solve it for Windows?

I have created a simple powershell script that will send downtime commands to CheckmK. This is my 2 line code

$Webrequest = "https://<<monitoring_server>>/<<site>>/check_mk/view.py?output_format=json&_transid=-1&_do_confirm=yes&_do_actions=yes&&_username=$automation_user&_secret=$automation_secret&view_name=hoststatus&host=$hostname&_down_comment=Going down&_down_from_now=yes&_down_minutes=5"
Invoke-RestMethod $Webrequest

I see the request in apache/access_logs with a response code 200 but nothing happens on the UI . The version is Checkmk 1.5.0p12. The same automation user is being used to send downtime commands from Linux server and it works fine there.

If I open the URL above (ofcourse after filling it with real values), then see a SUCCESS message and in the UI as well the downtime gets set. But, when I execute it on the server being monitored nothing happens on the UI.

Can you advise what I am missing ?

Okay. There was a typo with the double & and also the name of the host. I had to convert the host to lowercase and it worked.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.