Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A brief introduction to the Azure monitor of Azure practice and how to be the North second East

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Hello, everyone, today we will continue to discuss the technical issues of the Azure platform. This time we will discuss the topic of monitoring. Each cloud platform will reserve an interface for users to obtain monitoring data, and Azure is no exception. Taking the most basic usage, users can obtain the monitoring information they need from Azure Portal, such as the disk IO,CPU percentage of the Azure virtual machine, memory, etc., in addition, you can also define various action Perform a series of operations on the monitored data, such as sending email, calling

First of all, let's briefly introduce the function used for monitoring in Azure called Azure monitor, the function of Monitor is very powerful, not only can collect all kinds of log, but also can connect log to many platforms including powerbi, eventhub and so on, and then use the functions of the platform to display and analyze log.

In general, you can understand the overall architecture of Azure monitor through this architecture diagram.

As you can see, monitor supports the following source, covering applications, any operating system and services that applications depend on, up to the platform itself

Application monitoring data: data about the performance and functionality of the code written, regardless of the platform.

Guest OS monitoring data: data about the operating system running the application. This application can be run in Azure, in other clouds, or locally.

Azure resource monitoring data: data about the operations of Azure resources.

Azure subscription monitoring data: data about Azure subscription operations and management, as well as data about the health and operation of Azure itself.

Azure tenant monitoring data: data about tenant-level Azure services (such as Azure Active Directory) operations.

The data collected by Azure Monitor can be divided into two types. Metric and Log,Metric mainly refer to various metrics data, similar to disk IO,CPU,network, etc. Log contains a variety of transaction logs, including .NET, SQL,IIS and many other different types.

After the information is collected, different functions can be achieved according to the docking platform. For example, if monitor is connected to Azure Dashboard, different charts can be customized in Portal to display the data obtained by monitor.

If you dock to Power BI, you can have a richer way to display the chart, and you can show the analysis results more flexibly as needed.

First of all, let's give an example of how to view the monitoring data of VM. It is very simple to view the monitoring data of VM. After selecting VM, you can see that some charts will appear in the lower right corner. By default, Azure will monitor some basic data, such as network,CPU. It should be noted that these data belong to host level, that is, the monitoring data obtained through the host computer. In fact, the data obtained from VM is not completely consistent with that obtained from VM. For example, network data, monitoring data obtained from host and VM are likely to be inconsistent. This is because Azure calculates host level and VM Level network monitoring data differently. Details can be discussed later.

A big disadvantage of Host level monitoring is that if we want to see in-memory data, host level monitoring cannot be seen, so we need to enable guest level monitoring manually. The method is very simple. Click VM first, and then select diagnostics settings. You can see that if guest level monitoring is not enabled, you will see the option of enable guest level monitoring here. Click directly to open it.

If you want to view the in-memory data after enabling it, first click metrics, and then select virtualmachines here for metric namespace

Then select Commit byte in use in metric to see the in-memory data

On this basis, if you want to achieve the monitoring and alarm function, you can click alerts (classic) on the left, and then select add metric alert

After entering the basic information, you can choose which metric you want to set the alarm for. For example, you can give an alarm for the use of CPU, and you can choose processor time.

Then set the alarm conditions. For example, if the CPU utilization rate exceeds 80% within 5 minutes, the email will be sent through the user abc@abc.com, and the alert will take effect after the setting is completed.

This is the standard process for creating alert, but in East 2 and North 2, this feature of Portal is not currently supported. You will receive the following prompt for creating alert through portal

But this does not mean that this function cannot be used. We can create an alert through powershell. For example, if the memory exceeds 80% within 5 minutes, an alarm will be given and an email will be sent to abc@abc.com. This can be achieved by using the following command

$actionEmail = New-AzureRmAlertRuleEmail-CustomEmail "abc@abc.com"

Add-AzureRmMetricAlertRule-Name MemoryAlert-Location "ChinaNorth"-ResourceGroup "abc"-TargetResourceId "/ subscriptions/5d666915-fc5f-4ee8-b26a-d98jkjkl22134/resourceGroups/mmm/providers/Microsoft.Compute/virtualMachines/vm01"-MetricName "\ Memory\% Committed Bytes In Use"-Operator GreaterThan-Threshold 80-WindowSize 00:05:00-TimeAggregationOperator Average-Action $actionEmail

It should be noted that my VM is in the North second District, but the location in this powershell is written in the North first. This is not a typo, but the previously mentioned East two and North two cannot create an alert workaround, so the location here cannot be repaired.

After the creation is completed, you can receive a similar alarm when the condition is triggered.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report