1

我正在尝试使用 ARM 模板为此 linux vm 安装 Azure LAD 3.0 代理。在启用扩展程序时,我想启用代理并希望将指标选择为 NONE,只应启用 syslog 并将其路由到指定的存储帐户。我已经关注了https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/diagnostics-linux#public-settings页面,并且几乎模板中的所有必填字段仍然无法识别问题。根据该文档,您必须指定一个performanceCounterssyslogEvents两个。您必须指定指标结构——但这在我的情况下不需要,我也没有给出performanceCounters需要的metrics

问题是,它抛出错误扩展操作启用失败:'NoneType'对象没有属性'get_fluentd_syslog_src_config'并且没有启用诊断扩展。问题可能与 Linux 诊断扩展架构设置有关,我试图在其中进行修改,但无法弄清楚它到底为什么会失败。

注意:我可以修改 Windows 诊断扩展架构,并且可以启用代理并选择特定的日志。

有人成功了吗?以下是我的资源部分。

"resources": [
        {
            "type": "Microsoft.Compute/virtualMachines/extensions",
            "apiVersion": "2017-12-01",
            "name": "[concat(parameters('vmName'), '/Microsoft.Insights.VMDiagnosticSettings')]",
            "location": "[resourceGroup().location]",
            "tags": {
                "displayName": "AzureDiagnostics"
            },
            "properties": {
                "publisher": "Microsoft.Azure.Diagnostics",
                "type": "LinuxDiagnostic",
                "autoUpgradeMinorVersion": true,
                "typeHandlerVersion": "3.0",
                "protectedSettings": {
                    "storageAccountName": "[parameters('existingdiagnosticsStorageAccountName')]",
                    "storageAccountKey": "[listkeys(variables('accountid'), '2015-05-01-preview').key1]",
                    "storageAccountEndPoint": "https://core.windows.net"
                },
                "settings": {
                    "StorageAccount": "[parameters('existingdiagnosticsStorageAccountName')]",
                    "ladCfg": {
                        "diagnosticMonitorConfiguration": {
                            "eventVolume": "Medium",
                            "syslogEvents": {
                                "syslogEventConfiguration": {
                                    "LOG_AUTH": "LOG_DEBUG",
                                    "LOG_AUTHPRIV": "LOG_DEBUG",
                                    "LOG_CRON": "LOG_DEBUG",
                                    "LOG_DAEMON": "LOG_DEBUG",
                                    "LOG_FTP": "LOG_DEBUG",
                                    "LOG_KERN": "LOG_DEBUG",
                                    "LOG_LOCAL0": "LOG_DEBUG",
                                    "LOG_LOCAL1": "LOG_DEBUG",
                                    "LOG_LOCAL2": "LOG_DEBUG",
                                    "LOG_LOCAL3": "LOG_DEBUG",
                                    "LOG_LOCAL4": "LOG_DEBUG",
                                    "LOG_LOCAL5": "LOG_DEBUG",
                                    "LOG_LOCAL6": "LOG_DEBUG",
                                    "LOG_LOCAL7": "LOG_DEBUG",
                                    "LOG_LPR": "LOG_DEBUG",
                                    "LOG_MAIL": "LOG_DEBUG",
                                    "LOG_NEWS": "LOG_DEBUG",
                                    "LOG_SYSLOG": "LOG_DEBUG",
                                    "LOG_USER": "LOG_DEBUG",
                                    "LOG_UUCP": "LOG_DEBUG"
                                }
                            }
                        },
                        "sampleRateInSeconds": 15
                    }
                }
            }
        }
    ]
4

1 回答 1

0

我在这里回答我自己的问题。我对 ARM 模板进行了一些更改,并且能够为基于 Debian 的操作系统部署扩展。

下面是我在 ARM 模板中更改的资源部分

"resources": [
      {
          "type": "Microsoft.Storage/storageAccounts",
          "apiVersion": "2018-07-01",
          "name": "[parameters('storageAccountName')]",
          "location": "[resourceGroup().location]",
          "sku": {
              "name": "Standard_LRS"
          },
          "kind": "StorageV2"
      },
      {
          "type": "Microsoft.Compute/virtualMachines/extensions",
          "apiVersion": "2017-12-01",
          "name": "[concat(parameters('vmName'), '/Microsoft.Insights.VMDiagnosticSettings')]",
          "location": "[resourceGroup().location]",            
          "tags": {
              "Creator": "[parameters('tags')]"
          },
          "properties": {
              "publisher": "Microsoft.Azure.Diagnostics",
              "type": "LinuxDiagnostic",
              "autoUpgradeMinorVersion": true,
              "typeHandlerVersion": "3.0",
              "protectedSettings": {
                  "storageAccountName": "[parameters('storageAccountName')]",
                  "storageAccountSasToken": "[listAccountSas(parameters('storageAccountName'), '2018-07-01', parameters('accountSasProperties')).accountSasToken]"
              },
              "settings": {
                  "StorageAccount": "[parameters('storageAccountName')]",
                  "ladCfg": {
                      "diagnosticMonitorConfiguration": {
                          "eventVolume": "Medium",
                          "metrics": {
                              "metricAggregation": [],
                              "resourceId": "[resourceId('Microsoft.Compute/virtualMachines', parameters('vmName'))]"
                          },
                          "performanceCounters": {
                              "performanceCounterConfiguration": []
                          },
                          "syslogEvents": {
                              "syslogEventConfiguration": {
                                  "LOG_AUTH": "LOG_DEBUG",
                                  "LOG_AUTHPRIV": "LOG_DEBUG",
                                  "LOG_CRON": "LOG_DEBUG",
                                  "LOG_DAEMON": "LOG_DEBUG",
                                  "LOG_FTP": "LOG_DEBUG",
                                  "LOG_KERN": "LOG_DEBUG",
                                  "LOG_LOCAL0": "LOG_DEBUG",
                                  "LOG_LOCAL1": "LOG_DEBUG",
                                  "LOG_LOCAL2": "LOG_DEBUG",
                                  "LOG_LOCAL3": "LOG_DEBUG",
                                  "LOG_LOCAL4": "LOG_DEBUG",
                                  "LOG_LOCAL5": "LOG_DEBUG",
                                  "LOG_LOCAL6": "LOG_DEBUG",
                                  "LOG_LOCAL7": "LOG_DEBUG",
                                  "LOG_LPR": "LOG_DEBUG",
                                  "LOG_MAIL": "LOG_DEBUG",
                                  "LOG_NEWS": "LOG_DEBUG",
                                  "LOG_SYSLOG": "LOG_DEBUG",
                                  "LOG_USER": "LOG_DEBUG",
                                  "LOG_UUCP": "LOG_DEBUG"
                              }
                          }
                      },
                      "sampleRateInSeconds": 15
                  }
              }
          }
      }
  ]
}
于 2020-05-11T06:32:45.277 回答