Skip to content

Instantly share code, notes, and snippets.

@brantje
Forked from nwesterhausen/node_exporter_setup.md
Last active March 1, 2024 17:20
Show Gist options
  • Save brantje/ab06184d85d0412786845f4df9c11787 to your computer and use it in GitHub Desktop.
Save brantje/ab06184d85d0412786845f4df9c11787 to your computer and use it in GitHub Desktop.
node_exporter installation on rpi

Installing node_exporter

Steps to install node_exporter

  1. Add user for node_exporter

    sudo useradd --no-create-home --shell /bin/false node_exporter
  2. Download node_exporter

    cd
    wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-arm64.tar.gz
  3. Extract node_exporter

    tar xvf node_exporter-1.7.0.linux-arm64.tar.gz
  4. Copy node_exporter to /opt

    sudo mv node_exporter-1.7.0.linux-arm64 /opt/node_exporter
    sudo chown -R node_exporter:node_exporter /opt/node_exporter
  5. Create service file for systemd

    sudo nano /etc/systemd/system/node_exporter.service
  6. Fillin as follows:

    [Unit]
    Description=Node Exporter
    Wants=network-online.target
    After=network-online.target
    
    [Service]
    User=node_exporter
    Group=node_exporter
    Type=simple
    ExecStart=/opt/node_exporter/node_exporter --collector.systemd
    
    [Install]
    WantedBy=multi-user.target
    
  7. Start the service with systemd and verify it runs

    sudo systemctl daemon-reload
    sudo systemctl start node_exporter && sudo journalctl -f --unit node_exporter
  8. On the prometheus server, dont' forget to add the static config for the collection of data!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment