1、node_exporter安装
下载地址:https://prometheus.io/download/
wget https://github.com/prometheus/node_exporter/releases/download/v1.6.1/node_exporter-1.6.1.linux-amd64.tar.gz
tar -zxvf node_exporter-1.6.1.linux-amd64.tar.gz
cp ./node_exporter-1.6.1.linux-amd64/node_exporter /usr/local/bin/
配置启动文件
vim /usr/lib/systemd/system/node_exporter.service
[Unit]
Description=Prometheus Monitoring System
Documentation=Prometheus Monitoring System
[Service]
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=multi-user.target
刷新文件
systemctl daemon-reload
启动命令
systemctl start node_exporter #启动
systemctl stop node_exporter #停止
systemctl restart node_exporter #重启
systemctl status node_exporter #查看状态
开通9100端口验证
/mysh/sys/iptables add 9100
/mysh/sys/iptables restart
查看被监控的metrics
2、Prometheus Server端配置
查看 /usr/local/prometheus/prometheus.yml配置
cat /usr/local/prometheus/target/ambnode.yml 添加被监控主机地址
#重启服务
service prometheus restart
#验证server端
#Grafana展示配置
文档参考:
https://blog.csdn.net/qq_43437874/article/details/120355246
配置开机启动