【Problem Resolved】zabbix微信报警,一开始可以成功报警,之后报警突然不行

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服务器)

转载于:https://blog.51cto.com/jackor/2072608

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值