Node_Exporter安装

Node Exporter GitHub

下载、安装

wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz

tar -zxf node_exporter-1.3.1.linux-amd64.tar.gz
cp node_exporter-1.3.1.linux-amd64/node_exporter /usr/bin/

# 启动服务
node_exporter

配置为使用systemctl控制服务

cat > /etc/systemd/system/node_exporter.service << EOF
[Unit]
Description=node_exporter Daemon

[Service]
ExecStart=/usr/bin/node_exporter  --web.listen-address=0.0.0.0:9100 --collector.systemd --collector.processes
User=root
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target
EOF

服务控制

systemctl enable --now node_exporter
systemctl start node_exporter
systemctl status node_exporter

最后更新于