elastalert-dingtalk-plugin icon indicating copy to clipboard operation
elastalert-dingtalk-plugin copied to clipboard

No module named 'elastalert_modules

Open ktpktr0 opened this issue 2 years ago • 2 comments

I use docker to install elastalert. I try to load the new module, but it fails

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/elastalert", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/site-packages/elastalert/elastalert.py", line 2155, in main
    client = ElastAlerter(args)
  File "/usr/local/lib/python3.10/site-packages/elastalert/elastalert.py", line 128, in __init__
    self.rules = self.rules_loader.load(self.conf, self.args)
  File "/usr/local/lib/python3.10/site-packages/elastalert/loaders.py", line 170, in load
    raise EAException('Error loading file %s: %s' % (rule_file, e))
elastalert.util.EAException: Error loading file /home/elastalert/rules/example_frequency.yaml: Error initiating alert ['elastalert_modules.dingtalk_alert.DingTalkAlerter']: Could not import module elastalert_modules.dingtalk_alert.DingTalkAlerter: No module named 'elastalert_modules'

load modules:

# ll /data/elastalert/elastalert_modules/
dingtalk_alert.py  __init__.py 

rules:

alert_text_type: alert_text_only

alert_text_args:
  - host
  - method
  - request
  - status
  - upstream
  - num_hits

alert:
  - "elastalert_modules.dingtalk_alert.DingTalkAlerter"

ktpktr0 avatar Nov 30 '21 08:11 ktpktr0

elastalert does not work properly with python 3.9 and 3.10.

nsano-rururu avatar Feb 10 '22 16:02 nsano-rururu

elastalert2 is compatible with python 3.9 and 3.10. https://github.com/jertel/elastalert2

nsano-rururu avatar Feb 10 '22 16:02 nsano-rururu