Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# prometheus-course
Course files for Monitoring and Alerting with Prometheus
Empty file modified flask-prometheus/.gitignore
100644 → 100755
Empty file.
Empty file modified flask-prometheus/Dockerfile
100644 → 100755
Empty file.
Empty file modified flask-prometheus/docker-compose.yml
100644 → 100755
Empty file.
Empty file modified flask-prometheus/requirements.txt
100644 → 100755
Empty file.
Empty file modified grafana/dashboards/node-dashboard.json
100644 → 100755
Empty file.
Empty file modified grafana/provisioning/dashboards.yaml
100644 → 100755
Empty file.
Empty file modified grafana/provisioning/datasource-prometheus.yaml
100644 → 100755
Empty file.
Empty file modified kubernetes/README.md
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion scripts/1-install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
PROMETHEUS_VERSION="2.2.1"
PROMETHEUS_VERSION="2.21.0"
wget https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.linux-amd64.tar.gz
tar -xzvf prometheus-${PROMETHEUS_VERSION}.linux-amd64.tar.gz
cd prometheus-${PROMETHEUS_VERSION}.linux-amd64/
Expand Down
2 changes: 1 addition & 1 deletion scripts/2-node-exporter.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
NODE_EXPORTER_VERSION="0.16.0"
NODE_EXPORTER_VERSION="1.0.1"
wget https://github.com/prometheus/node_exporter/releases/download/v${NODE_EXPORTER_VERSION}/node_exporter-${NODE_EXPORTER_VERSION}.linux-amd64.tar.gz
tar -xzvf node_exporter-${NODE_EXPORTER_VERSION}.linux-amd64.tar.gz
cd node_exporter-${NODE_EXPORTER_VERSION}.linux-amd64
Expand Down
2 changes: 1 addition & 1 deletion scripts/4-install-alertmanager.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
ALERTMANAGER_VERSION="0.15.0"
ALERTMANAGER_VERSION="0.21.0"
wget https://github.com/prometheus/alertmanager/releases/download/v${ALERTMANAGER_VERSION}/alertmanager-${ALERTMANAGER_VERSION}.linux-amd64.tar.gz
tar xvzf alertmanager-${ALERTMANAGER_VERSION}.linux-amd64.tar.gz
cd alertmanager-${ALERTMANAGER_VERSION}.linux-amd64/
Expand Down
58 changes: 58 additions & 0 deletions scripts/7-snmp-exporter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
SNMP_EXPORTER_VERSION="0.19.0"
wget https://github.com/prometheus/snmp_exporter/releases/download/v${SNMP_EXPORTER_VERSION}/snmp_exporter-${SNMP_EXPORTER_VERSION}.linux-amd64.tar.gz
tar -xzvf snmp_exporter-${SNMP_EXPORTER_VERSION}.linux-amd64.tar.gz
cd snmp_exporter-${SNMP_EXPORTER_VERSION}.linux-amd64
cp snmp_exporter /usr/local/bin

#https://github.com/prometheus/snmp_exporter/releases/download/v0.19.0/snmp_exporter-0.19.0.linux-amd64.tar.gz

# create user
useradd --no-create-home --shell /bin/false snmp_exporter

chown snmp_exporter:snmp_exporter /usr/local/bin/snmp_exporter

echo '[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target

[Service]
User=snmp_exporter
Group=snmp_exporter
Type=simple
ExecStart=/usr/local/bin/snmp_exporter

[Install]
WantedBy=multi-user.target' > /etc/systemd/system/snmp_exporter.service

# enable snmp_exporter in systemctl
systemctl daemon-reload
systemctl start snmp_exporter
systemctl enable snmp_exporter


echo "Setup complete.
Add the following lines to /etc/prometheus/prometheus.yml:

# A scrape configuration containing exactly one endpoint to scrape:
scrape_configs:
# Cisco
- job_name: 'Cisco'
scrape_interval: 120s
scrape_timeout: 120s
file_sd_configs:
- files :
- /etc/prometheus/targetCisco.yml
# SNMP device.
metrics_path: /snmp
params:
module: [Cisco] #which OID's we will be querying in
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- target_label: __address__
replacement: 127.0.0.1:9116 # The SNMP exporter's real hostname:port.

"

43 changes: 43 additions & 0 deletions scripts/8-haproxy-exporter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
HAPROXY_EXPORTER_VERSION="0.12.0"
#https://github.com/prometheus/haproxy_exporter/releases/download/v0.12.0/haproxy_exporter-0.12.0.linux-amd64.tar.gz
wget https://github.com/prometheus/haproxy_exporter/releases/download/v${HAPROXY_EXPORTER_VERSION}/haproxy_exporter-${HAPROXY_EXPORTER_VERSION}.linux-amd64.tar.gz
tar -xzvf haproxy_exporter-${HAPROXY_EXPORTER_VERSION}.linux-amd64.tar.gz
cd haproxy_exporter-${HAPROXY_EXPORTER_VERSION}.linux-amd64
cp haproxy_exporter /usr/local/bin

# create user
useradd --no-create-home --shell /bin/false haproxy_exporter

chown haproxy_exporter:haproxy_exporter /usr/local/bin/haproxy_exporter

echo '[Unit]
Description=Haproxy Exporter
Wants=network-online.target
After=network-online.target

[Service]
User=haproxy_exporter
Group=haproxy_exporter
Type=simple
ExecStart=/usr/local/bin/haproxy_exporter \
--haproxy.scrape-uri="http://ip:9595/stats;csv"

[Install]
WantedBy=multi-user.target' > /etc/systemd/system/haproxy_exporter.service

# enable haproxy_exporter in systemctl
systemctl daemon-reload
systemctl start haproxy_exporter
systemctl enable haproxy_exporter


echo "Setup complete.
Add the following lines to /etc/prometheus/prometheus.yml:

- job_name: 'haproxy_exporter'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9100']
"

60 changes: 60 additions & 0 deletions scripts/install-blackbox-exporter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

#https://github.com/prometheus/blackbox_exporter/releases/download/v0.18.0/blackbox_exporter-0.18.0.linux-amd64.tar.gz
BLACKBOX_EXPORTER_VERSION="0.18.0"
wget https://github.com/prometheus/blackbox_exporter/releases/download/v${BLACKBOX_EXPORTER_VERSION}/blackbox_exporter-${BLACKBOX_EXPORTER_VERSION}.linux-amd64.tar.gz
tar -xzvf consul_exporter-${BLACKBOX_EXPORTER_VERSION}.linux-amd64.tar.gz
cd consul_exporter-${BLACKBOX_EXPORTER_VERSION}.linux-amd64
cp consul_exporter /usr/local/bin

# create user
useradd --no-create-home --shell /bin/false blackbox_exporter

chown blackbox_exporter:blackbox_exporter /usr/local/bin/blackbox_exporter

echo '[Unit]
Description=blackbox_exporter
Wants=network-online.target
After=network-online.target

[Service]
User=blackbox_exporter
Group=blackbox_exporter
Type=service
ExecStart=/usr/local/bin/blackbox_exporter

[Install]
WantedBy=multi-user.target' > /etc/systemd/system/blackbox_exporter.service

# enable blackbox_exporter in systemctl
systemctl daemon-reload
systemctl start blackbox_exporter
systemctl enable blackbox_exporter


echo "Setup complete.
Add the following lines to /etc/prometheus/prometheus.yml:


- job_name: blackbox_metadata
params:
module: [http_2xx]
target:
- https://wikipedia.com
metrics_path: /probe
scrape_interval: 30s
scrape_timeout: 10s
static_configs:
- targets:
- south.rootsami.dev:9115
- north.rootsami.dev:9115
- east.rootsami.dev:9115
relabel_configs:
- source_labels: [__param_target]
target_label: target
- source_labels: [__address__]
separator: ';'
regex: '(.*):.*'
target_label: instance
replacement: 'ip:9115'
"
Empty file modified spring-boot-prometheus/Dockerfile
100644 → 100755
Empty file.
Empty file modified spring-boot-prometheus/README.md
100644 → 100755
Empty file.
Empty file modified spring-boot-prometheus/pom.xml
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified use-cases/ec2-auto-discovery/lab.txt
100644 → 100755
Empty file.