This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.6.7. カスタム Alertmanager 設定の適用
alertmanager-main
シークレットを openshift-monitoring
プロジェクト内で編集して、デフォルトの Alertmanager 設定を上書きできます。
前提条件
-
cluster-admin
ロールを持つユーザーとしてクラスターにアクセスできる。
手順
CLI で Alertmanager 設定を変更するには、以下を実行します。
現在アクティブな Alertmanager 設定をファイル
alertmanager.yaml
に出力します。oc -n openshift-monitoring get secret alertmanager-main --template='{{ index .data "alertmanager.yaml" }}' | base64 --decode > alertmanager.yaml
$ oc -n openshift-monitoring get secret alertmanager-main --template='{{ index .data "alertmanager.yaml" }}' | base64 --decode > alertmanager.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow alertmanager.yaml
で設定を編集します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注記matchers
キー名を使用して、ノードの照合でアラートが満たす必要のあるマッチャーを指定します。match
またはmatch_re
キー名は使用しないでください。どちらも非推奨であり、今後のリリースで削除される予定です。さらに、禁止ルールを定義する場合は、
target_matchers
キー名を使用してターゲットマッチャーを示し、source_matchers
キー 名を使用してソースマッチャーを示します。target_match
、target_match_re
、source_match
、またはsource_match_re
キー名は使用しないでください。これらは非推奨であり、今後のリリースで削除される予定です。以下の Alertmanager 設定例は、PagerDuty をアラートレシーバーとして設定します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow この設定では、
example-app
サービスで実行される重大度がcritical
のアラートは、team-frontend-page
receiver を使用して送信されます。通常、これらのタイプのアラートは、個別または緊急対策チーム (Critical Response Team) に送信先が設定されます。新規設定をファイルで適用します。
oc -n openshift-monitoring create secret generic alertmanager-main --from-file=alertmanager.yaml --dry-run=client -o=yaml | oc -n openshift-monitoring replace secret --filename=-
$ oc -n openshift-monitoring create secret generic alertmanager-main --from-file=alertmanager.yaml --dry-run=client -o=yaml | oc -n openshift-monitoring replace secret --filename=-
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
OpenShift Container Platform Web コンソールから Alertmanager 設定を変更するには、以下を実行します。
-
Web コンソールの Administration
Cluster Settings Configuration Alertmanager YAML ページに移動します。 - YAML 設定ファイルを変更します。
- Save を選択します。