resolv.conf solved!

This commit is contained in:
hogweed1
2025-02-06 02:20:33 +10:00
parent fe33aee2fe
commit 4ba0cadf07
31 changed files with 1296 additions and 530 deletions

View 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

View 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'

View 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 }}