如果您不使用協助程式指令碼,則必須在該端點提供所需的特定組態,以將度量張貼到雲端 Proxy。必須為開放原始碼 Telegraf 提供以下組態,具體取決於 vCenter Server 虛擬機器、EC2 AWS 執行個體或 Azure 虛擬機器是否受管理。您必須為包含在 <> 中的變數提供正確的值。
如果不使用協助程式指令碼,則必須下載 mandatory_tags.sh 或 mandatory_tags.bat 並提供已下載指令碼的路徑和 Telegraf 可執行檔的路徑。例如,在以下代碼中,您必須提供以下內容:<Path to mandatory_tags.sh/bat> <path to telegraf executable>。
對於 Linux,從雲端 Proxy 下載 mandatory_tags.sh (https://<CP_IP>/downloads/salt/mandatory_tags.sh)。
對於 Windows,從雲端 Proxy 下載 mandatory_tags.ps1 (
https://<CP_IP>/downloads/salt/mandatory_tags.ps1)。
備註: 對於 Windows 和 Linux,在上述指定命令和位置中使用 <CP_IP> 的相關雲端 Proxy 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"