2017-08-01 30 views
0

我试图创建脚本,把主机宕机,Check_mk反复出现的调度维护支持

创建的用户(管理员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> 

秘密和用户名都OK

回答

0

我发现了一个部分回答我自己的问题:),通过为自动化用户设置密码并将其放入curl(用户名:密码),删除了_username和_secret部分,现在从curl输出但再次无法在停机时间设置主机,通过创建新的时间段实施解决方案(排除服务器不应接收通知的时间,并为服务通知创建规则,并指定新的时间段并且工作。