0

我正在尝试创建脚本以使主机处于停机状态,

创建用户(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>

密码和用户名都可以

4

1 回答 1

0

我找到了我自己问题的部分答案:),通过为自动化用户设置密码并将其放入 curl (username:password) 中消除了 401 错误,删除了 _username 和 _secret 部分,现在从 curl 获得输出但再次无法设置主机处于停机状态,通过创建新的时间段(排除服务器不应接收通知的时间并为服务通知创建规则并指定新的时间段并指定新的时间段)来实施解决方法。

于 2017-08-02T11:51:56.573 回答