有没有办法从Azure门户监视可用磁盘空间?
我知道有各种诊断工具,如I/O、内存、网络、CPU、.NET、SQL、ASP.NET、IIS等。
但是否有一种方法可以查看与VM连接的磁盘上有多少可用空间?
我找到的只有这个第三方解决方案:
http://cloudmonix.com/blog/how-to-monitor-free-disk-space-on-azure-vms/
但应该有一些基本的度量标准,如磁盘空间,而不需要第三方软件,对吗?
有没有办法从Azure门户监视可用磁盘空间?
我知道有各种诊断工具,如I/O、内存、网络、CPU、.NET、SQL、ASP.NET、IIS等。
但是否有一种方法可以查看与VM连接的磁盘上有多少可用空间?
我找到的只有这个第三方解决方案:
http://cloudmonix.com/blog/how-to-monitor-free-disk-space-on-azure-vms/
但应该有一些基本的度量标准,如磁盘空间,而不需要第三方软件,对吗?
2019年更新
现在已经可以实现。要使用 Azure Monitor 监视每个驱动器的免费磁盘空间,请执行以下操作:
\LogicalDisk(C:)\% Free Space
。百分比
。来源:Azure 支持。
若要查看 Linux 的 Azure Guest Monitor 日志:
// 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
https://learn.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-extensions-diagnostics-template?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json https://learn.microsoft.com/en-us/azure/monitoring-and-diagnostics/azure-diagnostics-streaming-event-hubs
在Azure门户中是可以实现的。在VM资源页面中,选择Logs blade并搜索“free disk”。您将得到一个默认查询,可以运行以获取磁盘使用情况。 您可以将此查询固定到仪表板或将其发送到工作簿以经常检查使用情况。
//虚拟机剩余磁盘空间 //显示每个实例的最新免费磁盘空间报告 Perf | where ObjectName == "LogicalDisk" or // Windows 记录中使用的对象名称 ObjectName == "Logical Disk" // Linux 记录中使用的对象名称 | where CounterName == "Free Megabytes" | summarize arg_max(TimeGenerated, *) by InstanceName // arg_max over TimeGenerated returns the latest record | project TimeGenerated, InstanceName, CounterValue
- gabe