Traceback (most recent call last):
File "/usr/lib/zabbix/alertscripts/wechat.py", line 61, in <module>
access_token_response = msgsender.geturl(msgsender.gettoken_url, msgsender.gettoken_content)
File "/usr/lib/zabbix/alertscripts/wechat.py", line 41, in geturl
response = urllib2.urlopen(‘%s?%s‘ % (url,data))
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib64/python2.7/urllib2.py", line 449, in _open
‘_open‘, req)
File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 1258, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/usr/lib64/python2.7/urllib2.py", line 1214, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>
?
解决办法:检测zabbix-server的网络是否可以解析外网域名,本人是因为zabbix-server的dns出现问题,所以修改/etc/resolv.conf 添加nameserver 114.114.114.114 (可用的DNS服务器)
原文地址:http://blog.51cto.com/jackor/2072608