1. 程式人生 > 實用技巧 >【Linux】伺服器視覺化資源與效能監控--Telegraf&Influxdb&Grafana

【Linux】伺服器視覺化資源與效能監控--Telegraf&Influxdb&Grafana

[root@wallet03 ~]# rpm -ivh influxdb-1.7.6.x86_64.rpm
[root@wallet03 ~]# service influxdb start
[root@wallet03 ~]# service influxdb status

[root@wallet03 ~]# yum install -y fontconfig urw-fonts
[root@wallet03 ~]# rpm -ivh grafana-6.2.1-1.x86_64.rpm
[root@wallet03 ~]# service grafana-server start
[root@wallet03 ~]# service grafana-server status

[root@wallet01 ~]# yum install sysstat
[root@wallet01 ~]# rpm -ivh telegraf-1.10.4-1.x86_64.rpm
[root@wallet01 ~]# vi /etc/telegraf/telegraf.conf
[global_tags]
[agent]
  interval = "15s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "15s"
  flush_jitter = "0s"
  precision = ""
  debug = false
  quiet = false
  logfile = ""
  hostname = "wallet01"
  omit_hostname = false

[[outputs.influxdb]]
  urls = ["http://192.168.1.103:8086"]

[[inputs.cpu]]
  percpu = false
  totalcpu = true
  collect_cpu_time = false
  report_active = false  
[[inputs.disk]]
  ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]
[[inputs.diskio]]
[[inputs.kernel]]
[[inputs.mem]]
[[inputs.processes]]
[[inputs.swap]]
[[inputs.system]]
[[inputs.net]]
[[inputs.netstat]]

[[inputs.sysstat]]
    sadc_path = "/usr/lib64/sa/sadc" # required
	sadf_path = "/usr/bin/sadf"
	activities = ["DISK"]

[inputs.sysstat.options]
#     -C = "cpu"
#     -B = "paging"
     -b = "io"
     -d = "disk"             # requires DISK activity
     "-n ALL" = "network"
#     "-P ALL" = "per_cpu"
     -q = "queue"
     -R = "mem"
     -r = "mem_util"
     -S = "swap_util"
     -u = "cpu_util"
     -v = "inode"
     -W = "swap"
     -w = "task"

[root@wallet01 ~]# service telegraf start
[root@wallet01 ~]# service telegraf status