telegraf监控一台服务器完整配置
telegraf.conf此处时序数据库可选择prometheus或influxdb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
   | [agent]
  interval = "60s"   flush_interval = "60s"  round_interval = true metric_batch_size = 100000 metric_buffer_limit = 10000 collection_jitter = "0s" flush_jitter = "0s" precision = "" hostname = "ip" omit_hostname = false
 
  [global_tags] TPNG = "全局标签"   [[inputs.cpu]] percpu = true totalcpu = true collect_cpu_time = false report_active = true
 
  [inputs.cpu.tags]                   addr = "插件标签" 
  [[inputs.disk]] ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]   [[inputs.diskio]]   [[inputs.kernel]]   [[inputs.mem]]   [[inputs.processes]]   [[inputs.system]] fielddrop = ["uptime_format"]   [[inputs.net]] ignore_protocol_stats = true   [[inputs.net]]   [[outputs.prometheus_client]]
 
  listen = ":9273" metric_version = 2 path="/metrics" string_as_label = true export_timestamp = true
 
   | 
 
