JSON |
EPAC
|
{7 items - policyType: "Custom",
- mode: "All",
- displayName: "Deploy VM Available Memory Alert",
- description: "Policy to audit/deploy VM Available Memory Alert",
- metadata: {5 items
- version: "1.2.0",
- category: "Compute",
- source: "https://github.com/Azure/azure-monitor-baseline-alerts/",
- alzCloudEnvironments: [1 item],
- _deployed_by_amba: "True"
}, - parameters: {8 items
- severity: {4 items},
- windowSize: {4 items
- type: "String",
- metadata: {2 items
- displayName: "Window Size",
- description: "Window size for the alert"
}, - allowedValues: [8 items
- "PT1M",
- "PT5M",
- "PT15M",
- "PT30M",
- "PT1H",
- "PT6H",
- "PT12H",
- "P1D"
], - defaultValue: "PT5M"
}, - evaluationFrequency: {4 items},
- autoMitigate: {4 items},
- enabled: {4 items},
- threshold: {3 items
- type: "String",
- metadata: {2 items
- displayName: "Threshold",
- description: "Threshold for the alert"
}, - defaultValue: "1000"
}, - effect: {4 items},
- MonitorDisable: {3 items
- type: "String",
- metadata: {2 items
- displayName: "Effect",
- description: "Tag name to disable monitoring resource. Set to true if monitoring should be disabled"
}, - defaultValue: "MonitorDisable"
} }, - policyRule: {2 items
- if: {1 item
- allOf: [2 items
- {2 items
- field: "type",
- equals: "Microsoft.Compute/virtualMachines"
}, - {2 items
- field: 🔍"[
concat(
'tags[
',
parameters('MonitorDisable'),
'
]'
)
]",
- notEquals: "true"
} ] }, - then: {2 items
- effect: "[parameters('effect')]",
- details: {4 items
- roleDefinitionIds: [1 item
- "/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c"
], - type: "Microsoft.Insights/metricAlerts",
- existenceCondition: {1 item
- allOf: [11 items
- {2 items
- field: "Microsoft.Insights/metricAlerts/criteria.Microsoft-Azure-Monitor-SingleResourceMultipleMetricCriteria.allOf[*].metricNamespace",
- equals: "Microsoft.Compute/virtualMachines"
}, - {2 items
- field: "Microsoft.Insights/metricAlerts/criteria.Microsoft-Azure-Monitor-SingleResourceMultipleMetricCriteria.allOf[*].metricName",
- equals: "Available Memory Bytes"
}, - {2 items
- field: "Microsoft.Insights/metricalerts/scopes[*]",
- equals: 🔍"[
concat(
subscription().id,
'/resourceGroups/',
resourceGroup().name,
'/providers/Microsoft.Compute/virtualMachines/',
field('fullName')
)
]"
}, - {2 items
- field: "Microsoft.Insights/metricAlerts/enabled",
- equals: "[parameters('enabled')]"
}, - {2 items
- field: "Microsoft.Insights/metricAlerts/evaluationFrequency",
- equals: "[parameters('evaluationFrequency')]"
}, - {2 items
- field: "Microsoft.Insights/metricAlerts/windowSize",
- equals: "[parameters('windowSize')]"
}, - {2 items
- field: "Microsoft.Insights/metricalerts/severity",
- equals: "[parameters('severity')]"
}, - {2 items
- field: "Microsoft.Insights/metricAlerts/autoMitigate",
- equals: "[parameters('autoMitigate')]"
}, - {2 items
- field: "Microsoft.Insights/metricAlerts/criteria.Microsoft-Azure-Monitor-SingleResourceMultipleMetricCriteria.allOf[*].timeAggregation",
- equals: "Average"
}, - {2 items
- field: "Microsoft.Insights/metricAlerts/criteria.Microsoft-Azure-Monitor-SingleResourceMultipleMetricCriteria.allOf[*].operator",
- equals: "LessThan"
}, - {2 items
- field: "Microsoft.Insights/metricAlerts/criteria.Microsoft-Azure-Monitor-SingleResourceMultipleMetricCriteria.allOf[*].threshold",
- equals: "[parameters('threshold')]"
} ] }, - deployment: {1 item
- properties: {3 items
- mode: "incremental",
- template: {5 items
- $schema: "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
- contentVersion: "1.0.0.0",
- parameters: {8 items
- resourceName: {2 items
- type: "String",
- metadata: {2 items
- displayName: "resourceName",
- description: "Name of the resource"
} }, - resourceId: {2 items
- type: "String",
- metadata: {2 items
- displayName: "resourceId",
- description: "Resource ID of the resource emitting the metric that will be used for the comparison"
} }, - severity: {1 item},
- windowSize: {1 item},
- evaluationFrequency: {1 item},
- autoMitigate: {1 item},
- enabled: {1 item},
- threshold: {1 item}
}, - variables: {},
- resources: [1 item
- {6 items
- type: "Microsoft.Insights/metricAlerts",
- apiVersion: "2018-03-01",
- name: 🔍"[
concat(
parameters('resourceName'),
'-AvailableMemoryAlert'
)
]",
- location: "global",
- tags: {1 item},
- properties: {9 items
- description: "Metric Alert for Virtual Machine Available Memory (MBytes)",
- severity: "[parameters('severity')]",
- enabled: "[parameters('enabled')]",
- scopes: [1 item
- "[parameters('resourceId')]"
], - evaluationFrequency: "[parameters('evaluationFrequency')]",
- windowSize: "[parameters('windowSize')]",
- criteria: {2 items
- allOf: [1 item
- {7 items
- name: "Average_AvailableMBytes",
- metricNamespace: "Microsoft.Compute/virtualMachines",
- metricName: "Available Memory Bytes",
- operator: "LessThan",
- threshold: "[parameters('threshold')]",
- timeAggregation: "Average",
- criterionType: "StaticThresholdCriterion"
} ], - odata.type: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"
}, - autoMitigate: "[parameters('autoMitigate')]",
- parameters: {6 items}
} } ] }, - parameters: {8 items}
} } } } } }
|
|