我正在尝试创建脚本来让主机停机,
已创建用户(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>密码和用户名都可以
发布于 2017-08-02 19:51:57
我找到了我自己问题的部分答案:),通过为自动化用户设置密码并将其放入curl (用户名:密码)摆脱了401错误,删除了_username和_secret部分,现在从curl获得了输出,但仍然无法在停机时设置主机,通过创建新的timeperiod (排除了服务器不应接收通知的时间)实现了变通方法,并为服务通知创建了规则,并指定了新的时间段,它可以工作。
https://stackoverflow.com/questions/45436739
复制相似问题