我正在尝试创建脚本以使主机处于停机状态,
创建用户(check_mk 管理员),并设置一个秘密,
然后运行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
但得到了
<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>
密码和用户名都可以