wget https://repos.influxdata.com/rhel/8/x86_64/stable/telegraf-1.23.4-1.x86_64.rpm
基本概念
telegraf 属于 TICK 技术栈中的T

Telegraf 是一个用Go语言编写的代理程序,可收集系统和服务的统计数据,并写入到InfluxDB数据库。内存占用小,通过插件系统可轻松添加支持其他服务的扩展。
Telegraf metric是用于在处理期间对数据建模的内部表示,这些指标完全基于InfluxDB的数据模型,包含四个主要组件:
度量名称(Measurement)
标签(tags)
字段(Field)
时间戳
为什么要用Telegraf ?
可以采集多种组件的运行信息cpu memory,不需要手动写定时脚本采集,降低了数据的获取难度
配置简单
与InfluxDB完美结合
按照时间序列采集数据
轻量级,占用内存小
安装
rpm -ivh telegraf-1.23.4-1.x86_64.rpm
配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| [root@localhost ~]# diff /etc/telegraf/telegraf.conf /etc/telegraf/telegraf.conf.orig
106c106
< hostname = "192.168.100.197"
---
> hostname = ""
130,136d129
< urls = ["http://192.168.100.178:8086"] # required
< database = "telegraf" # required
< timeout = "5s"
< username = "telegraf"
< password = "password"
<
<
5849,5850c5842
< [[inputs.net]]
< interfaces = ["eth*", "enp0s[0-1]", "lo"]
---
>
6081,6085d6072
< [[inputs.nstat]]
< proc_net_netstat = "/proc/net/netstat"
< proc_net_snmp = "/proc/net/snmp"
< proc_net_snmp6 = "/proc/net/snmp6"
< dump_zeros = true
|
add
1
2
3
4
| [[inputs.procstat]]
exe = "mariadbd"
[[inputs.procstat]]
exe = "httpd"
|