Check_mk recurring scheduled maintenace

283 Views Asked by At

I'm trying to create script to put host in downtime,

created user (check_mk administrator), and set a secret,

then run su sitename curl -n -s "http://localhost/site/check_mk/view.py?_do_confirm=yes&_transid=-1&_do_actions=yes&host=host&site=site&view_name=host&_down_comment=COMMENT&_down_from_now=From+now+for&_down_minutes=1&_username=automation&_secret=secret

but got

<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
</body></html>

Secret and username are OK

1

There are 1 best solutions below

0
On

I found a partial answer to my own question :), got rid of 401 error by setting password for automation user and putting it in curl (username:password), removed _username and _secret part, now got output from curl but again unable to set host in downtime, implemented workaround by creating new timeperiod (excluded time during which servers shouldn't receive notifications and created rule for service notifications and specifying new time period and it works.