SHORT INTRODUCTION
Prometheus is a free open source application used for event monitoring and awareness. Collects and records real-time metrics in a series of data areas. Prometheus is written on Go and distributed under Apache License 2.0.
Prometheus requires many exports to be targeted. The issuer releases and publishes metrics to the appropriate port in the target area. The Prometheus monitoring server will capture these instruments and store them in the timeline. Following the masterpiece from Prometheus, Texts clarifies the concept and flow of the program.
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 –
- job_name: 'node_exporter_centos' scrape_interval: 5s static_configs: - targets: ['192.168.33.30:9100']
Restart the prometheus service –
Open your browser & type the below URL with your SERVER-IP
No responses yet