Perform the following steps on an OES server:
Download and unzip the Prometheus file from Prometheus download site (https://prometheus.io/download/).
tar xfvz prometheus-2.43.0.linux-amd64.tar.gz
Copy the prometheus.sh script to the unzipped directory and run it. See, prometheus.sh.
sh ./prometheus.sh
This script creates user, group, directories, and changes the ownership of the unzipped files and finally creates a service file to start Prometheus service.
Edit /etc/prometheus/exporter-config.yml file to add new metric endpoints (target).
NOTE:Use static_configuration to specify a list of targets and a common labels. It is the canonical way to specify static targets in a scrape configuration.
global:
scrape_interval: 15s
scrape_configs:
- job_name: Docker Servers
static_configs:
- targets: ['localhost:8080']
- job_name: OES Servers
static_configs:
- targets: ['localhost:9100', 'oesnode01:9100', 'oesnode02:9100', 'oesnode03:9100', 'oesnode04.com']
- job_name: 'alert-manager'
static_configs:
- targets: ['localhost:9093']