環境
AWS Workspaces
Amazon Linux2
Docker
Elasticsearch 7.6.2
Kibana 7.6.2
ElastAlert 0.2.1+ElastAlert Server
動作確認
Lineにグループ作成
以下のサイトを参考にアクセストークン取得
アラートルールファイルにLineNotifyの設定を追記
alert:
- "linenotify"
linenotify_access_token: "line token"
ElastAlertのDockerコンテナ再起動
以下のサイトと同様のエラーが出る
Line Notify Error and Rule of Change Error #2307
loader.pyをダウンロード、修正、docker-composeで起動時にマウント
Hi,
I think Line alerter is missing in the loader.py. There was >this line in an older version
'linenotify': alerts.LineNotifyAlerter
修正前(loader.pyの修正箇所の付近のみ)
loader.py
'hivealerter': alerts.HiveAlerter
}
修正後(loader.pyの修正箇所の付近のみ)
loader.py
'hivealerter': alerts.HiveAlerter,
'linenotify': alerts.LineNotifyAlerter
}
docker-compose.yml修正
ElastAlertのコンテナのマウントするものの設定にloaders.pyを追加
修正前(修正箇所付近のみ)
volumes:
- ./praeco/config/elastalert.yaml:/opt/elastalert/config.yaml
- ./praeco/config/api.config.json:/opt/elastalert-server/config/config.json
- ./praeco/rules:/opt/elastalert/rules
- ./praeco/rule_templates:/opt/elastalert/rule_templates
修正後(修正箇所付近のみ)
volumes:
- ./praeco/config/elastalert.yaml:/opt/elastalert/config.yaml
- ./praeco/config/api.config.json:/opt/elastalert-server/config/config.json
- ./praeco/rules:/opt/elastalert/rules
- ./praeco/rule_templates:/opt/elastalert/rule_templates
- ./praeco/patch/loaders.py:/opt/elastalert/elastalert/loaders.py
動作確認
docker-compose up -d