Skip to content

Instantly share code, notes, and snippets.

@pawgajda-drs
Created December 5, 2025 15:39
Show Gist options
  • Select an option

  • Save pawgajda-drs/7a8bcbab412d24eb03d0c6825651b6d9 to your computer and use it in GitHub Desktop.

Select an option

Save pawgajda-drs/7a8bcbab412d24eb03d0c6825651b6d9 to your computer and use it in GitHub Desktop.
Install Node Exporter
#!/usr/bin/env bash
set -e
NODE_EXPORTER_VERSION="1.10.2"
NODE_EXPORTER_PLATFORM="linux-amd64"
NODE_EXPORTER_CHECKSUM="c46e5b6f53948477ff3a19d97c58307394a29fe64a01905646f026ddc32cb65b"
wget "https://github.com/prometheus/node_exporter/releases/download/v${NODE_EXPORTER_VERSION}/node_exporter-${NODE_EXPORTER_VERSION}.${NODE_EXPORTER_PLATFORM}.tar.gz"
echo "${NODE_EXPORTER_CHECKSUM} node_exporter-${NODE_EXPORTER_VERSION}.${NODE_EXPORTER_PLATFORM}.tar.gz" > node_exporter-${NODE_EXPORTER_VERSION}.${NODE_EXPORTER_PLATFORM}.tar.gz.sha256sum
sha256sum --check --status "node_exporter-${NODE_EXPORTER_VERSION}.${NODE_EXPORTER_PLATFORM}.tar.gz.sha256sum"
tar xvzf "node_exporter-${NODE_EXPORTER_VERSION}.${NODE_EXPORTER_PLATFORM}.tar.gz"
cp "node_exporter-${NODE_EXPORTER_VERSION}.${NODE_EXPORTER_PLATFORM}/node_exporter" /usr/local/bin
useradd --no-create-home --system --user-group --shell /usr/bin/false node_exporter
chown node_exporter:node_exporter /usr/local/bin/node_exporter
cat << EOF > /etc/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter
Wants=network.target
After=network.target
[Service]
User=node_exporter
Group=node_exporter
Type=simple
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl start node_exporter
systemctl enable node_exporter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment