如果不使用帮助程序脚本,则必须在终端上提供所需的特定配置,才能将衡量指标发布至云代理。根据虚拟机是否受管,必须为开源 Telegraf 提供以下配置。您必须为括在 <> 中的变量提供正确的值。
如果不使用帮助程序脚本,则必须下载 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)。
受管虚拟机
[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/FQDN>/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"
未受管虚拟机
[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/FQDN>/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"