resolv.conf solved!
This commit is contained in:
21
files/alertmanager/alertmanager.service
Normal file
21
files/alertmanager/alertmanager.service
Normal file
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Prometheus alertmanager
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
User=prometheus
|
||||
Group=prometheus
|
||||
EnvironmentFile=-/etc/sysconfig/alertmanager
|
||||
ExecStart=/usr/sbin/alertmanager \
|
||||
--config.file=/etc/alertmanager/alertmanager.yaml \
|
||||
--storage.path=/base/alertmanager \
|
||||
--web.config.file=/etc/prometheus/web-config.yaml
|
||||
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
KillMode=process
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
50
files/alertmanager/alertmanager.yaml
Normal file
50
files/alertmanager/alertmanager.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
global:
|
||||
resolve_timeout: 5m
|
||||
|
||||
route:
|
||||
group_by: [ 'alertname', 'job' ]
|
||||
group_wait: 30s
|
||||
group_interval: 5m
|
||||
repeat_interval: 1h
|
||||
receiver: what-went-wrong
|
||||
|
||||
# routes:
|
||||
|
||||
receivers:
|
||||
# /dev/null receiver
|
||||
- name: 'blackhole'
|
||||
|
||||
# конфа
|
||||
- name: 'what-went-wrong'
|
||||
telegram_configs:
|
||||
- send_resolved: true
|
||||
bot_token: '6472915685:AAHPvgrQoqG7DxtfbnHWPe3Lfild-CGJ1j8'
|
||||
chat_id: -4023350326
|
||||
message: '{{ template "teletempl" . }}'
|
||||
api_url: https://api.telegram.org
|
||||
parse_mode: HTML
|
||||
# - name: 'vdk2ch'
|
||||
# telegram_configs:
|
||||
# - send_resolved: true
|
||||
# bot_token: '5724991559:AAEuLvpLsgP6LHRGMSyFtQLlR5qPQUO4b_w'
|
||||
# chat_id: -1001355646177
|
||||
# message: '{{ template "teletempl" . }}'
|
||||
# api_url: https://api.telegram.org
|
||||
# parse_mode: HTML
|
||||
|
||||
# A list of inhibition rules.
|
||||
#inhibit_rules:
|
||||
|
||||
templates:
|
||||
- '/etc/alertmanager/templates/my.tmpl'
|
||||
|
||||
# A list of time intervals for muting/activating routes.
|
||||
# time_intervals:
|
||||
# - name: business_hours
|
||||
# time_intervals:
|
||||
# - weekdays: ['monday:friday']
|
||||
# times:
|
||||
# # Начало в 10:00 Asia/Vladivostok
|
||||
# - start_time: '00:00'
|
||||
# # Заканчивается в 19:00 Asia/Vladivostok
|
||||
# end_time: '09:00'
|
33
files/alertmanager/simple_telegram.tmpl
Normal file
33
files/alertmanager/simple_telegram.tmpl
Normal file
@@ -0,0 +1,33 @@
|
||||
{{ define "teletempl" }}
|
||||
<b>{{ .CommonLabels.alertname }} : </b>
|
||||
{{- if eq .Status "firing" -}}
|
||||
<b>{{ .Status | toUpper}} 🔥</b>
|
||||
{{- end -}}
|
||||
{{- if eq .Status "resolved" -}}
|
||||
<b>{{ .Status | toUpper}} ✅</b>
|
||||
{{- end -}}
|
||||
{{ $alerts_count := len .Alerts }}
|
||||
{{ if eq $alerts_count 1 -}} {{/* Single alert block */}}
|
||||
{{ .CommonAnnotations.summary }}
|
||||
|
||||
Host: {{ .CommonLabels.host }}
|
||||
Instance: {{ .CommonLabels.instance }}
|
||||
Job: <b>{{ .CommonLabels.job }}</b>
|
||||
|
||||
Details:
|
||||
{{ .CommonAnnotations.description }}
|
||||
|
||||
Alert started: [ {{ .CommonAnnotations.alert_started_vl_time }} ]
|
||||
|
||||
{{- else -}} {{/* Grouped alert block */}}
|
||||
{{ .CommonAnnotations.summary }}
|
||||
|
||||
Job: <b>{{ .CommonLabels.job }}</b>
|
||||
|
||||
|
||||
Instances:
|
||||
{{- range .Alerts }}
|
||||
{{ .Labels.instance }} [ {{ .Annotations.alert_started_vl_time }} ]
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
Reference in New Issue
Block a user