关于python:glancesinfluxdbgranfana打造服务器监控系统

36次阅读

共计 1145 个字符,预计需要花费 3 分钟才能阅读完成。

服务监控就是你的眼睛,当你对服务器运行状况无所不知时,你应该感到如坐针毡。

<!–more–>

glances 装置

glances 是由 python 编写的,因而能够应用 pip 间接装置


pip3 install glances

influxdb 装置


wget https://dl.influxdata.com/influxdb/releases/influxdb-1.8.2.x86_64.rpm

sudo yum localinstall influxdb-1.8.2.x86_64.rpm

收集数据到 influxdb

配置 glances

vim /etc/glances/glances.conf


[influxdb]

# Configuration for the --export influxdb option

# https://influxdb.com/

host=localhost

port=8086

user=root

password=root

db=glances

prefix=localhost

#tags=foo:bar,spam:eggs

pip3 install influxdb

glances --export influxdb

执行 glances --export influxdb 测试下,报错

InfluxDB database 'glances' did not exist. Please create it 须要新建数据库。

执行 shell influx


CREATE DATABASE glances #创立数据

SHOW DATABASES # 查看数据库

再次执行 glances --export influxdb , 可显示如下代表目前一切正常

granfana 装置


wget https://dl.grafana.com/oss/release/grafana-7.1.5-1.x86_64.rpm

sudo yum install grafana-7.1.5-1.x86_64.rpm

启动


systemctl daemon-reload

systemctl start grafana-server

systemctl status grafana-server

  

systemctl enable grafana-server.service

配置数据源

grafana 还反对 zipkin

博客内容遵循 署名 - 非商业性应用 - 雷同形式共享 4.0 国内 (CC BY-NC-SA 4.0) 协定

本文永恒链接是:http://visonforcoding.github.io/2020/08/25/glances-influxdb-granfana%E6%89%93%E9%80%A0%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9B%91%E6%8E%A7%E7%B3%BB%E7%BB%9F/

请我喝杯咖啡

正文完
 0