Skip to content

Instantly share code, notes, and snippets.

@eloylp
Last active February 10, 2020 09:52
Show Gist options
  • Save eloylp/7bd966d2b9895770dd0d47c199009b7f to your computer and use it in GitHub Desktop.
Save eloylp/7bd966d2b9895770dd0d47c199009b7f to your computer and use it in GitHub Desktop.
Node exporter setup
#!/bin/bash
cat << EOF > /etc/systemd/system/node_exporter.service
[Unit]
After=network.target
[Service]
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=multi-user.target
EOF
apt-get update && apt-get install -y wget
cd /tmp
wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
tar -xvzf node_exporter-0.18.1.linux-amd64.tar.gz
cd node_exporter-0.18.1.linux-amd64
chown root.root node_exporter
mv node_exporter /usr/local/bin/
chmod 655 /usr/local/bin/node_exporter
systemctl start node_exporter.service
systemctl enable node_exporter.service
systemctl status node_exporter.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment