My miniature schnauzer, Raven, is a smart and lively dog who loves to hunt for rodents in the yard. She has a keen sense of smell and can detect the slightest movement of her prey. She barks loudly to alert me whenever she finds a potential target and chases after it with all her speed. However, the rodents are too cunning and often escape to a tree or a hole in the ground before she can catch them. She then returns to me with a disappointed look on her face, hoping for a treat or a pat on the head.
Azure Monitor is like Raven, but much more efficient and reliable. It can monitor your Azure servers and detect when they go offline in ~1 minute. It can also alert you via email, SMS, or webhook when something goes wrong, so you can take action to fix it. With Azure Monitor, you can stay on top of your server’s health and performance.
Azure Monitor is a beneficial tool that has low costs for logs that are already in the tool. The main expenses for Azure Monitor come from ingesting the logs, so using the monitoring tool for data that is already there is a good way to help your enterprise reduce their spending. To illustrate how Azure Monitor can assist, an example of checking server availability is shown below.
Monitoring the availability of Azure servers can be very challenging, but Azure Monitor can help with that and make the task easier for the administrator. In the example below, I will demonstrate how to monitor and alert the administrator with an e-mail (or text message) when a server that is being monitored goes offline.
Requirements:
There is the assumption that there is a LAW available to be used for this process. A LAW can be created if one doesn’t exist.
To install the AMA agent on an Azure VM without the use of an Azure policy, you can enable monitoring and create a Data Collection Rule (DCR). The manual process to install the agent, enable monitoring and create a DCR is covered later in this document.
Any devices without the AMA agent should now be deploying/deployed. Clicking on the policy definition will articulate how many resources were remediated.
In the example below, there were no devices that required the agent.
In order to monitor servers in Azure monitor not only does the server have to have the AMA agent installed, but it also needs be Azure Monitor Insight “Enabled” and have a Data Collection Rule (DCR) on what should be collected.
Within the “Monitoring and Configuration” window:
Note: Unless you have already created a rule specifically for “Alert Rules”, I recommend creating a new one.
The new Data Collection Rule can be seen.
When creating an Azure Monitor Alert Rule, a Data Collection Rule (DCR) will need to be applied against any servers that should be monitored. To apply a DCR against an Azure vm it will need to have the AMA agent installed and running. Creating an Azure Alert Rule provides the ability to create a DCR and install the AMA agent.
In the example below, an alert rule will be created to create a notification if an Azure vm goes offline.
This should bring up the “Alert rules” blade.
With the example of notification creation, you should receive both an e-mail and text message acknowledging you will be notified if this rule is triggered.
Note: Under the “Contains actions” column, the actions to be taken are both email and messaging.
The details tab gives the opportunity to configure the alert:
The new alert rule should now appear.
To show how the process works, I went into Azure Virtual Machines and stopped the server.
Within the next minute or two, Azure Monitor should now notify you by email and messaging. In this tutorial only the email messaging will be displayed.
The alert was configured (default) to auto-resolve, so if the server is re-started it will self “Resolve”.
An email should be sent about the new state of the alert.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.