Get-AzAlertHistory
取得警示的歷程記錄。
語法
Get-AzAlertHistory
[-ResourceId <String>]
[-StartTime <DateTime>]
[-EndTime <DateTime>]
[-Status <String>]
[-Caller <String>]
[-DetailedOutput]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Get-AzAlertHistory Cmdlet 會在警示啟用、停用、引發、已解決等等時取得警示的歷程記錄。
範例
範例 1:取得警示歷程記錄
PS C:\>Get-AzAlertHistory -StartTime 2015-02-11T11:00:00 -EndTime 2015-02-11T12:00:00 -DetailedOutput
Authorization :
Caller : Microsoft.Insights/alertRules
Claims :
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn: Microsoft.Insights/alertRules
CorrelationId : /subscriptions/aaaa0000-bb11-2222-33cc-444444dddddd/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/incidents/L3N1YnNj
cmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2Vi
LUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2FsZXJ0cnVsZXMvY2hlY2tydWxlMy00YjEzNTQwMS1hMzBj
LTQyMjQtYWUyMS1mYTUzYTViZDI1M2QwNjM1NTkyNzg4ODU3OTI5OTI2
Description : 'CpuTime GreaterThan 3 ([Count]) in the last 5 minutes' has been resolved for Website:
garyyang1 (Default-Web-EastUS)
EventDataId : 769fab1c-fc9f-4e18-bc3a-fa79fbdd3616
EventName : Alert
EventSource : microsoft.insights/alertrules
EventTimestamp : 2/11/2015 7:14:45 PM
HttpRequest :
Id : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/events/769fab1c-fc
9f-4e18-bc3a-fa79fbdd3616/ticks/635592788857929926
Level : Informational
OperationId : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/incidents/L3N1YnNj
cmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2Vi
LUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2FsZXJ0cnVsZXMvY2hlY2tydWxlMy00YjEzNTQwMS1hMzBj
LTQyMjQtYWUyMS1mYTUzYTViZDI1M2QwNjM1NTkyNzg4ODU3OTI5OTI2
OperationName : ResolveAlert
Properties :
RuleUri : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-
EastUS/providers/microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
RuleName : checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
RuleDescription:
Threshold : 3
WindowSizeInMinutes: 5
Aggregation : Total
Operator : GreaterThan
MetricName : CpuTime
MetricUnit : Count
ResourceGroupName : Default-Web-EastUS
ResourceProviderName : microsoft.insights
ResourceId : /subscriptions/ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
Status : Resolved
SubmissionTimestamp : 2/11/2015 7:14:45 PM
SubscriptionId : ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0
SubStatus :
Authorization :
Caller : Microsoft.Insights/alertRules
Claims :
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn: Microsoft.Insights/alertRules
CorrelationId : /subscriptions/aaaa0000-bb11-2222-33cc-444444dddddd/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/incidents/L3N1YnNj
cmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2Vi
LUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2FsZXJ0cnVsZXMvY2hlY2tydWxlMy00YjEzNTQwMS1hMzBj
LTQyMjQtYWUyMS1mYTUzYTViZDI1M2QwNjM1NTkyNzgyODY1MDU5NTE0
Description : 'CpuTime GreaterThan 3 ([Count]) in the last 5 minutes' was activated for Website: garyyang1
(Default-Web-EastUS)
EventDataId : 66277c94-2097-4f5f-860d-e585f1206cd7
EventName : Alert
EventSource : microsoft.insights/alertrules
EventTimestamp : 2/11/2015 7:04:46 PM
HttpRequest :
Id : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-EastUS/providers/
microsoft.web/sites/garyyang1/events/66277c94-2097-4f5f-860d-e585f1206cd7/ticks/6355927828650595
14
Level : Error
OperationId : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/incidents/L3N1YnNj
cmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2Vi
LUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2FsZXJ0cnVsZXMvY2hlY2tydWxlMy00YjEzNTQwMS1hMzBj
LTQyMjQtYWUyMS1mYTUzYTViZDI1M2QwNjM1NTkyNzgyODY1MDU5NTE0
OperationName : ActivateAlert
Properties :
RuleUri : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-
EastUS/providers/microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
RuleName : checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
RuleDescription:
Threshold : 3
WindowSizeInMinutes: 5
Aggregation : Total
Operator : GreaterThan
MetricName : CpuTime
MetricUnit : Count
ResourceGroupName : Default-Web-EastUS
ResourceProviderName : microsoft.web
ResourceId : /subscriptions/ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0/resourceGroups/Default-Web-EastUS/providers/
microsoft.web/sites/garyyang1
Status : Activated
SubmissionTimestamp : 2/11/2015 7:04:46 PM
SubscriptionId : ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0
SubStatus :
Authorization :
Caller : Microsoft.Insights/alertRules
Claims :
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn: Microsoft.Insights/alertRules
CorrelationId : /subscriptions/aaaa0000-bb11-2222-33cc-444444dddddd/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/incidents/L3N1YnNj
cmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2Vi
LUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2FsZXJ0cnVsZXMvY2hlY2tydWxlMy00YjEzNTQwMS1hMzBj
LTQyMjQtYWUyMS1mYTUzYTViZDI1M2QwNjM1NTkyNzgyODY1MDU5NTE0
Description : 'CpuTime GreaterThan 3 ([Count]) in the last 5 minutes' was activated for Website: garyyang1
(Default-Web-EastUS)
EventDataId : ec9f7b3c-c6ea-4b45-bd15-ff43e38491e3
EventName : Alert
EventSource : microsoft.insights/alertrules
EventTimestamp : 2/11/2015 7:04:46 PM
HttpRequest :
Id : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/events/ec9f7b3c-c6
ea-4b45-bd15-ff43e38491e3/ticks/635592782865059514
Level : Error
OperationId : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/incidents/L3N1YnNj
cmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2Vi
LUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2FsZXJ0cnVsZXMvY2hlY2tydWxlMy00YjEzNTQwMS1hMzBj
LTQyMjQtYWUyMS1mYTUzYTViZDI1M2QwNjM1NTkyNzgyODY1MDU5NTE0
OperationName : ActivateAlert
Properties :
RuleUri : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-
EastUS/providers/microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
RuleName : checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
RuleDescription:
Threshold : 3
WindowSizeInMinutes: 5
Aggregation : Total
Operator : GreaterThan
MetricName : CpuTime
MetricUnit : Count
ResourceGroupName : Default-Web-EastUS
ResourceProviderName : microsoft.insights
ResourceId : /subscriptions/ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
Status : Activated
SubmissionTimestamp : 2/11/2015 7:04:46 PM
SubscriptionId : ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0
SubStatus :
此命令會取得目前訂用帳戶指定時間範圍的警示歷程記錄。
範例 2:取得指定資源的警示歷程記錄
PS C:\>Get-AzAlertHistory -StartTime 2015-02-11T11:00:00 -EndTime 2015-02-11T12:00:00 -ResourceId "/subscriptions/ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0/resourceGroups/Default-Web-EastUS/providers/microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1" -DetailedOutput
Authorization :
Caller : Microsoft.Insights/alertRules
Claims :
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn: Microsoft.Insights/alertRules
CorrelationId : /subscriptions/aaaa0000-bb11-2222-33cc-444444dddddd/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/incidents/L3N1YnNj
cmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2Vi
LUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2FsZXJ0cnVsZXMvY2hlY2tydWxlMy00YjEzNTQwMS1hMzBj
LTQyMjQtYWUyMS1mYTUzYTViZDI1M2QwNjM1NTkyNzg4ODU3OTI5OTI2
Description : 'CpuTime GreaterThan 3 ([Count]) in the last 5 minutes' has been resolved for Website:
garyyang1 (Default-Web-EastUS)
EventDataId : 769fab1c-fc9f-4e18-bc3a-fa79fbdd3616
EventName : Alert
EventSource : microsoft.insights/alertrules
EventTimestamp : 2/11/2015 7:14:45 PM
HttpRequest :
Id : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/events/769fab1c-fc
9f-4e18-bc3a-fa79fbdd3616/ticks/635592788857929926
Level : Informational
OperationId : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/incidents/L3N1YnNj
cmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2Vi
LUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2FsZXJ0cnVsZXMvY2hlY2tydWxlMy00YjEzNTQwMS1hMzBj
LTQyMjQtYWUyMS1mYTUzYTViZDI1M2QwNjM1NTkyNzg4ODU3OTI5OTI2
OperationName : ResolveAlert
Properties :
RuleUri : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-
EastUS/providers/microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
RuleName : checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
RuleDescription:
Threshold : 3
WindowSizeInMinutes: 5
Aggregation : Total
Operator : GreaterThan
MetricName : CpuTime
MetricUnit : Count
ResourceGroupName : Default-Web-EastUS
ResourceProviderName : microsoft.insights
ResourceId : /subscriptions/ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
Status : Resolved
SubmissionTimestamp : 2/11/2015 7:14:45 PM
SubscriptionId : ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0
SubStatus :
Authorization :
Caller : Microsoft.Insights/alertRules
Claims :
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn: Microsoft.Insights/alertRules
CorrelationId : /subscriptions/aaaa0000-bb11-2222-33cc-444444dddddd/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/incidents/L3N1YnNj
cmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2Vi
LUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2FsZXJ0cnVsZXMvY2hlY2tydWxlMy00YjEzNTQwMS1hMzBj
LTQyMjQtYWUyMS1mYTUzYTViZDI1M2QwNjM1NTkyNzgyODY1MDU5NTE0
Description : 'CpuTime GreaterThan 3 ([Count]) in the last 5 minutes' was activated for Website: garyyang1
(Default-Web-EastUS)
EventDataId : ec9f7b3c-c6ea-4b45-bd15-ff43e38491e3
EventName : Alert
EventSource : microsoft.insights/alertrules
EventTimestamp : 2/11/2015 7:04:46 PM
HttpRequest :
Id : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/events/ec9f7b3c-c6
ea-4b45-bd15-ff43e38491e3/ticks/635592782865059514
Level : Error
OperationId : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/incidents/L3N1YnNj
cmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2Vi
LUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0Lmluc2lnaHRzL2FsZXJ0cnVsZXMvY2hlY2tydWxlMy00YjEzNTQwMS1hMzBj
LTQyMjQtYWUyMS1mYTUzYTViZDI1M2QwNjM1NTkyNzgyODY1MDU5NTE0
OperationName : ActivateAlert
Properties :
RuleUri : /subscriptions/00001111-aaaa-2222-bbbb-3333cccc4444/resourceGroups/Default-Web-
EastUS/providers/microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
RuleName : checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
RuleDescription:
Threshold : 3
WindowSizeInMinutes: 5
Aggregation : Total
Operator : GreaterThan
MetricName : CpuTime
MetricUnit : Count
ResourceGroupName : Default-Web-EastUS
ResourceProviderName : microsoft.insights
ResourceId : /subscriptions/ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0/resourceGroups/Default-Web-EastUS/providers/
microsoft.insights/alertrules/checkrule3-a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1
Status : Activated
SubmissionTimestamp : 2/11/2015 7:04:46 PM
SubscriptionId : ffffffff-eeee-dddd-cccc-bbbbbbbbbbb0
SubStatus :
此命令會取得指定資源的警示規則相關事件。
參數
-Caller
指定呼叫端。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DetailedOutput
在輸出中顯示完整詳細數據。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-EndTime
指定當地時間查詢的結束時間。 預設值為目前時間。
類型: | Nullable<T>[DateTime] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-ResourceId
指定規則相關聯的資源識別碼。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-StartTime
指定當地時間查詢的開始時間。 預設值為目前的本地時間減去一小時。
類型: | Nullable<T>[DateTime] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-Status
指定狀態。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
輸入
Nullable<T>[[System.DateTime, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]