我们正尝试使用Hipsaint将nagios(4.1.1)通知与Hipchat集成。我们按照here发布的说明进行操作(请记住,说明中提到了nagios 3)。我们填写了令牌和Room_ID。我们得到以下输出:
:~# hipsaint --token=XXXXXXXXXX --room=XXXXXXX --type=host --inputs="$HOSTNAME$|$LONGDATETIME$|$NOTIFICATIONTYPE$|$HOSTADDRESS$|$HOSTSTATE$|$HOSTOUTPUT$" -n
Traceback (most recent call last):
File "/usr/local/bin/hipsaint", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/hipsaint/bin/commands.py", line 78, in main
msg.deliver_payload()
File "/usr/local/lib/python2.7/dist-packages/hipsaint/messages.py", line 68, in deliver_payload_v1
raw_response = urlopen(self.urlv1, message_params)
File "/usr/lib/python2.7/urllib2.py", line 133, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 416, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 529, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 454, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 388, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 537, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 401: Unauthorized
我们还尝试了以下方法:
使用新令牌
将Python从版本2.7更新为3
在nagios Security Group上打开hipchat端口
知道我们如何进行吗?