在Telegraf的配置文件(
/etc/telegraf/telegraf.conf
)中,编辑
urls
设置以指定
https
而不是
http
,并将
localhost
更改为相关域名。 如果您使用自签名证书,请取消
insecure_skip_verify
的注释设置并将其设置为true。
################################################################################ OUTPUT PLUGINS ################################################################################# Configuration for influxdb server to send metrics to[[outputs.influxdb]] ## The full HTTP or UDP endpoint URL for your InfluxDB instance. ## Multiple urls can be specified as part of the same cluster, ## this means that only ONE of the urls will be written to each interval. # urls = ["udp://localhost:8089"] # UDP endpoint example urls = ["https://<domain_name>.com:8086"][...] ## Optional SSL Config [...] insecure_skip_verify = true # <-- Update only if you're using a self-signed certificate
然后重启Telegraf就可以啦!