如何在Ubuntu 18.04/Debian 9上安装和配置Telegraf
Telegraf是一名代理商,用于从其运行的系统中收集绩效指标以及在该系统上运行的服务。
收集的指标将输出到 Influx 或者其他支持的数据存储。
从 Influx ,我们应该能够使用Grafana等工具可视化趋势和系统性能。
遥测的基本使用流程是:TeleGraf代理安装在所有服务器上(Ubuntu,Debian,Windows,CentOS 等)。
它是配置的要收集我们想要收集的指标被推到 Influx Influx 的 Influx 数据源,然后添加到GrafanAgrafana图形中创建 - 他们从 Influx 数据源获取数据
我最近涵盖了Linux上的Grafana和influxdB;在Ubuntu 18.04和Debian 9上安装influxDB,在CentOS 7上安装Grafana和FlowuxDB,以及如何在Ubuntu 18.04和Debian 9上安装Grafana。
如何在Ubuntu 18.04 LTS上安装TeleGraf
在Ubuntu 18.04上安装Telegraf 18.04是从 Influx 数据库完成的。
添加回收器后,然后可以使用APT包管理器安装包。
将influxData存储库添加到文件/etc/apt/sources.list.d/influxdata.list
cat <<EOF | sudo tee /etc/apt/sources.list.d/influxdata.list deb https://repos.influxdata.com/ubuntu bionic stable EOF
导入APT键:
sudo curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add
更新APT索引并安装Telegraf
sudo apt-get update
安装Telegraf:
$sudo apt-get -y install telegraf Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: telegraf 0 upgraded, 1 newly installed, 0 to remove and 73 not upgraded. Need to get 17.5 MB of archives. After this operation, 59.9 MB of additional disk space will be used. Get:1 https://repos.influxdata.com/ubuntu bionic/stable amd64 telegraf amd64 1.9.3-1 [17.5 MB] Fetched 17.5 MB in 6s (2,715 kB/s) Selecting previously unselected package telegraf. (Reading database ... 105274 files and directories currently installed.) Preparing to unpack .../telegraf_1.9.3-1_amd64.deb ... Unpacking telegraf (1.9.3-1) ... Setting up telegraf (1.9.3-1) ... Created symlink /etc/systemd/system/multi-user.target.wants/telegraf.service -> /lib/systemd/system/telegraf.service.
启动并使服务启动启动。
$sudo systemctl enable --now telegraf $sudo systemctl is-enabled telegraf enabled
检查服务状态:
$systemctl status telegraf * telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB Loaded: loaded (/lib/systemd/system/telegraf.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2019-01-30 04:03:11 PST; 2min 54s ago Docs: https://github.com/influxdata/telegraf Main PID: 3385 (telegraf) Tasks: 11 (limit: 1110) CGroup: /system.slice/telegraf.service `-3385 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d
在Debian 9上安装Telegraf
使用以下命令添加流入数据存储库:
cat <<EOF | sudo tee /etc/apt/sources.list.d/influxdata.list deb https://repos.influxdata.com/debian stretch stable EOF
导入用于安装签名包的GPG键:
sudo curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add
更新APT索引并安装Telegraf包:
sudo apt-get update sudo apt-get -y install telegraf
启动Telegraf Service:
sudo systemctl enable --now start telegraf
我们可以检查状态以确认是否使用使用:
sudo systemctl status telegraf
配置Telegraf.
既然我们拥有 Influx 和Telegraf运行,我们可以通过我们的教程通过Grafana和Telegraf来监控Linux系统,以了解如何使用Grafana配置TeleGraf并使用它。