Skip to content

Instantly share code, notes, and snippets.

@DarkPark
Created February 18, 2020 08:54
Show Gist options
  • Save DarkPark/6c090f90be1d8c0921a02aa8fd3d7175 to your computer and use it in GitHub Desktop.
Save DarkPark/6c090f90be1d8c0921a02aa8fd3d7175 to your computer and use it in GitHub Desktop.
Prometheus Node Exporter setup
useradd --no-create-home --shell /bin/false node_exporter
wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
tar xvfz node_exporter-0.18.1.linux-amd64.tar.gz
mv node_exporter-0.18.1.linux-amd64/node_exporter /usr/local/bin/
rm -rf ./node_exporter-0.18.1.linux-amd64*

vim /etc/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target

[Service]
User=node_exporter
Group=node_exporter
ExecStart=/usr/local/bin/node_exporter

[Install]
WantedBy=default.target

systemctl daemon-reload
systemctl start node_exporter
systemctl status node_exporter
systemctl enable node_exporter
curl 'localhost:9100/metrics'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment