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.5.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 以下の 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 Global Configuration Alertmanager YAML ページに移動します。 - YAML 設定ファイルを変更します。
- Save を選択します。