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
-
Download Node Exporter
Visit the official Prometheus download page at https://prometheus.io/download/ and select the Linux amd64 version of the latest release.
-
Transfer the Package
Upload the downloaded archive to the root directory (
/root/) using SFTP.[root@localhost ~]# ll /root/ -
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 -
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.targetSave it as
/etc/systemd/system/node_exporter.service. -
Set Permissions
Adjust ownership of the directory:
[root@localhost ~]# chown prometheus:root -R /opt/node_exporter -
Reload Services and Enable Startup
Reload systemd configuraton and enable the service:
[root@localhost ~]# systemctl daemon-reload [root@localhost ~]# systemctl enable node_exporter.service -
Start and Verify
Launch the service and check its status:
[root@localhost ~]# systemctl start node_exporter.service [root@localhost ~]# systemctl status node_exporter.service -
Configure Firewall
Open port 9100 for external access:
[root@localhost ~]# firewall-cmd --zone=public --add-port=9100/tcp --permanent [root@localhost ~]# firewall-cmd --reload -
Validate Metrics Endpoint
Access
http://<your-host>:9100/metricsto confirm data availability. -
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'] -
Restart Prometheus
Apply changes by restarting Prometheus:
[root@localhost ~]# systemctl restart prometheus.service [root@localhost ~]# systemctl status prometheus.service -
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.