az vm monitor metrics
This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Manage metrics for a vm.
Commands
Name | Description | Type | Status |
---|---|---|---|
az vm monitor metrics list-definitions |
List the metric definitions for a VM. |
Core | Preview |
az vm monitor metrics tail |
List the metric values for a VM. |
Core | Preview |
az vm monitor metrics list-definitions
Command group 'vm monitor metrics' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
List the metric definitions for a VM.
az vm monitor metrics list-definitions --name
--resource-group
[--namespace]
Examples
List the metric definitions for a VM. (autogenerated)
az vm monitor metrics list-definitions --name MyIDVirtualMachine --resource-group MyResourceGroup
Required Parameters
Name or ID of a virtual machine.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Namespace to query metric definitions for.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az vm monitor metrics tail
Command group 'vm monitor metrics' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
List the metric values for a VM.
az vm monitor metrics tail --name
--resource-group
[--aggregation {Average, Count, Maximum, Minimum, None, Total}]
[--dimension]
[--end-time]
[--filter]
[--interval]
[--metadata]
[--metrics]
[--namespace]
[--offset]
[--orderby]
[--start-time]
[--top]
Examples
List CPU usage of VM for past one hour
az vm monitor metrics tail --name myVM -g myRG --metric "Percentage CPU"
List one hour CPU usage of VM started at 2019-12-18T00:00:00Z
az vm monitor metrics tail --name myVM -g myRG --metric "Percentage CPU" --start-time 2019-12-18T00:00:00Z
List CPU usage of VM for past one hour with filter
az vm monitor metrics tail --name myVM -g myRG --metrics "Per Disk Read Bytes/sec" --filter "SlotId eq '*'"
Required Parameters
Name or ID of a virtual machine.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
The list of aggregation types (space-separated) to retrieve.
The list of dimensions (space-separated) the metrics are queried into.
End time of the query. Defaults to the current time. Format: date (yyyy-mm-dd) time (hh:mm:ss.xxxxx) timezone (+/-hh:mm).
A string used to reduce the set of metric data returned. eg. "LUN eq '*'".
For a full list of filters, see the filter string reference at https://docs.microsoft.com/rest/api/monitor/metrics/list.
The interval over which to aggregate metrics, in ##h##m format.
Return the metadata values instead of metric data.
Space-separated list of metric names to retrieve.
Namespace to query metric definitions for.
Time offset of the query range, in ##d##h format.
Can be used with either --start-time or --end-time. If used with --start-time, then the end time will be calculated by adding the offset. If used with --end-time (default), then the start time will be calculated by subtracting the offset. If --start-time and --end-time are provided, then --offset will be ignored.
Aggregation to use for sorting results and the direction of the sort. Only one order can be specificed. Examples: sum asc.
Start time of the query. Format: date (yyyy-mm-dd) time (hh:mm:ss.xxxxx) timezone (+/-hh:mm).
Max number of records to retrieve. Valid only if --filter used.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Azure CLI