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

Use Azure Monitor to collect data from Azure VM

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

I believe we all know that in our daily operation and maintenance process, the monitoring of the system is essential. Through monitoring, we can know the usage of system resources, such as network throughput, disk utilization and whether some services of the system are in running state, so that we can take corresponding measures at an appropriate time. So today we'll take a look at how to use Azure Monitor to collect logs and metrics data from an Azure virtual machine.

To use Azure Monitor to collect performance and log data from virtual machines running in Azure, we can install Log Analytics Agent to collect performance and log data from Azure VM to the Log Analytics workspace through Log Analytics Agent for detailed analysis and association. Because our virtual machines are running on the Azure platform, we can use the Log Analytics VM extension to install the Log Analytics Agent agent. The process of using the extension to install the agent is relatively simple, and the agent can be configured automatically, and will be upgraded automatically when the version of the agent is updated later, thus simplifying our operation and maintenance operations.

Let's take a look at how to use the VM extension to configure and collect data from Azure Linux or Windows VM.

Create a Log Analytics workspace

Log in to Azure Portal and click "Create a resource". Search for "Log Analytics" and click "Create":

Here we can choose whether to create a new workspace or link to an existing workspace, where I choose to create a new workspace and enter relevant information:

The creation is complete, as shown in the following figure:

Enable Log Analytics VM extension

In the log analytics workspace we just created, locate the Workspace data Source, and then click Virtual Machine:

"in the list of virtual machines, select the virtual machine on which we want to install the agent:"

Note: the connection status of the log analytics is displayed as unconnected.

We can click on the virtual machine, and then click Connect on the pop-up tab, and the log analytics vm extension will be called to automatically configure the proxy for the virtual machine:

After the installation is complete, the connection status is displayed as connected:

Collect event and performance data

After installing the agent, we need to configure Log Analytics to collect data from Windows's Syslog or linux syslog and some common performance counters.

Click "Advanced Settings"-"data"-"Windows event Log" in our Log Analytics workspace:

Enter "Syetem" and click "+", and then select "critical", "error", "warning":

When the configuration is complete, click Save:

Click "Advanced Settings"-"data"-"Windows performance data" in our Log Analytics workspace to enable performance counter collection on windows computers:

We can use several default general counters when we use them for the first time, or we can add other performance counter metrics ourselves:

Then click Save at the top of the page to save the configuration:

View collected data

Select Log in the left pane of the Log Analytics workspace we created, and run Perf to query:

We can configure some operations such as Alert according to the obtained data, so as to ensure that the system can run stably.

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