I believe we all know, in the course of our daily operation and maintenance of the monitoring system is essential. We can understand by monitoring usage of system resources such as network throughput, disk usage, and some services system is in running state, in order to take appropriate measures at the appropriate time. Well, today we look at how to use Azure Monitor logs and metrics to collect data from Azure virtual machine.
To use the Azure Monitor Azure collected in the running virtual machine performance and log data, what I can install them on Log Analytics Agent, by Log Analytics Agent will collect Azure VM performance and log data in the Log Analytics workspace, in order to to conduct a detailed analysis and correlation. Because, so we can use the Log Analytics VM scalable way to install the Log Analytics Agent agent on the Azure platform, our virtual machines are running. Use extension agent installation process is relatively simple, and can be configured for automatic proxy, it will be upgraded automatically when a late version of the agent appear updated to streamline our operation and maintenance operations.
Without further ado, Syria, then we will look together on how to use VM extended configuration and collect from Azure Linux or Windows VM data
Creating Log Analytics workspace
log in to Azure Portal, click on "Create a resource". Search "Log Analytics", then click "Create":
Here we can choose to create a new workspace or link to an existing workspace, and I chose to create a new workspace and enter the relevant information:
Created, as shown below:
Enable Log Analytics VM extension
In the log analytics workspace we just created, find the "workspace data source", then click on the "virtual machine":
In the virtual machine in the list, select the agent we want to install a virtual machine:
Note: the connection status log analytics are shown as not connected.
We can click on the virtual machine, and then on the pop-up tab, click "Connect", then you will call log analytics vm extended automatically configure the agent for virtual machines:
After installation is complete, the connection status is displayed as connected:
Collecting event and performance data
After installing the agent, we need to configure the Log Analytics collection of Windows or linux syslog system log data and some common performance counters.
Click the "Advanced Settings" In our Log Analytics workspace - "Data" - "Windows Event Log":
Enter "Syetem" and then click on the "+" and then select "serious", "Error", "Warning":
After configuration is complete, click "Save":
Click the "Advanced Settings" In our Log Analytics workspace - "Data" - "Windows Performance Data" to enable the performance counters collected on a windows computer:
When the first time we can use the default of several universal counter, you can also add your own additional performance counters indicators:
Then click Save at the top of the page to save the configuration:
View data collection
Select "Log" We create good Log Analytics workspace in the left pane, Perf run to query:
We can configure some Alert and other operations based on the acquired data to ensure that the system can be stable operation.