Jimdo.logzio-alert
ansible-logzio-alert
logz.ioでアラートを設定するためのAnsibleモジュール
インストール
$ ansible-galaxy install Jimdo.logzio-alert
ドキュメンテーション
モジュールオプション
名前 | 必須 | 説明 | デフォルト |
---|---|---|---|
name | はい | 作成するアラートのユニークな名前 | |
logzio_api_endpoint | いいえ | logz.ioのAPIエンドポイント | api.logz.io |
logzio_api_token | いいえ | logz.ioのAPIトークン。設定しない場合はLOGZIO_API_TOKEN環境変数の値が使用されます | |
state | いいえ | アラートが存在するべきかどうか | present |
description | いいえ | アラートの説明 | |
severity | いいえ | アラートの重要度(LOW, MEDIUM, HIGH) | MEDIUM |
query | はい | アラートを取得したいメッセージを返す検索クエリ | |
operation | いいえ | 閾値の比較のための演算子 | GREATER_THAN |
threshold | いいえ | アラートの閾値 | 0 |
timeframe | いいえ | 閾値の計算に考慮される時間間隔(分単位) | 10 |
notification_emails | いいえ | 通知すべきメールアドレスのリスト | |
enabled | いいえ | このアラートがアクティブであるべきかどうか | true |
suppress | いいえ | 繰り返し通知が抑制される時間間隔(分単位) | 5 |
aggregation_type | いいえ | クエリされたメッセージの集約フィールドに対して行いたい集約の種類 | NONE |
aggregation_field | いいえ | 集約を選択したいフィールド | |
group_by_fields | いいえ | アラート内でメッセージをグループ化するフィールドのリスト | |
notification_endpoints | いいえ | このアラートによってトリガーされるべき通知エンドポイントの名前のリスト |
例
Playbookでlogzio_alertモジュールを使用する
---
- hosts: localhost
connection: local
gather_facts: False
roles:
- Jimdo.logzio-alert
tasks:
- name: Logzioアラート「Example」を設定する
logzio_alert:
name: "Example"
query: >
message: "some message"
AND NOT message: "some other message"
suppress: 60
group_by_fields:
- type
notification_endpoints:
- Slackチームチャンネル
$ ansible-playbook alerts.yml