Installing and Configuring Node Exporter on Rocky Linux for Prometheus Monitoring

Node Exporter is a monitoring agent designed to gather system-level metrics such as CPU, memory, disk, and network usage, exposing them for Prometheus to collect and analyze.

Prometheus serves as a powerful monitoring solution that relies on exporters like Node Exporter to fetch data from various systems.

Installing Rocky Linux

Refer to the following resources for setting up Rocky Linux:

  • VMware Workstation installation guide (with license key)
  • Creating a virtual machine using VMware Workstation
  • Downloading and installing Rocky Linux
  • Setting a static IP address for the network enterface
  • Installing MobaXterm for remote access

Deploying Node Exporter on Rocky Linux

  1. Download Node Exporter

    Visit the official Prometheus download page at https://prometheus.io/download/ and select the Linux amd64 version of the latest release.

  2. Transfer the Package

    Upload the downloaded archive to the root directory (/root/) using SFTP.

    [root@localhost ~]# ll /root/
    
  3. Extract and Move

    Extract the package into /opt/:

    [root@localhost ~]# tar zxvf /root/node_exporter-1.7.0.linux-amd64.tar.gz -C /opt/
    

    Then rename the extracted folder:

    [root@localhost ~]# mv /opt/node_exporter-1.7.0.linux-amd64/ /opt/node_exporter
    
  4. Create Systemd Service

    Define a service file for automatic startup:

    [Unit]
    Description=Node Exporter
    After=network.target
    
    [Service]
    Type=simple
    ExecStart=/opt/node_exporter/node_exporter \
      --collector.ntp \
      --collector.mountstats \
      --collector.systemd \
      --collector.tcpstat
    User=prometheus
    ExecReload=/bin/kill -HUP $MAINPID
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    

    Save it as /etc/systemd/system/node_exporter.service.

  5. Set Permissions

    Adjust ownership of the directory:

    [root@localhost ~]# chown prometheus:root -R /opt/node_exporter
    
  6. Reload Services and Enable Startup

    Reload systemd configuraton and enable the service:

    [root@localhost ~]# systemctl daemon-reload
    [root@localhost ~]# systemctl enable node_exporter.service
    
  7. Start and Verify

    Launch the service and check its status:

    [root@localhost ~]# systemctl start node_exporter.service
    [root@localhost ~]# systemctl status node_exporter.service
    
  8. Configure Firewall

    Open port 9100 for external access:

    [root@localhost ~]# firewall-cmd --zone=public --add-port=9100/tcp --permanent
    [root@localhost ~]# firewall-cmd --reload
    
  9. Validate Metrics Endpoint

    Access http://<your-host>:9100/metrics to confirm data availability.

  10. Update Prometheus Configuration

    Add the target to Prometheus's configuration file (/opt/prometheus/prometheus.yml):

    - job_name: 'nodes'
      static_configs:
        - targets: ['192.168.100.10:9100']
    
  11. Restart Prometheus

    Apply changes by restarting Prometheus:

    [root@localhost ~]# systemctl restart prometheus.service
    [root@localhost ~]# systemctl status prometheus.service
    
  12. Verify Target Status in Prometheus UI

    Navigate to http://<prometheus-host>:9090, go to "Status" → "Targets" to verify that the Node Exporter is correctly registered.

Tags: Rocky Linux node exporter prometheus monitoring systemd

Posted on Tue, 06 Oct 2026 16:49:25 +0000 by neoson