2

I'm trying to create an alert for low disk utilization. And I see the syntax given in this link which checks for CPU utilization.

az monitor alert create -n rule1 -g {ResourceGroup} --target {VirtualMachineID} --condition "Percentage CPU > 90 avg 5m"

I can't find a list of possible conditions I can enter so that I can give the correct command for low disk utilization.

masterforker
  • 2,443
  • 2
  • 25
  • 39

3 Answers3

1

you could try to list the affected resource available metrics definitions of the resource with:

az monitor metrics list-definitions --resource [TARGET_ID] | jq '.[].name' 

you can list the target_id's of the resource with:

az resource list | jq '.[].id' 
Biluxx
  • 41
  • 1
0

Currently, it is not possible. You could check supported-metrics in this link.

enter image description here

But you could do it with Azure OMS, you could check this similar question.

Community
  • 1
  • 1
Shui shengbao
  • 18,746
  • 3
  • 27
  • 45
  • Maybe you also check this answer https://stackoverflow.com/questions/47536304/how-to-generate-a-low-disk-alert-for-an-azure-virtual-machine/47547103#47547103 – Shui shengbao Feb 16 '18 at 05:52
0

you can use this PowerShell command to list all available metrics for the specific resource/resource type link

Get-AzMetricDefinition -ResourceId <>