【问题标题】:Disk query in Log Analytics on AzureAzure 上的 Log Analytics 中的磁盘查询
【发布时间】:2018-07-28 21:55:48
【问题描述】:

我想知道是否可以在日志分析方面获得一些帮助。新手请多多包涵。

我正在尝试创建一个查询,以提供有关 Azure 中磁盘利用率的信息。我有两个命令(如下),但是我无法合并它们,因为我想要一个查询,它可以为我提供可用空间百分比、磁盘总体大小、虚拟机名称和磁盘名称。在磁盘使用方面我能得到的任何其他东西都会很棒,目前不必过度关注 IOP。

命令是:

下面的这个命令提供关于可用空间的信息:

search ObjectName == "LogicalDisk" and CounterName == "% Free Space"

下面的这个命令提供了关于剩余可用 Mb 的信息。

search ObjectName == "LogicalDisk" and CounterName == "Free Megabytes"

我试过这个有帮助,但信息非常有限

search ObjectName == "LogicalDisk" and CounterName == "Free Megabytes" and TimeGenerated > ago(1d) 
| summarize FreeSpace = min(CounterValue) by Computer, InstanceName
| where strlen(InstanceName) ==2 and InstanceName contains ":"

提前致谢:)

【问题讨论】:

  • 你试试这个Perf | where (ObjectName == "LogicalDisk" and CounterName == "Free Megabytes") | summarize arg_max(TimeGenerated, *) by Computer | sort by TimeGenerated desc。请参阅此link。嗨,检查 cmets。
  • @ShengbaoShui-MSFT 谢谢 .. 工作得很好 :) 我尝试对 iops 使用相同的方法,但没有用,我在这里有一个问题,你能看到我在哪里出错了请..再次感谢
  • I tried using the same for iops 我将在我的实验室进行测试。

标签: azure analytics azure-log-analytics


【解决方案1】:

您可以使用以下脚本查询 Azure 日志数据库:

// % Disk free space
Perf | where ObjectName == "LogicalDisk" and CounterName == "% Free Space" and InstanceName != "_Total"
| summarize CounterValue = min(CounterValue) by Computer, InstanceName, CounterName
| order by CounterValue asc nulls first

要限制输出到可用空间少于 20% 的磁盘,只需添加一个额外条件:

| where CounterValue < 20

【讨论】:

    【解决方案2】:

    您可以使用以下命令

    Perf | where (ObjectName == "LogicalDisk" and CounterName == "Free Megabytes") | summarize arg_max(TimeGenerated, *) by Computer | sort by TimeGenerated desc
    

    有关此的更多信息,您可以查看link

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-09
      • 1970-01-01
      • 1970-01-01
      • 2019-02-02
      • 1970-01-01
      相关资源
      最近更新 更多