有什么方法可以从Azure门户网站监控可用的磁盘空间吗?
我知道有各种I/O、内存、网络、CPU、.NET、SQL、ASP.NET、IIS等诊断方法。
但是,是否有某种方法可以查看连接到虚拟机的磁盘上有多少可用空间?
我找到的就是这个第三方解决方案:
http://cloudmonix.com/blog/how-to-monitor-free-disk-space-on-azure-vms/
但是,应该有一些方法可以在不需要第三方软件的情况下查看磁盘空间等基本指标,对吧?
发布于 2019-02-28 23:36:34
更新2019
这在今天是可能的。要使用Azure监视器监视每个驱动器的可用磁盘空间,请执行以下操作:
选择虚拟Machine.
\LogicalDisk(C:)\% Free Space
.
Percent
.来源: Azure支持。
要从Azure来宾监视器查看日志,请执行以下操作:
// Virtual Machine free disk space
// Show the latest report of free disk space, per instance
InsightsMetrics
| where Name == "FreeSpacePercentage"
| summarize arg_max(TimeGenerated, *) by Tags
// arg_max over TimeGenerated returns the latest record
| project TimeGenerated, Computer, Val, Tags
这将导致以下警报查询(查询中需要使用AggregatedValue
和bin(TimeGenerated, <some time>)
):
InsightsMetrics
| where Name == "FreeSpacePercentage"
| summarize AggregatedValue=arg_min(Val, *) by bin(TimeGenerated, 5min), Tags
要查看任何通用诊断端点的相同信息(感谢@gabe):
打开此功能后,我可以使用日志查询来查看可用磁盘空间:
// Virtual Machine free disk space
// Show the latest report of free disk space, per instance
Perf
| where ObjectName == "LogicalDisk" or
// the object name used in Windows records
ObjectName == "Logical Disk" // the object name used in Linux records
| where CounterName == "Free Megabytes"
| summarize arg_max(TimeGenerated, *) by InstanceName
// arg_max over TimeGenerated returns the latest record
| project TimeGenerated, InstanceName, CounterValue
发布于 2017-03-17 17:34:05
发布于 2017-03-25 11:06:00
目前,通过Azure门户或Azure监视器无法做到这一点。可用磁盘空间是来宾操作系统性能计数器。如果这是Windows VM,你可以使用monitor Diagnostics (WAD)代理将性能计数器收集到Azure存储表和/或EventHub,并设置自定义工具来监视此数据。如果这是一个Linux虚拟机,还有一个等效的Linux诊断扩展。
以下是WAD上的一些相关链接-
https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-extensions-diagnostics-template?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/azure-diagnostics-streaming-event-hubs
https://stackoverflow.com/questions/42853392
复制相似问题