mirror of
https://github.com/alerta/alerta-contrib.git
synced 2024-12-12 07:27:34 +00:00
.. | ||
alerta_azuremonitor.py | ||
README.md | ||
setup.py | ||
test_azuremonitor.py |
Azure Monitor Webhook
Receive Azure Monitor notifications via webhook callbacks.
Installation
Clone the GitHub repo and run:
$ python setup.py install
Or, to install remotely from GitHub run:
$ pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=webhooks/azuremonitor
Note: If Alerta is installed in a python virtual environment then plugins need to be installed into the same environment for Alerta to dynamically discover them.
Configuration
The custom webhook will be auto-detected and added to the list of available API endpoints.
Add the Alerta API webhook URL in the Azure portal.
https://docs.microsoft.com/sv-se/azure/monitoring-and-diagnostics/insights-webhooks-alerts
Example Output
{
"status": "Activated",
"context": {
"timestamp": "2015-08-14T22:26:41.9975398Z",
"id": "/subscriptions/s1/resourceGroups/useast/providers/microsoft.insights/alertrules/ruleName1",
"name": "ruleName1",
"description": "some description",
"conditionType": "Metric",
"condition": {
"metricName": "Requests",
"metricUnit": "Count",
"metricValue": "10",
"threshold": "10",
"windowSize": "15",
"timeAggregation": "Average",
"operator": "GreaterThanOrEqual"
},
"subscriptionId": "s1",
"resourceGroupName": "useast",
"resourceName": "mysite1",
"resourceType": "microsoft.foo/sites",
"resourceId": "/subscriptions/s1/resourceGroups/useast/providers/microsoft.foo/sites/mysite1",
"resourceRegion": "centralus",
"portalLink": "https://portal.azure.com/#resource/subscriptions/s1/resourceGroups/useast/providers/microsoft.foo/sites/mysite1"
},
"properties": {
"key1": "value1",
"key2": "value2"
}
}
References
- Azure Monitor: https://docs.microsoft.com/azure/monitoring-and-diagnostics/monitor-alerts-unified-usage
License
Copyright (c) 2018 Anton Delitsch. Available under the MIT License.