Share via


How do i set alerts for Memory, Disk Usage in VM's

Question

Wednesday, July 24, 2019 9:24 AM

Hello All,

I couldn't find any metrics related to Memory/ Disk Usage in azure monitor to trigger alerts though i enable diagnostics logs. I there any other way of achieving this?

Thanks

All replies (10)

Tuesday, July 30, 2019 8:17 AM ✅Answered | 1 vote

Hi,

I am describing the steps for creating an alert.

Did you tried to create an alert from the  Virtual machine blade? 

If yes that wont work. You need to create an alert from the log analytics workspace blade. I should have mentioned that on the previous reply.

Steps here:

  • Go to the log  analytics blade(where your virtual machine is reporting) and select "alerts" under "Monitoring" as shown on the below screenshot. 
  • click on "New alert rule" as shown below
  • Then you will be on "create rule" blade. Click on the Add button under condition. Then the "Configure signal logic" blade opens up.
  • You can search for memory as shown below and select "% used memory"

Then you can change the operators ans create an alert. The alert in the screenshot will fire if the memory usage percentage is greater than 60 for the last 5 minutes.

Below alert is for all the machines which are reporting to the current workspace. You can filter to specific machines as shown in the below screenshot.

Alerts has lot of options available. We have used some of them here. You can follow this link for more details.

Please click on "mark as answer" for the replies which solved your problem.


Wednesday, July 24, 2019 12:31 PM

Hi Batman_me,

You can achieve Disk/Memory usage monitor in Azure by enabling the "Guest level monitoring" for that Virtual machine.

 This document describes the process of enabling the guest level monitoring.

Once thats enabled, Then the collected values will show up under metrics.

Then you can click on the new alert rule to create an alert as shown in the below screenshot. Screenshot has graphs for memory uses and memory free metrics.

Detailed document about setting up an alert is here.

Please let me know if you need more details.

Please click on "mark as answer" if this reply solved your issue


Thursday, July 25, 2019 5:27 AM

Hello jakaruna-MSFT:

Thanks for your reply. I followed your procedure, but when i click on new alert rule i do not get the guest classic metrics that was enabled in previous step, I get only the default virtual machine metrics from host.

Note: I'm using virtual studio enterprise test account


Friday, July 26, 2019 6:00 AM

Hi Batman_me,

You are right. Alerts(classic) are being deprecated. So the way described in the above answer is not recommended.

Still you can created the classic alerts. I will describe that process in the end.

Current recommended way is to use log analytics. 

  • Create a log analytics workspace if you dont have one.

  • go to the log analytics blade and search for the "virtual machines" and then add your machine which you want to monitor as shown in the below picture. In the screenshot my vm name is montest.

  • select the vm and click on connect.

  • Internally log analytics workspace will deploy an extension on the VM as shown below. That info can be obtained from the vm blade.

  • Once the extension is installed, Then virtual machine will start sending the data to the log analytics workspace.

  • Make sure you have enabled the performance counters in the log analytics workspace as shown below. for enabling that click on "advanced settings" under log analytics workspace blade.
    Then enable the performance counters for windows or linux servers as shown below.

Steps for Enabling Classic alerts is given below. Its NOT recommended. This is deprecated.

In the alerts page under virtual machines blade, In the bottom you will see a link to got to classic alerts. 

Try this out and let me know


Monday, July 29, 2019 5:03 AM

Hi Batman_me,

Is there any update


Tuesday, July 30, 2019 6:44 AM

Hi jakaruna:

I have enabled log analytics based on your suggestion thanks much for the detailed explanation. But i'm unable to create a rule out of the query i run. New Alert option is greyed and while hovering mouse above new alert option i get the message (New alert is not supported in this environment)


Wednesday, July 31, 2019 4:50 AM

Hello,

Just checking in if you have had a chance to see the previous response.

If this solved your issue, do click “Mark as Answer” and "Up-Vote" so that other forum members can benefit from it. If you need any further help do let us know.

Thanks.


Monday, August 5, 2019 5:54 AM

Hi,

Is there any update?


Monday, August 5, 2019 11:56 AM

Hello jakaruna-MSFT,

That solves the issue, thanks much for your time. Much appreciated.

Thanks,


Monday, August 5, 2019 11:57 AM

Good to hear that.

Feel free to post here if you face issues.