Install an External Node Exporter
Now we will install an external Prometheus Node Exporter on a different server.
Now check the node exporter is running.
You can stop, start or restart a node exporter using
1 2 3
Node exporter will now be running on http://[your domain or ip]:9100/metrics
You can now block port 9100 externally, but leave it open internally for localhost.
And optionally, you can also allow a specific ip address or domain on the internet to access the port.
1 2 3 4
iptables settings will be lost in case of system reboot. You will need to reapply them manually,
This will save your settings into two files called,
Any changes you make to the iptables configuration won't be auto saved to these persistent files, so if you want to update these files with any changes, then use the commands,
iptables-save > /etc/iptables/rules.v4
iptables-save > /etc/iptables/rules.v6
Add the new scrape config for the new node exporter to the Prometheus configuration yml on your Prometheus server.
Scroll down to the bottom and add a new scrape target to the existing node job
1 2 3 4
Check changes to the config are syntactically correct
and if OK, then restart the Prometheus service.
If you want to add ssl to the external node exporter you can also use an nginx reverse proxy and add a path specific for the node exporter.
Example, for a server config you can add a metrics location.
1 2 3 4 5 6 7 8 9 10 11 12