Skip to content

python3运行规则匹配到后不发送告警,0sent? #8

Description

@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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions