我正在尝试编写一个启动脚本,将elastalert作为服务启动。elastalert使用python并按如下方式启动:python -m elastalert --verbose --rule rules_folder/frequency.yaml --config config.yaml
我一直在努力让它与以下方面一起工作:
^{pr2}$
尝试运行脚本时,出现以下错误:virtualenvelastalert) [root@mplinux scripts]# elastalert
Traceback (most recent call last):
File "/virtualenvelastalert/bin/elastalert", line 11, in
load_entry_point('elastalert==0.0.95', 'console_scripts', 'elastalert')()
File "/virtualenvelastalert/lib/python2.7/site-packages/elastalert-0.0.95-py2.7.egg/elastalert/elastalert.py", line 1426, in main
client = ElastAlerter(args)
File "/virtualenvelastalert/lib/python2.7/site-packages/elastalert-0.0.95-py2.7.egg/elastalert/elastalert.py", line 94, in init
self.conf = load_rules(self.args)
File "/virtualenvelastalert/lib/python2.7/site-packages/elastalert-0.0.95-py2.7.egg/elastalert/config.py", line 373, in load_rules
conf = yaml_loader(filename)
File "/virtualenvelastalert/lib/python2.7/site-packages/staticconf/loader.py", line 161, in yaml_loader
with open(filename) as fh:
IOError: [Errno 2] No such file or directory: 'config.yaml'