šHow to install grafana on linux and how to setup with prometheus (whole setup).š
Grafana, paired with Prometheus and Node Exporter, is a powerful monitoring stack for system and application metrics. Prometheus collects metrics from Node Exporter, which provides system stats like CPU, memory, and disk usage. Grafana connects to Prometheus as a data source, offering a user-friendly interface to visualize and analyze these metrics.
This setup is ideal for real-time monitoring, performance analysis, and troubleshooting. With customizable dashboards and alerting capabilities, it helps ensure system reliability and efficiency, making it a go-to solution for DevOps and IT teams.
ā”update packages.
command= sudo apt-get install -y apt-transport-https
command= sudo apt-get install -y software-properties-common wget
command= wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
ā”Add stable repository of Grafana.
command= echo "deb https://packages.grafana.com/enterprise/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
ā”Update repository and Install Grafana.
command=sudo apt-get update
command=sudo apt-get install grafana-enterprise
ā”Start the Grafana Server.
command=sudo systemctl daemon-reload
command=sudo systemctl start grafana-server
command=sudo systemctl status grafana-server
ā”While rebooting the server to auto restart grafana.
command=sudo systemctl enable grafana-server.service
ā”To open pot no. 3000
command= sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT
ā”Go to the browser
ip_address:3000
ā”To visualize metrics, you need to add a data source first. Click Add data source and select Prometheus.
For the URL, enter localhost:9090 and click Save and test. You can see Data source is working. Click on Save and Test.
ā”Click on Import Dashboard paste this code 1860 and click on load
ā”Select the Datasource and click on Import
ā”You will see this output
ā”For node exporter target we have to add job inside /usr/local/bin/prometheus/prometheus.yml.
ā”Now, it will work in prometheus dashboard and grafana dashboard, the data will be availabale.
ā”Conclusion:
The Grafana, Prometheus, and Node Exporter stack is now fully set up on Linux. Grafana provides insightful visualizations of metrics scraped by Prometheus from Node Exporter. This comprehensive setup ensures efficient monitoring of your system's performance.
If you have any questions or face issues, feel free to drop a comment below or mail me at birendra2783@gmail.com!