Monitor the health of your Azure VM by collecting and analyzing data

C.J. Shields
3 min readJul 22, 2020

--

  1. 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

  1. Navigate to Azure portal and select Virtual Machines
  2. Select you VM, in this case its the monitored-linux-vm
  3. Scroll down to Monitoring and select Metrics
  4. 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

  1. Login to Azure portal
  2. On your home page go to Virtual machines
  3. Select the virtual machine you have created
  4. Scroll down to the Monitoring section and select Diagnostic settings
  5. 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

  1. 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

--

--

C.J. Shields
C.J. Shields

Written by C.J. Shields

Systems/Network Administrator | DevOps Enthusiast

No responses yet