az monitor alert-processing-rule

참고 항목

이 참조는 Azure CLI(버전 2.45.0 이상)에 대한 alertsmanagement 확장의 일부입니다. az monitor alert-processing-rule 명령을 처음 실행할 때 확장이 자동으로 설치됩니다. 확장 프로그램에 대해 자세히 알아보세요.

이 명령 그룹은 미리 보기 상태이며 개발 중입니다. 참조 및 지원 수준: https://aka.ms/CLI_refstatus

alertsmanagement를 사용하여 경고 처리 규칙을 관리합니다.

명령

Name Description 형식 상태
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"

두 리소스 그룹의 모든 Sev0 및 Sev1 경고에 두 개의 작업 그룹을 추가하는 규칙을 만들거나 업데이트합니다.

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"

일회성 기본 테넌트 기간 동안 특정 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"

반복 기본 기간 동안 두 리소스 그룹의 모든 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

경고 컨텍스트(페이로드)로 경고를 필터링합니다.

필터 형식은 여기서 연산자: Equals, 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

두 번째 되풀이 패턴의 되풀이 패턴 값 목록입니다.

--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

하나 이상의 리소스 ID(공백으로 구분)입니다. '리소스 ID' 인수의 모든 정보를 포함하는 전체 리소스 ID여야 합니다. --ids 또는 다른 '리소스 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

하나 이상의 리소스 ID(공백으로 구분)입니다. '리소스 ID' 인수의 모든 정보를 포함하는 전체 리소스 ID여야 합니다. --ids 또는 다른 '리소스 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

하나 이상의 리소스 ID(공백으로 구분)입니다. '리소스 ID' 인수의 모든 정보를 포함하는 전체 리소스 ID여야 합니다. --ids 또는 다른 '리소스 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를 사용합니다.