使用Azure Linux诊断进行监视 [英] Monitoring using Azure Linux Diagnostics

查看:147
本文介绍了使用Azure Linux诊断进行监视的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为连接到VM的单个磁盘启用Linux诊断.我指的是此链接( https://docs .microsoft.com/en-us/azure/virtual-machines/linux/diagnostic-extension )

I am trying to enable Linux Diagnostics for individual disks attached to the VM. I am referring to this link (https://docs.microsoft.com/en-us/azure/virtual-machines/linux/diagnostic-extension)

我正在使用此CLI

azure vm extension set vmturbo DiagnosticTest LinuxDiagnostic Microsoft.Azure.Diagnostics '3.0' --private-config-path PrivateConfig.json --public-config-path PublicConfig.json -v

这就是PrivateConfig.json的样子

And this is how PrivateConfig.json looks like

    {
        "storageAccountName" : "XXXXXXXXXX",
        "storageAccountSasToken": "sv=2016-05-31&ss=bfqt&srt=sco&sp=rwdlacup&se=2017-06-13T19:34:34Z&st=2017-06-13T11:34:34Z&spr=https,http&sig=G%2FXj0rYHNk7jUx6CF47kPdJh42jhafSsUvT0JlrR3XE%3D"
    }

And this is how PublicConfig.json looks like 
{
  "StorageAccount": "diagnosticvmstorage",
  "sampleRateInSeconds": 15,
  "ladCfg": {
    "diagnosticMonitorConfiguration": {
      "performanceCounters": {
        "sinks": "",
        "performanceCounterConfiguration": [
         {
          {
            "annotation": [
              {
                "displayName": "Disk write time", 
                "locale": "en-us"
              }
            ], 
            "class": "disk", 
            "condition": "Name=\"/dev/sdc1\"",
            "counter": "averagewritetime", 
            "counterSpecifier": "/builtin/disk/averagewritetime", 
            "type": "builtin", 
            "unit": "Seconds"
          }, 
          {
            "annotation": [
              {
                "displayName": "Filesystem transfers/sec", 
                "locale": "en-us"
              }
            ], 
            "class": "filesystem", 
            "condition": "Name=\"/newdisk\"",
            "counter": "transferspersecond", 
            "counterSpecifier": "/builtin/filesystem/transferspersecond", 
            "type": "builtin", 
            "unit": "CountPerSecond"
          }
        ]
      },
      "metrics": {
        "metricAggregation": [
          {
            "scheduledTransferPeriod": "PT1H"
          },
          {
            "scheduledTransferPeriod": "PT1M"
          }
        ],
        "resourceId": "/subscriptions/758ad253-cbf5-4b18-8863-3eed0825bf07/resourceGroups/vmturbo/providers/Microsoft.Compute/virtualMachines/DiagnosticTest"
      },
      "eventVolume": "Large"
    }
  }
  ]
}

VM上已挂有磁盘/dev/sdc1,并且已将其挂载在/newdisk.即使在同时使用了PerformanceCounters之后,我仍然在WADMetrics *****表中看不到任何数据.我在做错什么还是在配置文件中丢失了什么?

The VM has a disk attached to it /dev/sdc1 and it is mounted at /newdisk. Even after using both the performanceCounters I still don't see any data in the WADMetrics***** table. Is there anything which I am doing wrong or am I missing out anything in the config file ?

谢谢.

推荐答案

根据

According to the link that you provided, you need modify counterSpecifier not condition. Please refer below:

counterSpecifier是一个任意标识符.指标的使用者, 例如Azure门户图表和警报功能,请使用 counterSpecifier作为标识度量标准或实例的关键字" 指标.对于内置指标,我们建议您使用 以/builtin/开头的counterSpecifier值.如果你是 收集指标的特定实例,建议您附加 实例的标识符到counterSpecifier值.一些 例子:

The counterSpecifier is an arbitrary identifier. Consumers of metrics, like the Azure portal charting and alerting feature, use counterSpecifier as the "key" that identifies a metric or an instance of a metric. For builtin metrics, we recommend you use counterSpecifier values that begin with /builtin/. If you are collecting a specific instance of a metric, we recommend you attach the identifier of the instance to the counterSpecifier value. Some examples:

  • /builtin/Processor/PercentIdleTime-所有设备的平均空闲时间 核心
  • /builtin/Disk/FreeSpace(/mnt)-/mnt文件系统的可用空间
  • /builtin/Disk/FreeSpace-所有安装的平均可用空间 文件系统
    • /builtin/Processor/PercentIdleTime - Idle time averaged across all cores
    • /builtin/Disk/FreeSpace(/mnt) - Free space for the /mnt filesystem
    • /builtin/Disk/FreeSpace - Free space averaged across all mounted filesystems
    • 我在实验室中进行了测试,您可以按如下所示修改json文件:

      I test in my lab, you could modify your json file as below:

         {
                  "annotation": [
                    {
                      "displayName": "Disk /dev/sdc1", 
                      "locale": "en-us"
                    }
                  ], 
                  "class": "disk", 
                  "condition": "IsAggregate=TRUE", 
                  "counter": "readbytespersecond", 
                  "counterSpecifier": "/builtin/disk/FreeSpace(/newdisk)", 
                  "type": "builtin", 
                  "unit": "BytesPerSecond"
                }, 
      

      注意:我在ARM Ubuntu 16.04 VM上进行了测试.我使用az vm extension set --publisher Microsoft.Azure.Diagnostics --name LinuxDiagnostic --version 3.0 --resource-group $my_resource_group --vm-name $my_linux_vm --protected-settings "${my_lad_protected_settings}" --settings portal_public_settings.json启用LAD.

      Notes: I test on a ARM Ubuntu 16.04 VM. I use az vm extension set --publisher Microsoft.Azure.Diagnostics --name LinuxDiagnostic --version 3.0 --resource-group $my_resource_group --vm-name $my_linux_vm --protected-settings "${my_lad_protected_settings}" --settings portal_public_settings.json to enable LAD.

      这篇关于使用Azure Linux诊断进行监视的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆