本文共 1043 字,大约阅读时间需要 3 分钟。
Traceback (most recent call last):File "/usr/lib/zabbix/alertscripts/wechat.py", line 61, inaccess_token_response = msgsender.geturl(msgsender.gettoken_url, msgsender.gettoken_content)File "/usr/lib/zabbix/alertscripts/wechat.py", line 41, in geturlresponse = urllib2.urlopen('%s?%s' % (url,data))File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopenreturn opener.open(url, data, timeout)File "/usr/lib64/python2.7/urllib2.py", line 431, in openresponse = 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_chainresult = func(*args)File "/usr/lib64/python2.7/urllib2.py", line 1258, in https_opencontext=self._context, check_hostname=self._check_hostname)File "/usr/lib64/python2.7/urllib2.py", line 1214, in do_openraise URLError(err)urllib2.URLError:
解决办法:检测zabbix-server的网络是否可以解析外网域名,本人是因为zabbix-server的dns出现问题,所以修改/etc/resolv.conf 添加nameserver 114.114.114.114 (可用的DNS服务器)
转载于:https://blog.51cto.com/jackor/2072608