az monitor alert-processing-rule
Note
This reference is part of the alertsmanagement extension for the Azure CLI (version 2.45.0 or higher). 拡張機能は、az monitor alert-processing-rule コマンドを初めて実行するときに自動的にインストールされます。 Learn more about extensions.
このコマンド グループはプレビュー段階であり、開発中です。 参照レベルとサポート レベル: https://aka.ms/CLI_refstatus
alertsmanagement を使用してアラート処理ルールを管理します。
コマンド
名前 | 説明 | 型 | 状態 |
---|---|---|---|
az monitor alert-processing-rule create |
アラート処理ルールを作成します。 |
Extension | Preview |
az monitor alert-processing-rule delete |
アラート処理ルールを削除します。 |
Extension | Preview |
az monitor alert-processing-rule list |
サブスクリプションまたはリソース グループ内のすべてのアラート処理ルールを一覧表示します。 |
Extension | Preview |
az monitor alert-processing-rule show |
アラート処理ルールを取得します。 |
Extension | Preview |
az monitor alert-processing-rule update |
アラート処理ルールのタグを有効、無効、または更新します。 |
Extension | Preview |
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"
営業時間外にすべてのアクション グループを削除するルールを作成または更新します (東部標準時Mon-Fri 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"
必須のパラメーター
アラート処理ルールの名前。
リソース グループの名前。
az configure --defaults group=<name>
を使用して既定のグループを構成できます。
アラート処理ルールの種類を示します。
プロパティ | 値 |
---|---|
指定可能な値: | AddActionGroups, RemoveAllActionGroups |
スコープのリソース ID (スペース区切り) の一覧。 ルールは、そのスコープ内のリソースに対して発生したアラートに適用されます。
省略可能のパラメーター
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
追加するアクション グループのリソース ID (スペース区切り) の一覧。 この引数を使用するには、ルールの種類が AddActionGroups である必要があります。
アラート処理ルールの説明。
指定されたアラート処理ルールが有効か無効か (既定値は有効) を示します。
プロパティ | 値 |
---|---|
指定可能な値: | false, true |
アラート コンテキスト (ペイロード) でアラートをフィルター処理します。
フィルター形式は <operator> <space-delimited values>
です。演算子: Equals、NotEquals、Contains、DoesNotContain Values: List of values to match for a given condition.
プロパティ | 値 |
---|---|
Parameter group: | Filter Arguments |
アラート ルールの説明でアラートをフィルター処理します。
プロパティ | 値 |
---|---|
Parameter group: | Filter Arguments |
アラート ID でアラートをフィルター処理します。
プロパティ | 値 |
---|---|
Parameter group: | Filter Arguments |
アラート ルール名でアラートをフィルター処理します。
プロパティ | 値 |
---|---|
Parameter group: | Filter Arguments |
モニター条件でアラートをフィルター処理します。
プロパティ | 値 |
---|---|
Parameter group: | Filter Arguments |
モニター サービスでアラートをフィルター処理します。
プロパティ | 値 |
---|---|
Parameter group: | Filter Arguments |
リソース グループでアラートをフィルター処理します。
プロパティ | 値 |
---|---|
Parameter group: | Filter Arguments |
リソースの種類でアラートをフィルター処理します。
プロパティ | 値 |
---|---|
Parameter group: | Filter Arguments |
重大度 Sev0、Sev1、Sev2、Sev3、Sev4 でアラートをフィルター処理します。
プロパティ | 値 |
---|---|
Parameter group: | Filter Arguments |
シグナルの種類でアラートをフィルター処理します。
プロパティ | 値 |
---|---|
Parameter group: | Filter Arguments |
リソースでアラートをフィルター処理します。
プロパティ | 値 |
---|---|
Parameter group: | Filter Arguments |
ルールの終了日。 形式: 'YYYY-MM-DD hh:mm:ss'。
プロパティ | 値 |
---|---|
Parameter group: | Schedule Arguments |
繰り返しパターン値の一覧。
--schedule-recurrence : 繰り返しパターン値の一覧 (スペース区切り)。 週単位の繰り返しの種類の場合、使用できる値は日曜日から土曜日です。 毎月の繰り返しの種類の場合、使用できる値は 1 ~ 31 (月の日) です。
プロパティ | 値 |
---|---|
Parameter group: | Schedule First Recurrence Arguments |
2 番目の繰り返しパターンの繰り返しパターン値の一覧。
--schedule-recurrence-2: 繰り返しパターン値の一覧 (スペース区切り)。 週単位の繰り返しの種類の場合、使用できる値は日曜日から土曜日です。 毎月の繰り返しの種類の場合、使用できる値は 1 ~ 31 (月の日) です。
プロパティ | 値 |
---|---|
Parameter group: | Schedule Second Recurrence Arguments |
各繰り返しの終了時刻。 Format: hh:mm:ss.
プロパティ | 値 |
---|---|
Parameter group: | Schedule Second Recurrence Arguments |
各繰り返しの開始時刻。 Format: hh:mm:ss.
プロパティ | 値 |
---|---|
Parameter group: | Schedule Second Recurrence Arguments |
処理規則を適用するタイミングを指定します。 既定値は Always です。
プロパティ | 値 |
---|---|
Parameter group: | Schedule Second Recurrence Arguments |
指定可能な値: | Daily, Monthly, Weekly |
各繰り返しの終了時刻。 Format: 'hh:mm:ss'.
プロパティ | 値 |
---|---|
Parameter group: | Schedule First Recurrence Arguments |
各繰り返しの開始時刻。 Format: 'hh:mm:ss'.
プロパティ | 値 |
---|---|
Parameter group: | Schedule First Recurrence Arguments |
処理規則を適用するタイミングを指定します。
プロパティ | 値 |
---|---|
Parameter group: | Schedule First Recurrence Arguments |
指定可能な値: | Daily, Monthly, Weekly |
ルールの開始日。 形式: 'YYYY-MM-DD hh:mm:ss'。
プロパティ | 値 |
---|---|
Parameter group: | Schedule Arguments |
タイム ゾーンをスケジュールします。
プロパティ | 値 |
---|---|
Parameter group: | Schedule Arguments |
規定値: | UTC |
スペース区切りのタグ: key[=value] [key[=value] ...]既存のタグをクリアするには、"" を使用します。
グローバル パラメーター
ログの詳細度を上げて、すべてのデバッグ ログを表示します。
プロパティ | 値 |
---|---|
規定値: | False |
このヘルプ メッセージを表示して終了します。
エラーのみを表示し、警告を抑制します。
プロパティ | 値 |
---|---|
規定値: | False |
Output format.
プロパティ | 値 |
---|---|
規定値: | json |
指定可能な値: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ を参照してください。
サブスクリプションの名前または ID。
az account set -s NAME_OR_ID
を使用して既定のサブスクリプションを構成できます。
ログの詳細度を高める。 完全なデバッグ ログには --debug を使用します。
プロパティ | 値 |
---|---|
規定値: | False |
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
省略可能のパラメーター
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
1 つ以上のリソース ID (スペース区切り)。 これは、'Resource Id' 引数のすべての情報を含む完全なリソース ID である必要があります。 --ids または他の 'Resource Id' 引数を指定する必要があります。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
アラート処理ルールの名前。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
リソース グループの名前。
az configure --defaults group=<name>
を使用して既定のグループを構成できます。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
サブスクリプションの名前または ID。
az account set -s NAME_OR_ID
を使用して既定のサブスクリプションを構成できます。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
確認を求めないでください。
プロパティ | 値 |
---|---|
規定値: | False |
グローバル パラメーター
ログの詳細度を上げて、すべてのデバッグ ログを表示します。
プロパティ | 値 |
---|---|
規定値: | False |
このヘルプ メッセージを表示して終了します。
エラーのみを表示し、警告を抑制します。
プロパティ | 値 |
---|---|
規定値: | False |
Output format.
プロパティ | 値 |
---|---|
規定値: | json |
指定可能な値: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ を参照してください。
ログの詳細度を高める。 完全なデバッグ ログには --debug を使用します。
プロパティ | 値 |
---|---|
規定値: | False |
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
省略可能のパラメーター
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
リソース グループの名前。
az configure --defaults group=<name>
を使用して既定のグループを構成できます。
グローバル パラメーター
ログの詳細度を上げて、すべてのデバッグ ログを表示します。
プロパティ | 値 |
---|---|
規定値: | False |
このヘルプ メッセージを表示して終了します。
エラーのみを表示し、警告を抑制します。
プロパティ | 値 |
---|---|
規定値: | False |
Output format.
プロパティ | 値 |
---|---|
規定値: | json |
指定可能な値: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ を参照してください。
サブスクリプションの名前または ID。
az account set -s NAME_OR_ID
を使用して既定のサブスクリプションを構成できます。
ログの詳細度を高める。 完全なデバッグ ログには --debug を使用します。
プロパティ | 値 |
---|---|
規定値: | False |
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
省略可能のパラメーター
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
1 つ以上のリソース ID (スペース区切り)。 これは、'Resource Id' 引数のすべての情報を含む完全なリソース ID である必要があります。 --ids または他の 'Resource Id' 引数を指定する必要があります。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
アラート処理ルールの名前。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
リソース グループの名前。
az configure --defaults group=<name>
を使用して既定のグループを構成できます。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
サブスクリプションの名前または ID。
az account set -s NAME_OR_ID
を使用して既定のサブスクリプションを構成できます。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
グローバル パラメーター
ログの詳細度を上げて、すべてのデバッグ ログを表示します。
プロパティ | 値 |
---|---|
規定値: | False |
このヘルプ メッセージを表示して終了します。
エラーのみを表示し、警告を抑制します。
プロパティ | 値 |
---|---|
規定値: | False |
Output format.
プロパティ | 値 |
---|---|
規定値: | json |
指定可能な値: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ を参照してください。
ログの詳細度を高める。 完全なデバッグ ログには --debug を使用します。
プロパティ | 値 |
---|---|
規定値: | False |
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"
省略可能のパラメーター
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
パスとキー値のペアを指定して、オブジェクトの一覧にオブジェクトを追加します。 例: --add property.listProperty <key=value, string or JSON string>
。
プロパティ | 値 |
---|---|
Parameter group: | Generic Update Arguments |
規定値: | [] |
指定された処理ルールが有効または無効になっているかどうかを示します (値は True と False)。
プロパティ | 値 |
---|---|
指定可能な値: | false, true |
'set' または 'add' を使用する場合は、JSON に変換するのではなく、文字列リテラルを保持します。
プロパティ | 値 |
---|---|
Parameter group: | Generic Update Arguments |
規定値: | False |
1 つ以上のリソース ID (スペース区切り)。 これは、'Resource Id' 引数のすべての情報を含む完全なリソース ID である必要があります。 --ids または他の 'Resource Id' 引数を指定する必要があります。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
アラート処理ルールの名前。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
リストからプロパティまたは要素を削除します。 例: --remove property.list <indexToRemove>
OR --remove propertyToRemove
。
プロパティ | 値 |
---|---|
Parameter group: | Generic Update Arguments |
規定値: | [] |
リソース グループの名前。
az configure --defaults group=<name>
を使用して既定のグループを構成できます。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
設定するプロパティ パスと値を指定して、オブジェクトを更新します。 例: --set property1.property2=<value>
。
プロパティ | 値 |
---|---|
Parameter group: | Generic Update Arguments |
規定値: | [] |
サブスクリプションの名前または ID。
az account set -s NAME_OR_ID
を使用して既定のサブスクリプションを構成できます。
プロパティ | 値 |
---|---|
Parameter group: | Resource Id Arguments |
スペース区切りのタグ: key[=value] [key[=value] ...]既存のタグをクリアするには、"" を使用します。
グローバル パラメーター
ログの詳細度を上げて、すべてのデバッグ ログを表示します。
プロパティ | 値 |
---|---|
規定値: | False |
このヘルプ メッセージを表示して終了します。
エラーのみを表示し、警告を抑制します。
プロパティ | 値 |
---|---|
規定値: | False |
Output format.
プロパティ | 値 |
---|---|
規定値: | json |
指定可能な値: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ を参照してください。
ログの詳細度を高める。 完全なデバッグ ログには --debug を使用します。
プロパティ | 値 |
---|---|
規定値: | False |