(一):系统监控软件介绍及安装部署
安装java
yum install -y java
安装配置收集器:node_exporter
下载
注意安装最新版本号:
通过网址查看最新版本号:https://prometheus.io/download/
wget -c https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz
解压
tar -zxvf node_exporter-1.3.1.linux-amd64.tar.gz -C /opt/
启动
cd node_exporter-2.35.0.linux-amd64/
//查看帮助文档
./node_exporter --help
//启动
nohup ./node_exporter &
//查看进程是否启动
ps -ef|grep node_exporter
//查看端口
netstat -naop|grep 9100
通过网址查看采集数据:www.11111:9100.展示数据同命令top一致
安装prometheus
下载
wget -c https://github.com/prometheus/prometheus/releases/download/v2.35.0/prometheus-2.35.0.linux-amd64.tar.gz
解压
tar -zxvf prometheus-2.35.0.linux-amd64.tar.gz -C /opt/
修改配置文件
增加监控机器
vi prometheus.yml
vi prometheus.yml
- job_name: "236"
static_configs:
- targets: ['39.103.154.236:9100']
启动
./prometheus --config.file=prometheus.yml &
安装grafana
通过docker安装grafana
。。。。。。。。。。
通过rpm包安装grafana
通过官网查看下载地址:https://grafana.com/grafana/download
下载
wget https://dl.grafana.com/enterprise/release/grafana-enterprise-8.5.0-1.x86_64.rpm
安装
yum localinstall grafana-enterprise-8.5.0-1.x86_64.rpm
启动
systemctl start grafana-server.service
登录
网址:ip:3000
账户及密码:admin
配置数据源:
配置prometheus当做数据源
步骤:
1、进入config-DataSource
2、配置url:prometheus路径:http://localhost:9090
3、导入dashboard:ID:11074/8919
(1)、dashboard---Browse---import
(2)、输入ID---LOAD---Import
node_exporter----prometheus----grafana简要解析
node_exporter:收集器,负责收集操作系统上数据
prometheus:拉取node_exporter收集的数据进行存储
grafana:通过prometheus传入的数据,放在dashboard展示
计数器
计数器的类型:
百分比、数值
计数器的统计方式:
累计、实时