Linux Node Exporter Installation Script will install node_exporter on the linux server automatically whichever version you want. This script will also create the service (systemd) script as well. This script will help you running node exporter running on the custom IP Address and PORT.
What's in this script:
- User interactive script
- User Required version will be installed
- Custom System script will be created automatically.
- Only 2 step interactive script.
- Prompts for a Node Exporter version and downloads that release from the official GitHub.
- Extracts the archive and creates a
currentsymlink to the extracted folder in the working directory. - Detects the machine's primary IP address and stores it in
host. - Writes a systemd unit at
/etc/systemd/system/node_exporter.servicethat runsnode_exporterbound to$host:9100. - Reloads systemd, starts the service, and shows its status.
Notes:
- The service
ExecStartdefaults to/opt/platform/nodeexporter/current/node_exporter. Adjust this path or move the extracted files so that this binary exists at that location. - Replace
service_account_nameandservice_group_namein the unit with valid user/group names on your system.
- A Linux host using systemd with root or sudo access
wgetandtarinstalled- Outbound internet access to
github.com
- Make the script executable:
chmod +x node_exporter.sh
- Run it as root (or with sudo):
sudo ./node_exporter.sh
- When prompted, enter the Node Exporter version to install (e.g.,
1.8.1). - Verify the service status:
sudo systemctl status node_exporter.service
- Validate metrics endpoint (replace
<host>with your IP or hostname):curl http://<host>:9100/metrics
Optional:
- Enable service at boot:
sudo systemctl enable node_exporter.service - To listen on all interfaces, change the listen address in the unit to
:9100.
