如果您不使用協助程式指令碼,則必須在該端點提供所需的特定組態,以將度量張貼到雲端 Proxy。根據虛擬機器是受管理還是未受管理,必須為開放原始碼 Telegraf 提供下列組態。您必須為包含在 <> 中的變數提供正確的值。
如果不使用協助程式指令碼,則必須下載 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)。
受管理的虛擬機器
[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"