30 lines
749 B
Plaintext
30 lines
749 B
Plaintext
wget https://github.com/prometheus/node_exporter/releases/download/v1.6.1/node_exporter-1.6.1.linux-amd64.tar.gz && \
|
|
tar xvfz node_exporter-*.tar.gz && \
|
|
rm node_exporter-*.tar.gz
|
|
|
|
sudo mv node_exporter-*.linux-amd64/node_exporter /usr/local/bin
|
|
rm -r node_exporter-*.linux-amd64*
|
|
|
|
sudo useradd -rs /bin/false node_exporter
|
|
|
|
cat > /etc/systemd/system/naiveCaddy.service <<EOF
|
|
[Unit]
|
|
Description=Node Exporter
|
|
Wants=network-online.target
|
|
After=network-online.target
|
|
|
|
[Service]
|
|
User=node_exporter
|
|
Group=node_exporter
|
|
Type=simple
|
|
Restart=on-failure
|
|
RestartSec=5s
|
|
ExecStart=/usr/local/bin/node_exporter
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable --now node_exporter
|
|
sudo systemctl status node_exporter |