systemd 管理node_exporter
https://prometheus.io/download/#node_exporter
wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gz
~]# tar -xf node_exporter-1.7.0.linux-amd64.tar.gz
node_exporter-1.7.0.linux-amd64 node_exporter-1.7.0.linux-amd64.tar.gz
~]# cd node_exporter-1.7.0.linux-amd64
node_exporter-1.7.0.linux-amd64]# mv node_exporter /usr/bin/
cat > /usr/lib/systemd/system/node_exporter.service <<EOF
[Unit]
Description=node_exporter
After=syslog.target
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/node_exporter
Restart=always
RestartSec=10
StartLimitInterval=100
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable node_exporter
systemctl start node_exporter
ss -lntup | grep 9100
tcp LISTEN 0 1024 [::]:9100 [::]:* users:(("node_exporter",pid=22493,fd=3))
docker 启动systemd
docker run -d --name node_exporter --restart=always --net="host" --pid="host" -v "/proc:/host/proc:ro" -v "/sys:/host/sys:ro" -v "/:/rootfs:ro" prom/node-exporter --path.procfs=/host/proc --path.rootfs=/rootfs --path.sysfs=/host/sys --collector.filesystem.ignored-mount-points='^/(sys|proc|dev|host|etc)($$|/)'
标签:node,exporter,--,主机,host,Prometheus,1.7,linux,模板
From: https://www.cnblogs.com/gshelldon/p/17993960