你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Azure Monitor can collect data directly from your hybrid machines into a Log Analytics workspace for detailed analysis and correlation. You can enable VM insights to collect data from your non-Azure virtual machines (VM). 尽管可以通过 不同的选项将 Azure Monitor 代理 部署到已启用 Arc 的服务器,但本教程演示如何使用 Azure 门户在连接的虚拟机上启用对 VM 的洞察。
本教程介绍以下操作:
- 为托管在 Azure 外部的 Linux 或 Windows 虚拟机启用和配置 VM Insights
- 从这些 VM 收集和查看数据
Prerequisites
- If you don't have an Azure subscription, create a free account before you begin.
- 使用快速入门将混合计算机连接到 Azure Arc。本教程假定已将计算机连接到 Azure Arc。
- 确保混合计算机运行 Azure Monitor 代理支持的操作系统 ,以确保你正在启用的服务器操作系统受到 VM 洞察的支持。
- 查看 Azure Monitor 代理网络配置中指定的要求。 VM 见解映射依赖关系代理本身不传输任何数据,它不需要对防火墙或端口做出任何更改。
启用 VM 见解
Launch the Azure Arc service in the Azure portal by clicking All services, then searching for and selecting Machines - Azure Arc.
在“Azure Arc - 计算机”页上,选择在快速入门文章中创建的连接的计算机。
In the service menu, under Monitoring, select Insights and then Enable.
In the Monitoring configuration pane, confirm that the right subscription appears. 对于 数据收集规则,请选择“ 新建”。
在“ 创建新规则 ”窗格中,输入数据收集规则的名称。 对于本教程,请保留其他选项。 如果已有 Log Analytics 工作区,请不要选择现有工作区。 改为选择默认值,即,已注册连接的计算机所在同一区域中具有唯一名称的工作区。 此工作区是为你创建和配置的。
在已连接的计算机上执行配置并安装扩展时,会显示状态消息。 此过程需要花费几分钟时间。
进程完成后,消息会显示计算机已加入且见解已成功部署。
查看收集的数据
After deployment and configuration are complete, select Insights, and then select the Performance tab. The Performance tab shows a select group of performance counters collected from the guest operating system of your machine. 向下滚动以查看更多计数器,并将鼠标移到图形上以查看从计算机上安装 Azure Monitor 代理 VM 扩展时开始的平均和百分位数。
Select the Map tab. The maps feature shows the processes running on the machine and their dependencies. Select Properties to open the property pane (if it isn't already open).
展开计算机的进程。 选择其中一个进程以查看其详细信息并突出显示其依赖项。
Select your machine again and then select Log Events. 将会看到计算机的 Log Analytics 工作区中存储的表的列表。 此列表在 Windows 或 Linux 计算机上有所不同。
Select the Event table. The Event table includes all events from the Windows event log. Log Analytics 将会打开,其中包含一个用于检索所收集事件日志条目的简单查询。
Next steps
若要详细了解 Azure Monitor,请参阅以下文章: