Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.2 KB

README.md

File metadata and controls

41 lines (30 loc) · 1.2 KB

CLI for the Azure Alerting REST API

Provides the ability to create Azure Log Analytics Alerts. There is currently no Azure Python SDK support for creating Alerts. This library uses the azure-mgmt-loganalytics package for managing Saved Searches.

Usage

pip install git+https://github.com/energizedwork/azure-log-analytics-alerts-cli.git

The following environment variables need to be set:

  • AZURE_TENANT_ID
  • AZURE_CLIENT_ID
  • AZURE_CLIENT_SECRET
  • AZURE_SUBSCRIPTION_ID

List available commands:

az-la-cli --help

To create an alert:

az-la-cli create-metric-alert 
    --workspace-name "my-oms-workspace" 
    --search-name "my search" 
    --resource-group "rg" 
    --name "Name of My Alert" 
    --threshold-operator "gt" 
    --threshold-value "80" 
    --query "Type=Perf ObjectName=\"Processor\" CounterName=\"% Processor Time\" Computer=\"VM1\" | measure avg(CounterValue) by Computer Interval 5MINUTES"`

More Info

Log Analytics API

Alert API