Node Exporter Setup Guide + Monitoring AWS Auto Scaling from Prometheus
Overview
Last time, I set up a Prometheus Server.

This time, I’ll set up Node Exporter on the servers to be monitored.
What we’ll do this time, in 3 lines
- Install Node Exporter
- Create a Node Exporter startup script
- Start Node Exporter and monitor it from the Prometheus Server
Environment
- CentOS Linux release 7.1.1503 (Core)
Installing Node Exporter
- Install the package
1 | $ cd /usr/local/src |
- Create a symbolic link
1 | $ sudo ln -s /usr/local/node_exporter/node_exporter /bin/node_exporter |
Starting Node Exporter
If you just want to start it up, this is all you need
1 | $ sudo node_exporter |
Access http://node_exporter_server:9100/metrics and
you can check the server metrics that node_exporter collects.
Just like Prometheus, we’ll create a startup script for Node Exporter and manage its startup there.
Creating a startup script
- Node Exporter startup script
1 | $ sudo cat << 'EOF' | sudo tee /usr/lib/systemd/system/node_exporter.service |
- Startup configuration
1 | $ sudo systemctl daemon-reload |
Let’s access it
Access http://node_exporter_server:9100/metrics.
If it displays like the following, Node Exporter has started successfully.
Monitoring from Prometheus
This time, we’ll configure metric collection from node_exporter running on AWS EC2 instances.
- The monitoring server needs a role configured with
AmazonEC2ReadOnlyAccessattached.
* Configure the security group on the target servers so that the monitoring server can access the 9100 port.
- Edit /usr/local/prometheus-server/prometheus.yml
The configuration below specifies a region and collects metrics from instances you have access to.
1 | # my global config |
Narrowing down monitoring targets by tag
If you want to monitor all instances, the configuration above works fine.
However, there are cases where you want to narrow down the monitoring targets by certain conditions.
In such cases, Prometheus provides a way to filter by instance configuration tags using relabel_configs.
- Instance tag configuration
- prometheus.yml configuration
1 | # my global config |
- After editing prometheus.yml, restart
1 | $ sudo systemctl restart prometheus.service |
Checking that Prometheus can monitor the server running node_exporter
http://prometheus_server:9090/consoles/node.html
Clicking the link of a Node marked Up : Yes lets you view its CPU and Disk graphs.
Next time, I’ll set up Alertmanager on the monitoring target.
References
Node Exporter Setup Guide + Monitoring AWS Auto Scaling from Prometheus
https://kenzo0107.github.io/en/2017/01/25/prometheus-aws-autoscaling/