You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd /tmp
wget -c https://github.com/prometheus/prometheus/releases/download/v2.13.1/prometheus-2.13.1.linux-amd64.tar.gz
Extract Prometheus Server
tar zxvf prometheus-2.13.1.linux-amd64.tar.gz
Move to some directory
mv prometheus-2.13.1.linux-amd64 /opt/prometheus-server
cd /opt/prometheus-server
Edit configuration file
For example we want to monitor instance on endpoint 167.205.192.12
vim config.yml
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=` to any timeseries scraped from this config.
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: node-exporter-instances
static_configs:
- targets:
- 167.205.192.12:9100
Configure Systemd Service for Prometheus Service
vim /etc/systemd/system/prometheus-server.service
[Unit]
Description=Prometheus Server
[Service]
User=root
ExecStart=/opt/prometheus-server/prometheus --config.file=/opt/prometheus-server/config.yml --web.external-url=http://ip-server:9090/
[Install]
WantedBy=default.target