Monitor the health of your Azure VM by collecting and analyzing data
- First we create a storage account to store the boot diagnostics
STORAGE=metricsstorage$RANDOM
az storage account create \
— name $STORAGE \
— sku Standard_LRS \
— location eastus2 \
— resource-group learn-14b86474–86c7–4192-bf95-bc2a6fe50afc
2. Next we create a VM with boot diagnostics enabled
az vm create \
— name monitored-linux-vm \
— image UbuntuLTS \
— size Standard_B1s \
— location eastus2 \
— admin-username azureuser \
— boot-diagnostics-storage $STORAGE \
— resource-group learn-14b86474–86c7–4192-bf95-bc2a6fe50afc \
— generate-ssh-keys
View basic metrics for your VM
- Navigate to Azure portal and select Virtual Machines
- Select you VM, in this case its the monitored-linux-vm
- Scroll down to Monitoring and select Metrics
- I entered in Percentage CPU for the metric and Max for the Aggregation
5. Next I added another metric
6. Select Add Metric
7. For Virtual Namespace select Virtual Machine Host
8. For Metric select Inbound Flows
9. For Aggregation select Avg
View Boot diagnostics
1.Under Monitoring there is Support + troubleshooting
2. Select Boot Diagnostics
3. Check here to make sure your VM has boot correctly
Configure the Azure Diagnostics extension
- Login to Azure portal
- On your home page go to Virtual machines
- Select the virtual machine you have created
- Scroll down to the Monitoring section and select Diagnostic settings
- Enable guest-level monitoring
Configure the extension
1. Once the extension is installed, you’ll see the Overview page
2. Select Metrics
3. Changed my sample rates to 60 seconds
Create a custome KPI dashboard
- Select Metrics
2.Enter in the following:
METRIC NAMESPACE Guest(classic)
METRIC Network in guest OS
AGGREGATION Max
3. Save
4. Select Pin to Dashboard
5.Dashboard name : KPI Dashboard
6.Create and Pin
I also added CPU percentage as well as memory for my metrics