This repo is shows us how to install prometheus and grafana on AWS-EC2 (Ubuntu).
- Install Prometheus and configure Prometheus to monitor itself
- Install Node Exporter on other EC2 Instances i.e. Pormetheus_server
- Configure Prometheus for the EC2 Instance i.e. Target_server
- Install Grafana
- Prometheus EC2 instance t2.micro
- Node EC2 instances to monitor
- Security Groups Configured properly
- Clone this git repo
Port 9090 — Prometheus Server Port 9100 — Prometheus Node Exporter Port 3000 — Grafana
Prometheus is an open source tool for monitoring and alerting applications. Now we will install the Prometheus on one of the EC2 Instance. You can download the latest version from here.
- Clone my git repo
- Run the install-prometheus.sh script
./install-prometheus.sh- This script will install everything and configured it. You can change the version as per your project.
Now to monitor your servers you need to install the node exporter on all your target machine which is like a monitoring agent on all the servers.
You can clone this repo and run it directly using below command Run in this directory to build and run the app:
./install-node-exporter.shNow we will configure the Prometheus for our EC2 instance where we have installed the node-exporter. Login to the Prometheus server and edit the file or you can clone this file/etc/prometheus/prometheus.yml
Change target value from localhost to your node-exporter IP
sudo vim /etc/prometheus/prometheus.yml- targets: ['Pub-IP:9100']Restart the Prometheus server
sudo systemctl restart prometheus
sudo systemctl status prometheusOnce Prometheus is installed successfully then we can install the Grafana and configure Prometheus as a datasource. Grafana is an opensource tool which is used to provide the visualization of your metrics. You can download the latest version of Grafana from here
Run the below file
./install-grafana.shMake sure that port 3000 is open for this instance.
http://yourip:3000Login with username :
While creating Data Soruce in Grafana make sure to give your Prometheus server pub-ip:9090 in Prometheus server URL
You can import Different dashboards from here
After that copy the ID of the Dashboard. Open the Import section from Dashboard and paste it in the dashboard id box.

We have successfully learnt how to monitor the AWS EC2 instances using Prometheus and visualize the dashboard using Grafana.




