Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
130151c
commit 0011a14
Showing
72 changed files
with
1,434 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
03.Azure资料合集/动手实验/CloudGovernance/Handson_Monitor_Locally.md |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
03.Azure资料合集/动手实验/CloudGovernance/files/monitor/arm-templates/monitor-resources-health.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"activityLogAlertName": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Unique name (within the Resource Group) for the Activity log alert." | ||
} | ||
}, | ||
"actionGroupResourceId": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Resource Id for the Action group." | ||
} | ||
}, | ||
"scopes":{ | ||
"type": "array", | ||
"minLength": 1, | ||
"metadata": { | ||
"description": "Resource Health Monitor is for subscription or resource group or specific resource." | ||
} | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Insights/activityLogAlerts", | ||
"apiVersion": "2017-04-01", | ||
"name": "[parameters('activityLogAlertName')]", | ||
"location": "Global", | ||
"properties": { | ||
"enabled": true, | ||
"scopes": "[parameters('scopes')]", | ||
"condition": { | ||
"allOf": [ | ||
{ | ||
"field": "category", | ||
"equals": "ResourceHealth", | ||
"containsAny": null | ||
}, | ||
{ | ||
"anyOf": [ | ||
{ | ||
"field": "properties.currentHealthStatus", | ||
"equals": "Unavailable", | ||
"containsAny": null | ||
}, | ||
{ | ||
"field": "properties.currentHealthStatus", | ||
"equals": "Degraded", | ||
"containsAny": null | ||
}, | ||
{ | ||
"field": "properties.currentHealthStatus", | ||
"equals": "Unknown", | ||
"containsAny": null | ||
} | ||
] | ||
}, | ||
{ | ||
"anyOf": [ | ||
{ | ||
"field": "properties.previousHealthStatus", | ||
"equals": "Available", | ||
"containsAny": null | ||
} | ||
] | ||
}, | ||
{ | ||
"anyOf": [ | ||
{ | ||
"field": "status", | ||
"equals": "Active", | ||
"containsAny": null | ||
}, | ||
{ | ||
"field": "status", | ||
"equals": "Resolved", | ||
"containsAny": null | ||
}, | ||
{ | ||
"field": "status", | ||
"equals": "InProgress", | ||
"containsAny": null | ||
}, | ||
{ | ||
"field": "status", | ||
"equals": "Updated", | ||
"containsAny": null | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"actions": { | ||
"actionGroups": [ | ||
{ | ||
"actionGroupId": "[parameters('actionGroupResourceId')]" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
211 changes: 211 additions & 0 deletions
211
03.Azure资料合集/动手实验/CloudGovernance/files/monitor/arm-templates/monitor-vms-in-rg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,211 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"alertName": { | ||
"type": "string", | ||
"minLength": 1, | ||
"metadata": { | ||
"description": "Name of the alert" | ||
} | ||
}, | ||
"alertDescription": { | ||
"type": "string", | ||
"defaultValue": "This is a metric alert", | ||
"metadata": { | ||
"description": "Description of alert" | ||
} | ||
}, | ||
"alertSeverity": { | ||
"type": "int", | ||
"defaultValue": 3, | ||
"allowedValues": [ | ||
0, | ||
1, | ||
2, | ||
3, | ||
4 | ||
], | ||
"metadata": { | ||
"description": "Severity of alert {0,1,2,3,4}" | ||
} | ||
}, | ||
"isEnabled": { | ||
"type": "bool", | ||
"defaultValue": true, | ||
"metadata": { | ||
"description": "Specifies whether the alert is enabled" | ||
} | ||
}, | ||
"targetResourceGroup":{ | ||
"type": "array", | ||
"minLength": 1, | ||
"metadata": { | ||
"description": "Full path of the resource group(s) where target resources to be monitored are in. For example - /subscriptions/00000000-0000-0000-0000-0000-00000000/resourceGroups/ResourceGroupName" | ||
} | ||
}, | ||
"targetResourceRegion":{ | ||
"type": "string", | ||
"allowedValues": [ | ||
"EastUS", | ||
"EastUS2", | ||
"CentralUS", | ||
"NorthCentralUS", | ||
"SouthCentralUS", | ||
"WestCentralUS", | ||
"WestUS", | ||
"WestUS2", | ||
"CanadaEast", | ||
"CanadaCentral", | ||
"BrazilSouth", | ||
"NorthEurope", | ||
"WestEurope", | ||
"FranceCentral", | ||
"FranceSouth", | ||
"UKWest", | ||
"UKSouth", | ||
"GermanyCentral", | ||
"GermanyNortheast", | ||
"GermanyNorth", | ||
"GermanyWestCentral", | ||
"SwitzerlandNorth", | ||
"SwitzerlandWest", | ||
"NorwayEast", | ||
"NorwayWest", | ||
"SoutheastAsia", | ||
"EastAsia", | ||
"AustraliaEast", | ||
"AustraliaSoutheast", | ||
"AustraliaCentral", | ||
"AustraliaCentral2", | ||
"ChinaEast", | ||
"ChinaNorth", | ||
"ChinaEast2", | ||
"ChinaNorth2", | ||
"CentralIndia", | ||
"WestIndia", | ||
"SouthIndia", | ||
"JapanEast", | ||
"JapanWest", | ||
"KoreaCentral", | ||
"KoreaSouth", | ||
"SouthAfricaWest", | ||
"SouthAfricaNorth", | ||
"UAECentral", | ||
"UAENorth" | ||
], | ||
"metadata": { | ||
"description": "Azure region in which target resources to be monitored are in (without spaces). For example: EastUS" | ||
} | ||
}, | ||
"targetResourceType": { | ||
"type": "string", | ||
"minLength": 1, | ||
"metadata": { | ||
"description": "Resource type of target resources to be monitored. Currently only supported resource type is Microsoft.Compute/virtualMachines" | ||
} | ||
}, | ||
"metricName": { | ||
"type": "string", | ||
"minLength": 1, | ||
"metadata": { | ||
"description": "Name of the metric used in the comparison to activate the alert." | ||
} | ||
}, | ||
"operator": { | ||
"type": "string", | ||
"defaultValue": "GreaterThan", | ||
"allowedValues": [ | ||
"Equals", | ||
"NotEquals", | ||
"GreaterThan", | ||
"GreaterThanOrEqual", | ||
"LessThan", | ||
"LessThanOrEqual" | ||
], | ||
"metadata": { | ||
"description": "Operator comparing the current value with the threshold value." | ||
} | ||
}, | ||
"threshold": { | ||
"type": "string", | ||
"defaultValue": "0", | ||
"metadata": { | ||
"description": "The threshold value at which the alert is activated." | ||
} | ||
}, | ||
"timeAggregation": { | ||
"type": "string", | ||
"defaultValue": "Average", | ||
"allowedValues": [ | ||
"Average", | ||
"Minimum", | ||
"Maximum", | ||
"Total", | ||
"Count" | ||
], | ||
"metadata": { | ||
"description": "How the data that is collected should be combined over time." | ||
} | ||
}, | ||
"windowSize": { | ||
"type": "string", | ||
"defaultValue": "PT5M", | ||
"metadata": { | ||
"description": "Period of time used to monitor alert activity based on the threshold. Must be between five minutes and one day. ISO 8601 duration format." | ||
} | ||
}, | ||
"evaluationFrequency": { | ||
"type": "string", | ||
"defaultValue": "PT1M", | ||
"metadata": { | ||
"description": "how often the metric alert is evaluated represented in ISO 8601 duration format" | ||
} | ||
}, | ||
"actionGroupId": { | ||
"type": "string", | ||
"defaultValue": "", | ||
"metadata": { | ||
"description": "The ID of the action group that is triggered when the alert is activated or deactivated" | ||
} | ||
} | ||
}, | ||
"variables": { }, | ||
"resources": [ | ||
{ | ||
"name": "[parameters('alertName')]", | ||
"type": "Microsoft.Insights/metricAlerts", | ||
"location": "global", | ||
"apiVersion": "2018-03-01", | ||
"tags": {}, | ||
"properties": { | ||
"description": "[parameters('alertDescription')]", | ||
"severity": "[parameters('alertSeverity')]", | ||
"enabled": "[parameters('isEnabled')]", | ||
"scopes": "[parameters('targetResourceGroup')]", | ||
"targetResourceType": "[parameters('targetResourceType')]", | ||
"targetResourceRegion": "[parameters('targetResourceRegion')]", | ||
"evaluationFrequency":"[parameters('evaluationFrequency')]", | ||
"windowSize": "[parameters('windowSize')]", | ||
"criteria": { | ||
"odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", | ||
"allOf": [ | ||
{ | ||
"name" : "1st criterion", | ||
"metricName": "[parameters('metricName')]", | ||
"dimensions":[], | ||
"operator": "[parameters('operator')]", | ||
"threshold" : "[parameters('threshold')]", | ||
"timeAggregation": "[parameters('timeAggregation')]" | ||
} | ||
] | ||
}, | ||
"actions": [ | ||
{ | ||
"actionGroupId": "[parameters('actionGroupId')]" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
42 changes: 42 additions & 0 deletions
42
03.Azure资料合集/动手实验/CloudGovernance/files/monitor/arm-templates/vm-cpu-high.parameters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"alertName": { | ||
"value": "VM CPU is higher" | ||
}, | ||
"alertDescription": { | ||
"value": "Need take action when VM CPU is higher" | ||
}, | ||
"alertSeverity": { | ||
"value":2 | ||
}, | ||
"isEnabled": { | ||
"value": true | ||
}, | ||
"targetResourceGroup":{ | ||
"value": [] | ||
}, | ||
"targetResourceRegion":{ | ||
"value": "EastUS" | ||
}, | ||
"targetResourceType":{ | ||
"value": "Microsoft.Compute/virtualMachines" | ||
}, | ||
"metricName": { | ||
"value": "Percentage CPU" | ||
}, | ||
"operator": { | ||
"value": "GreaterThan" | ||
}, | ||
"threshold": { | ||
"value": "75" | ||
}, | ||
"timeAggregation": { | ||
"value": "Average" | ||
}, | ||
"actionGroupId": { | ||
"value": "" | ||
} | ||
} | ||
} |
Oops, something went wrong.