-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python3运行规则匹配到后不发送告警,0sent? #8
Comments
INFO:elastalert:Ignoring match for silenced rule log_error |
在看了前一个问题的解决方法里测试了他修改后的wechart_module.py,发现还是0sent,不知道这是啥情况。 |
@acooljj 解决了吗?我也跟你一样。 |
python3 -m elastalert.elastalert --verbose --rule ../elastalert_wechat_plugin/es_rules/wechart2.yaml --config ../elastalert_wechat_plugin/config/config.yaml
1 rules loaded
INFO:elastalert:Starting up
INFO:elastalert:Disabled rules are: []
INFO:elastalert:Sleeping for 59.999454 seconds
INFO:elastalert:Queried rule schedulee from 2020-03-09 16:26 CST to 2020-03-09 16:30 CST: 12 / 12 hits
/usr/local/python3.6/lib/python3.6/site-packages/urllib3-1.25.8-py3.6.egg/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made to host 'qyapi.weixin.qq.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning,
ERROR:root:Traceback (most recent call last):
File "/data/elastalert/elastalert/elastalert.py", line 1450, in alert
return self.send_alert(matches, rule, alert_time=alert_time, retried=retried)
File "/data/elastalert/elastalert/elastalert.py", line 1544, in send_alert
alert.alert(matches)
File "/usr/local/python3.6/lib/python3.6/site-packages/elastalert-0.2.1-py3.6.egg/elastalert_modules/wechat_qiye_alert.py", line 57, in alert
self.senddata(body)
File "/usr/local/python3.6/lib/python3.6/site-packages/elastalert-0.2.1-py3.6.egg/elastalert_modules/wechat_qiye_alert.py", line 124, in senddata
response = requests.post(send_url, data=json.dumps(payload, ensure_ascii=False), headers=headers,verify=False)
File "/usr/local/python3.6/lib/python3.6/json/init.py", line 238, in dumps
**kw).encode(obj)
File "/usr/local/python3.6/lib/python3.6/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/python3.6/lib/python3.6/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/python3.6/lib/python3.6/json/encoder.py", line 180, in default
o.class.name)
TypeError: Object of type 'bytes' is not JSON serializable
ERROR:root:Uncaught exception running rule schedulee: Object of type 'bytes' is not JSON serializable
INFO:elastalert:Rule schedulee disabled
INFO:elastalert:Ignoring match for silenced rule schedulee
INFO:elastalert:Ignoring match for silenced rule schedulee
INFO:elastalert:Ignoring match for silenced rule schedulee
INFO:elastalert:Ignoring match for silenced rule schedulee
INFO:elastalert:Ignoring match for silenced rule schedulee
INFO:elastalert:Ignoring match for silenced rule schedulee
INFO:elastalert:Ignoring match for silenced rule schedulee
INFO:elastalert:Ignoring match for silenced rule schedulee
INFO:elastalert:Ignoring match for silenced rule schedulee
INFO:elastalert:Ignoring match for silenced rule schedulee
INFO:elastalert:Ignoring match for silenced rule schedulee
INFO:elastalert:Ran schedulee from 2020-03-09 16:26 CST to 2020-03-09 16:30 CST: 12 query hits (0 already seen), 12 matches, 0 alerts sent
The text was updated successfully, but these errors were encountered: