0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ElastAlertでアラート通知先にLine Notifyを使った時のメモ

Last updated at Posted at 2020-05-09

環境

AWS Workspaces
Amazon Linux2
Docker
 Elasticsearch 7.6.2
 Kibana 7.6.2
 ElastAlert 0.2.1+ElastAlert Server

動作確認

Lineにグループ作成

以下のサイトを参考にアクセストークン取得

[超簡単]LINE notify を使ってみる

アラートルールファイルにLineNotifyの設定を追記

alert:  
  - "linenotify"  
linenotify_access_token: "line token"

ElastAlertのDockerコンテナ再起動

以下のサイトと同様のエラーが出る

Line Notify Error and Rule of Change Error #2307

loader.pyをダウンロード、修正、docker-composeで起動時にマウント

Line notify is missing #2516

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

キャプチャ.PNG

ElastAlert GitHubのサイトでプルリクエスト

Fix LineNotify #2783

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?