Commit b81fff3e authored by moritz.weichert's avatar moritz.weichert

Added alertmanager

parent 907f006e
../prometheus-only/alert.rules.yml
\ No newline at end of file
route:
receiver: pushover_receiver
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
group_by: [cluster, alertname]
receivers:
- name: pushover_receiver
pushover_configs:
- user_key: uq2igmdbjbpz5ay2n4mc1ry7djs8yz
token: ay4yuv58m9k9c11qvbbpqmpawfyko6
version: "3"
services:
prom:
image: prom/prometheus:v2.4.3
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- ./alert.rules.yml:/etc/prometheus/alert.rules.yml
command: "--config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus"
ports:
- 9090:9090
depends_on:
- exporter
exporter:
image: prom/node-exporter:v0.16.0
ports:
- "9100:9100"
alertmanager:
image: prom/alertmanager:v0.15.2
volumes:
- ./alertmanager.yml:/alertmanager.yml
command:
- '--config.file=/alertmanager.yml'
- '--web.external-url=http://localhost:9093/'
ports:
- '9093:9093'
\ No newline at end of file
../prometheus-only/prometheus.yml
\ No newline at end of file
alerts1='[
{
"labels": {
"alertname": "DiskRunningFull",
"dev": "sda1",
"instance": "example1"
},
"annotations": {
"info": "The disk sda1 is running full",
"summary": "please check the instance example1"
}
},
{
"labels": {
"alertname": "DiskRunningFull",
"dev": "sda2",
"instance": "example1"
},
"annotations": {
"info": "The disk sda2 is running full",
"summary": "please check the instance example1",
"runbook": "the following link http://test-url should be clickable"
}
},
{
"labels": {
"alertname": "DiskRunningFull",
"dev": "sda1",
"instance": "example2"
},
"annotations": {
"info": "The disk sda1 is running full",
"summary": "please check the instance example2"
}
},
{
"labels": {
"alertname": "DiskRunningFull",
"dev": "sdb2",
"instance": "example2"
},
"annotations": {
"info": "The disk sdb2 is running full",
"summary": "please check the instance example2"
}
},
{
"labels": {
"alertname": "DiskRunningFull",
"dev": "sda1",
"instance": "example3",
"severity": "critical"
}
},
{
"labels": {
"alertname": "DiskRunningFull",
"dev": "sda1",
"instance": "example3",
"severity": "warning"
}
}
]'
curl -XPOST -d"$alerts1" http://localhost:9093/api/v1/alerts
\ No newline at end of file
......@@ -17,5 +17,10 @@ scrape_configs:
static_configs:
- targets: ['localhost:9090', 'exporter:9100']
alerting:
alertmanagers:
- static_configs:
- targets: ["alertmanager:9093"]
rule_files:
- 'alert.rules.yml'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment