gpt4 book ai didi

azure - 监视 Azure VM 上的可用磁盘空间

转载 作者:行者123 更新时间:2023-12-04 02:09:15 39 4
gpt4 key购买 nike

有什么方法可以从 Azure 门户监控可用磁盘空间吗?

我知道有各种针对 I/O、内存、网络、CPU、.NET、SQL、ASP.NET、IIS 等的诊断

但是有什么方法可以查看附加到虚拟机的磁盘上有多少可用空间吗?

我找到的只是这个第三方解决方案:

http://cloudmonix.com/blog/how-to-monitor-free-disk-space-on-azure-vms/

但是应该有某种方法可以在不需要第三方软件的情况下查看磁盘空间等基本指标,对吗?

最佳答案

2019 年更新

今天这是可能的。要使用 Azure Monitor 监视每个驱动器的可用磁盘空间,请执行以下操作:

  1. Enable Guest Operating System OS Metrics for the VM .
  2. Azure 门户中选择虚拟机。
  3. 点击诊断设置(在“监控”下)。
  4. 点击性能计数器标签。
  5. 点击自定义按钮。
  6. 在文本框中添加您想要的驱动器的自定义指标。例如\LogicalDisk(C:)\% Free Space .
  7. 点击添加并将单位设置为 Percent .

来源: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

这会产生以下警报查询(查询中需要 AggregatedValuebin(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

关于azure - 监视 Azure VM 上的可用磁盘空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42853392/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com