1、下载部署:
[root@localhost ~]# wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
[root@localhost ~]# tar zxf node_exporter-0.18.1.linux-amd64.tar.gz -C /opt/
[root@localhost ~]# cd /opt/
[root@localhost local]# mv node_exporter-0.18.1.linux-amd64 node_exporter
2、添加服务到systemctl
[root@localhost ~]# vim /etc/systemd/system/node_exporter.service
[Unit]
Description=node exporter
Documentation=node exporter
[Service]
ExecStart=/opt/node_exporter/node_exporter
[Install]
WantedBy=multi-user.target
[root@localhost local]# systemctl start node_exporter
[root@localhost local]# systemctl enable node_exporter
[root@localhost local]# ss -tunlp|grep node_exporter
tcp LISTEN 0 128 [::]:9100 [::]:* users:(("node_exporter",pid=20063,fd=3))
访问web界面查看以下,监控状态:
http://localhost:9100/metrics