SHORT INTRODUCTION
Grafana with Prometheus
----First, Setup For Prometheus----
We need two servers: Main-server (192.168.33.25) & Client-server (192.168.33.30), Make sure both are accessible
Login to fosnix servers – 192.168.33.25
Step 1: Update & Disable SELinux
Replace “SELINUX=disabled” from “SELINUX=enforcing”
Save & Exit from file
Then, Reboot the System
Step 2 : Download Prometheus package
Run the below command to download the package-
Step 3 : Configure Prometheus
Add a Prometheus user
Create directories & change the owner of them
Now Extract the Prometheus downloaded file & Rename it-
Copy “prometheus” and “promtool” binary from the “prometheuspackage” directory to “/usr/local/bin” & Change the ownership of them to prometheus user
Copy “consoles” and “console_libraries” directories from the “prometheuspackage” to “/etc/prometheus” directory & Change the ownership of them to prometheus user
Now, to configure the prometheus file you have to create the prometheus.yml file & add the below lines in it
global: scrape_interval: 10s scrape_configs: - job_name: 'prometheus_master' scrape_interval: 5s static_configs: - targets: ['localhost:9090']
Save & Exit from file
Change the Ownership of the File
Configure the Prometheus Service File-
Create a file and Copy paste the below lines into it
Save & Exit from file,
Restart the systemd file & Prometheus service
If your firewall is on, so stop it from the below command-
Step 4 : Access Prometheus Web Interface
Open your browser & type the below URL with your SERVER-IP
Step 5 : Monitor Client Server Using Prometheus
Login to Client servers – 192.168.33.30
You need to download node exporter first by run the command below –
Now, Extract the package
Next, Create a user for node-exporter & move to /usr/local/bin
Create a file for node-exporter & copy paste the lines below in it
Save & Exit from file,
Restart the system daemon, also start & enable the node exporter
If your firewall is on, so stop it from the below command-
Open your browser & type the below URL with your SERVER-IP
Login back to the main-servers – 192.168.33.25
To configure the node exporter modify the prometheus.yml file
Add the below lines in the file as shown below –
Restart the prometheus service –
Open your browser & type the below URL with your SERVER-IP
----Now, Setup For Grafana----
Login to the Grafana-server – 192.168.33.31
Step 1: Insert the Grafana's repository file
Copy Paste the below lines in the file –
Step 2 : Install Grafana
Start & Enable the grafana services
Open your browser & type the url with port “3000” as shown below
Default “Username/Password” is “admin/admin”
After login from default Id, You can change your password or you can skip it as you choice
Here’s the Dashboard of Grafana –
Add the Data Source & Select the Prometheus as shown below –
Insert your Prometheus-Server-IP with port “9090” & Save it-
Here’s the Grafana Monitoring Dashboard
No responses yet