az monitor alert-processing-rule

Note

このリファレンスは、Azure CLI (バージョン 2.45.0 以降) の alertsmanagement 拡張機能の一部です。 拡張機能は、az monitor alert-processing-rule コマンドを初めて実行するときに自動的にインストールされます。 拡張機能の詳細をご覧ください。

このコマンド グループはプレビュー段階であり、開発中です。 参照レベルとサポート レベル: https://aka.ms/CLI_refstatus

alertsmanagement を使用してアラート処理ルールを管理します。

コマンド

名前 説明 Status
az monitor alert-processing-rule create

アラート処理ルールを作成します。

拡張子 プレビュー
az monitor alert-processing-rule delete

アラート処理ルールを削除します。

拡張子 プレビュー
az monitor alert-processing-rule list

サブスクリプションまたはリソース グループ内のすべてのアラート処理ルールを一覧表示します。

拡張子 プレビュー
az monitor alert-processing-rule show

アラート処理ルールを取得します。

拡張子 プレビュー
az monitor alert-processing-rule update

アラート処理ルールのタグを有効、無効、または更新します。

拡張子 プレビュー

az monitor alert-processing-rule create

プレビュー

コマンド グループ 'monitor alert-processing-rule' はプレビュー段階であり、開発中です。 参照レベルとサポート レベル: https://aka.ms/CLI_refstatus

アラート処理ルールを作成します。

az monitor alert-processing-rule create --name
                                        --resource-group
                                        --rule-type {AddActionGroups, RemoveAllActionGroups}
                                        --scopes
                                        [--action-groups]
                                        [--description]
                                        [--enabled {false, true}]
                                        [--filter-alert-context]
                                        [--filter-alert-rule-description]
                                        [--filter-alert-rule-id]
                                        [--filter-alert-rule-name]
                                        [--filter-monitor-condition]
                                        [--filter-monitor-service]
                                        [--filter-resource-group]
                                        [--filter-resource-type]
                                        [--filter-severity]
                                        [--filter-signal-type]
                                        [--filter-target-resource]
                                        [--schedule-end-datetime]
                                        [--schedule-recurrence]
                                        [--schedule-recurrence-2]
                                        [--schedule-recurrence-2-end-time]
                                        [--schedule-recurrence-2-start-time]
                                        [--schedule-recurrence-2-type {Daily, Monthly, Weekly}]
                                        [--schedule-recurrence-end-time]
                                        [--schedule-recurrence-start-time]
                                        [--schedule-recurrence-type {Daily, Monthly, Weekly}]
                                        [--schedule-start-datetime]
                                        [--schedule-time-zone]
                                        [--tags]

サブスクリプション内のすべてのアラートにアクション グループを追加するルールを作成または更新する

az monitor alert-processing-rule create \
--name 'AddActionGroupToSubscription' \
--rule-type AddActionGroups \
--scopes "/subscriptions/MySubscriptionId" \
--action-groups "/subscriptions/MySubscriptionId/resourcegroups/MyResourceGroup1/providers/microsoft.insights/actiongroups/ActionGroup1" \
--enabled true \
--resource-group alertscorrelationrg \
--description "Add ActionGroup1 to all alerts in the subscription"

2 つのリソース グループ内のすべての Sev0 および Sev1 アラートに 2 つのアクション グループを追加するルールを作成または更新する

az monitor alert-processing-rule create \
--name 'AddActionGroupsBySeverity' \
--rule-type AddActionGroups \
--action-groups "/subscriptions/MySubscriptionId/resourcegroups/MyResourceGroup1/providers/microsoft.insights/actiongroups/MyActionGroupId1" "/subscriptions/MySubscriptionId/resourceGroups/MyResourceGroup2/providers/microsoft.insights/actionGroups/MyActionGroup2" \
--scopes "/subscriptions/MySubscriptionId" \
--resource-group alertscorrelationrg \
--filter-severity Equals Sev0 Sev1 \
--description "Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups"

1 回限りのメインテナント 期間中に特定の VM のアラートからすべてのアクション グループを削除するルールを作成または更新します (特定の日付の 1800 から 2000 年、太平洋標準時)

az monitor alert-processing-rule create \
--name 'RemoveActionGroupsMaintenanceWindow' \
--rule-type RemoveAllActionGroups \
--scopes "/subscriptions/MySubscriptionId/resourceGroups/MyResourceGroup1/providers/Microsoft.Compute/virtualMachines/VMName" \
--resource-group alertscorrelationrg \
--schedule-start-datetime '2022-01-02 18:00:00' \
--schedule-end-datetime '2022-01-02 20:00:00' \
--schedule-time-zone 'Pacific Standard Time' \
--description "Removes all ActionGroups from all Alerts on VMName during the maintenance window"

特定のアラート ルールから取得したサブスクリプション内のすべてのアラートからすべてのアクション グループを削除するルールを作成または更新する

az monitor alert-processing-rule create \
--name 'RemoveActionGroupsSpecificAlertRule' \
--rule-type RemoveAllActionGroups \
--scopes "/subscriptions/MySubscriptionId" \
--resource-group alertscorrelationrg \
--filter-alert-rule-id Equals "/subscriptions/MySubscriptionId/resourceGroups/MyResourceGroup1/providers/microsoft.insights/activityLogAlerts/RuleName" \
--description "Removes all ActionGroups from all Alerts that fire on above AlertRule"

定期的なメインテナント期間中に、2 つのリソース グループ内の任意の VM 上のすべてのアラートからすべてのアクション グループを削除するルールを作成または更新します (インド標準時の土日ごと 2200 から 0400)。

az monitor alert-processing-rule create \
--name 'RemoveActionGroupsRecurringMaintenance' \
--rule-type RemoveAllActionGroups \
--scopes "/subscriptions/MySubscriptionId/resourceGroups/MyResourceGroup1" "/subscriptions/MySubscriptionId/resourceGroups/MyResourceGroup2" \
--resource-group alertscorrelationrg \
--filter-resource-type Equals "microsoft.compute/virtualmachines" \
--schedule-time-zone "India Standard Time" \
--schedule-recurrence-type Weekly \
--schedule-recurrence-start-time "22:00:00" \
--schedule-recurrence-end-time "04:00:00" \
--schedule-recurrence Sunday Saturday \
--description "Remove all ActionGroups from all Virtual machine Alerts during the recurring maintenance"

営業時間外にすべてのアクション グループを削除するルールを作成または更新します (東部標準時の月から金曜日の 09:00-17:00)

az monitor alert-processing-rule create \
--name 'RemoveActionGroupsOutsideBusinessHours' \
--rule-type RemoveAllActionGroups \
--scopes "/subscriptions/MySubscriptionId" \
--resource-group alertscorrelationrg \
--schedule-time-zone "Eastern Standard Time" \
--schedule-recurrence-type Daily \
--schedule-recurrence-start-time "17:00:00" \
--schedule-recurrence-end-time "09:00:00" \
--schedule-recurrence-2-type Weekly \
--schedule-recurrence-2 Saturday Sunday \
--description "Remove all ActionGroups outside business hours"

必須のパラメーター

--name -n

アラート処理ルールの名前。

--resource-group -g

リソース グループの名前。 az configure --defaults group=<name> を使用して、既定のグループを構成できます。

--rule-type

アラート処理ルールの種類を示します。

承認された値: AddActionGroups, RemoveAllActionGroups
--scopes

スコープのリソース ID (スペース区切り) の一覧。 ルールは、そのスコープ内のリソースに対して発生したアラートに適用されます。

省略可能のパラメーター

--action-groups

追加するアクション グループのリソース ID (スペース区切り) の一覧。 この引数を使用するには、ルールの種類が AddActionGroups である必要があります。

--description

アラート処理ルールの説明。

--enabled

指定されたアラート処理ルールが有効か無効か (既定値は有効) を示します。

承認された値: false, true
--filter-alert-context

アラート コンテキスト (ペイロード) でアラートをフィルター処理します。

フィルター形式は、演算子 : <等号、NotEquals、Contains、DoesNotContain> 値: 特定の条件に一致する値の一覧です。

--filter-alert-rule-description

アラート ルールの説明でアラートをフィルター処理します。

--filter-alert-rule-id

アラート ID でアラートをフィルター処理します。

--filter-alert-rule-name

アラート ルール名でアラートをフィルター処理します。

--filter-monitor-condition

モニター条件でアラートをフィルター処理します。

--filter-monitor-service

モニター サービスでアラートをフィルター処理します。

--filter-resource-group

リソース グループでアラートをフィルター処理します。

--filter-resource-type

リソースの種類でアラートをフィルター処理します。

--filter-severity

重大度 <Sev0、Sev1、Sev2、Sev3、Sev4> でアラートをフィルター処理します。

--filter-signal-type

シグナルの種類でアラートをフィルター処理します。

--filter-target-resource

リソースでアラートをフィルター処理します。

--schedule-end-datetime

ルールの終了日。 形式: 'YYYY-MM-DD hh:mm:ss'。

--schedule-recurrence

繰り返しパターン値の一覧。

--schedule-recurrence : 繰り返しパターン値の一覧 (スペース区切り)。 週単位の繰り返しの種類の場合、使用できる値は日曜日から土曜日です。 毎月の繰り返しの種類の場合、使用できる値は 1 ~ 31 (月の日) です。

--schedule-recurrence-2

2 番目の繰り返しパターンの繰り返しパターン値の一覧。

--schedule-recurrence-2: 繰り返しパターン値の一覧 (スペース区切り)。 週単位の繰り返しの種類の場合、使用できる値は日曜日から土曜日です。 毎月の繰り返しの種類の場合、使用できる値は 1 ~ 31 (月の日) です。

--schedule-recurrence-2-end-time

各繰り返しの終了時刻。 形式: hh:mm:ss。

--schedule-recurrence-2-start-time

各繰り返しの開始時刻。 形式: hh:mm:ss。

--schedule-recurrence-2-type

処理規則を適用するタイミングを指定します。 既定値は Always です。

承認された値: Daily, Monthly, Weekly
--schedule-recurrence-end-time

各繰り返しの終了時刻。 形式: 'hh:mm:ss'。

--schedule-recurrence-start-time

各繰り返しの開始時刻。 形式: 'hh:mm:ss'。

--schedule-recurrence-type

処理規則を適用するタイミングを指定します。

承認された値: Daily, Monthly, Weekly
--schedule-start-datetime

ルールの開始日。 形式: 'YYYY-MM-DD hh:mm:ss'。

--schedule-time-zone

タイム ゾーンをスケジュールします。

既定値: UTC
--tags

スペース区切りのタグ: key[=value] [key[=value] ...]既存のタグをクリアするには、"" を使用します。

グローバル パラメーター
--debug

すべてのデバッグ ログを表示するようにログの詳細レベルを上げます。

--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告は抑制します。

--output -o

出力形式。

承認された値: json, jsonc, none, table, tsv, yaml, yamlc
既定値: json
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ をご覧ください。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--verbose

ログの詳細レベルを上げます。 詳細なデバッグ ログを表示するには --debug を使います。

az monitor alert-processing-rule delete

プレビュー

コマンド グループ 'monitor alert-processing-rule' はプレビュー段階であり、開発中です。 参照レベルとサポート レベル: https://aka.ms/CLI_refstatus

アラート処理ルールを削除します。

az monitor alert-processing-rule delete [--ids]
                                        [--name]
                                        [--resource-group]
                                        [--subscription]
                                        [--yes]

アラート処理ルールを削除します。

az monitor alert-processing-rule delete \
--resource-group myResourceGroup \
--name myRuleName

省略可能のパラメーター

--ids

1 つまたは複数のリソース ID (スペース区切り)。 これは、'Resource Id' 引数のすべての情報を含む完全なリソース ID である必要があります。 --ids または他の 'Resource Id' 引数を指定する必要があります。

--name -n

アラート処理ルールの名前。

--resource-group -g

リソース グループの名前。 az configure --defaults group=<name> を使用して、既定のグループを構成できます。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--yes -y

確認のダイアログを表示しません。

既定値: False
グローバル パラメーター
--debug

すべてのデバッグ ログを表示するようにログの詳細レベルを上げます。

--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告は抑制します。

--output -o

出力形式。

承認された値: json, jsonc, none, table, tsv, yaml, yamlc
既定値: json
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ をご覧ください。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--verbose

ログの詳細レベルを上げます。 詳細なデバッグ ログを表示するには --debug を使います。

az monitor alert-processing-rule list

プレビュー

コマンド グループ 'monitor alert-processing-rule' はプレビュー段階であり、開発中です。 参照レベルとサポート レベル: https://aka.ms/CLI_refstatus

サブスクリプションまたはリソース グループ内のすべてのアラート処理ルールを一覧表示します。

az monitor alert-processing-rule list [--resource-group]

現在のサブスクリプションのすべてのアラート処理ルールを一覧表示する

az monitor alert-processing-rule list

リソース グループ内のすべてのアラート処理ルールを一覧表示する

az monitor alert-processing-rule list \
--resource-group myResourceGroup

省略可能のパラメーター

--resource-group -g

リソース グループの名前。 az configure --defaults group=<name> を使用して、既定のグループを構成できます。

グローバル パラメーター
--debug

すべてのデバッグ ログを表示するようにログの詳細レベルを上げます。

--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告は抑制します。

--output -o

出力形式。

承認された値: json, jsonc, none, table, tsv, yaml, yamlc
既定値: json
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ をご覧ください。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--verbose

ログの詳細レベルを上げます。 詳細なデバッグ ログを表示するには --debug を使います。

az monitor alert-processing-rule show

プレビュー

コマンド グループ 'monitor alert-processing-rule' はプレビュー段階であり、開発中です。 参照レベルとサポート レベル: https://aka.ms/CLI_refstatus

アラート処理ルールを取得します。

az monitor alert-processing-rule show [--ids]
                                      [--name]
                                      [--resource-group]
                                      [--subscription]

名前でアラート処理ルールを取得する

az monitor alert-processing-rule show \
--name myRuleName \
--resource-group myRuleNameResourceGroup

ID でアラート処理ルールを取得する

az monitor alert-processing-rule show \
--ids ruleId1 ruleId2

省略可能のパラメーター

--ids

1 つまたは複数のリソース ID (スペース区切り)。 これは、'Resource Id' 引数のすべての情報を含む完全なリソース ID である必要があります。 --ids または他の 'Resource Id' 引数を指定する必要があります。

--name -n

アラート処理ルールの名前。

--resource-group -g

リソース グループの名前。 az configure --defaults group=<name> を使用して、既定のグループを構成できます。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

グローバル パラメーター
--debug

すべてのデバッグ ログを表示するようにログの詳細レベルを上げます。

--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告は抑制します。

--output -o

出力形式。

承認された値: json, jsonc, none, table, tsv, yaml, yamlc
既定値: json
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ をご覧ください。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--verbose

ログの詳細レベルを上げます。 詳細なデバッグ ログを表示するには --debug を使います。

az monitor alert-processing-rule update

プレビュー

コマンド グループ 'monitor alert-processing-rule' はプレビュー段階であり、開発中です。 参照レベルとサポート レベル: https://aka.ms/CLI_refstatus

アラート処理ルールのタグを有効、無効、または更新します。

az monitor alert-processing-rule update [--add]
                                        [--enabled {false, true}]
                                        [--force-string]
                                        [--ids]
                                        [--name]
                                        [--remove]
                                        [--resource-group]
                                        [--set]
                                        [--subscription]
                                        [--tags]

PatchAlertProcessingRule

az monitor alert-processing-rule update \
--name "WeeklySuppression" \
--enabled false \
--tags key1="value1" key2="value2" --resource-group "alertscorrelationrg"

省略可能のパラメーター

--add

パスとキー値のペアを指定して、オブジェクトの一覧にオブジェクトを追加します。 例: --add property.listProperty <key=value, string or JSON string>

既定値: []
--enabled

指定された処理ルールが有効または無効になっているかどうかを示します (値は True と False)。

承認された値: false, true
--force-string

'set' または 'add' を使用する場合は、JSON に変換するのではなく、文字列リテラルを保持します。

既定値: False
--ids

1 つまたは複数のリソース ID (スペース区切り)。 これは、'Resource Id' 引数のすべての情報を含む完全なリソース ID である必要があります。 --ids または他の 'Resource Id' 引数を指定する必要があります。

--name -n

アラート処理ルールの名前。

--remove

リストからプロパティまたは要素を削除します。 例: --remove property.list <indexToRemove> OR --remove propertyToRemove.

既定値: []
--resource-group -g

リソース グループの名前。 az configure --defaults group=<name> を使用して、既定のグループを構成できます。

--set

設定するプロパティ パスと値を指定して、オブジェクトを更新します。 例: --set property1.property2=<value>

既定値: []
--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--tags

スペース区切りのタグ: key[=value] [key[=value] ...]既存のタグをクリアするには、"" を使用します。

グローバル パラメーター
--debug

すべてのデバッグ ログを表示するようにログの詳細レベルを上げます。

--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告は抑制します。

--output -o

出力形式。

承認された値: json, jsonc, none, table, tsv, yaml, yamlc
既定値: json
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ をご覧ください。

--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_ID を使用して、既定のサブスクリプションを構成できます。

--verbose

ログの詳細レベルを上げます。 詳細なデバッグ ログを表示するには --debug を使います。