prometheus监控配置

2023-08-09  本文已影响0人  阿汤哥_8d27

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

http://ip:9100/

2、Prometheus Server端配置

查看 /usr/local/prometheus/prometheus.yml配置

image.png

cat /usr/local/prometheus/target/ambnode.yml 添加被监控主机地址

image.png

#重启服务

service prometheus restart

#验证server端

image.png

#Grafana展示配置

image.png

文档参考:
https://blog.csdn.net/qq_43437874/article/details/120355246
配置开机启动

上一篇 下一篇

猜你喜欢

热点阅读