如果不使用帮助程序脚本,则必须在终端上提供所需的特定配置,才能将衡量指标发布至云代理。必须为开源 Telegraf 提供以下配置,具体取决于 vCenter Server 虚拟机、EC2 AWS 实例或 Azure 虚拟机是否受管。您必须为括在 <> 中的变量提供正确的值。
如果不使用帮助程序脚本,则必须下载 mandatory_tags.sh 或 mandatory_tags.bat,并提供已下载脚本的路径和 Telegraf 可执行文件的路径。例如,在以下代码中,您必须提供以下内容:<mandatory_tags.sh/bat 路径> <telegraf executable 路径>。
对于 Linux,从云代理下载 mandatory_tags.sh (https://<CP_IP>/downloads/salt/mandatory_tags.sh)。
对于 Windows,从云代理下载 mandatory_tags.ps1 (
https://<CP_IP>/downloads/salt/mandatory_tags.ps1)。
注: 对于 Windows 和 Linux,在上述指定命令和位置中使用 <CP_IP> 的相关云代理 IP 地址/FQDN。对于已激活应用程序监控高可用性的收集器组,请提供虚拟 IP
受管 vCenter Server 虚拟机
[agent] interval = "300s" round_interval = true metric_batch_size = 1000 metric_buffer_limit = 2000 collection_jitter = "0s" flush_interval = "60s" flush_jitter = "0s" precision = "" debug = false quiet = false logfile = "" hostname = "<VM_NAME/HOSTNAME>" omit_hostname = false # Configuration for HTTP server to send metrics to [[outputs.http]] url = "https://<CP_IP_or_FQDN>:8443/opensource/default/metric" timeout = "5s" method = "POST" insecure_skip_verify = true data_format = "wavefront" ## Additional HTTP headers [outputs.http.headers] Content-Type = "text/plain; charset=utf-8" vmId = "<VM_MOR>" vcid = "<VC_ID>" hostname = "<VM_NAME/HOSTNAME>" uuid = "" [[inputs.exec]] commands = ["/bin/bash <Path to mandatory_tags.sh/bat> <path to telegraf executable>"] timeout = "5s" data_format = "influx"
受管 AWS EC2 实例
[agent] interval = "300s" round_interval = true metric_batch_size = 1000 metric_buffer_limit = 2000 collection_jitter = "0s" flush_interval = "60s" flush_jitter = "0s" precision = "" debug = false quiet = false logfile = "" hostname = "<EC2_INSTANCE_NAME/HOSTNAME>" omit_hostname = true # Configuration for HTTP server to send metrics to [[outputs.http]] url = "https://<CP_IP_or_FQDN>:8443/opensource/default/metric" timeout = "5s" method = "POST" insecure_skip_verify = true data_format = "wavefront" ## Additional HTTP headers [outputs.http.headers] Content-Type = "text/plain; charset=utf-8" vmId = "i-< EC2_INSTANCE_ID>" vcid = "<REAGON>" hostname = "<EC2_INSTANCE_NAME/HOSTNAME>" uuid = "aws" [[inputs.exec]] commands = ["/bin/bash <Path to mandatory_tags.sh/bat> <path to telegraf executable>"] timeout = "5s" data_format = "influx"
受管 Azure 虚拟机
[agent] interval = "300s" round_interval = true metric_batch_size = 1000 metric_buffer_limit = 2000 collection_jitter = "0s" flush_interval = "60s" flush_jitter = "0s" precision = "" debug = false quiet = false logfile = "" hostname = "<AZURE_VIRTUAL_MACHINE_NAME/HOSTNAME>" omit_hostname = true # Configuration for HTTP server to send metrics to [[outputs.http]] url = "https://<CP_IP_or_FQDN>:8443/opensource/default/metric" timeout = "5s" method = "POST" insecure_skip_verify = true data_format = "wavefront" ## Additional HTTP headers [outputs.http.headers] Content-Type = "text/plain; charset=utf-8" vmId = ";subscriptions;<SUBSCRIPTION_ID>;resourceGroups;<AZURE_RESOURCE_GROUP>;providers;Microsoft.Compute;virtualMachines;<AZURE_VIRTUAL_MACHINE_NAME>" vcid = "<SUBSCRIPTION_ID>" hostname = "<AZURE_VIRTUAL_MACHINE_NAME/HOSTNAME>" uuid = "azure" [[inputs.exec]] commands = ["/bin/bash \"/etc/telegraf/telegraf.d/mandatory_tags.sh\" \"/usr/bb in/telegraf\""] timeout = "5s" data_format = "influx"
非受管 vCenter Server 虚拟机、AWS EC2 实例和 Azure 虚拟机
[agent] interval = "300s" round_interval = true metric_batch_size = 1000 metric_buffer_limit = 2000 collection_jitter = "0s" flush_interval = "60s" flush_jitter = "0s" precision = "" debug = false quiet = false logfile = "" hostname = "<VM_NAME/HOSTNAME>" omit_hostname = false # Configuration for HTTP server to send metrics to [[outputs.http]] url = "https://<CP_IP_or_FQDN>:8443/opensource/default/metric" timeout = "5s" method = "POST" insecure_skip_verify = true data_format = "wavefront" ## Additional HTTP headers [outputs.http.headers] Content-Type = "text/plain; charset=utf-8" uuid = "<UUID>" ip = "<IP_ADDRESS>" hostname = "<VM_NAME/HOSTNAME>" [[inputs.exec]] commands = ["/bin/bash <Path to mandatory_tags.sh/bat> <path to telegraf executable>"] timeout = "5s" data_format = "influx"