13 Commits

Author SHA1 Message Date
vincent 5d646293cb Merge pull request 'roles: dns-internal: nsd: Update IP addresses for zola.vinishor.xyz' (#5) from dns-secondaire-vinishor into main
Reviewed-on: #5
2026-06-18 12:45:31 +02:00
mirsal 0cedc82d83 roles: dns-internal: nsd: Update IP addresses for zola.vinishor.xyz
the zola.vinishor.xyz secondary has seemingly changed IP addresses
2026-06-18 09:54:59 +00:00
mirsal e3e4179f92 Temporarily remove lolix-ixpman.labolyon.dn42 2026-06-14 16:34:04 +00:00
mirsal d699fd578c roles: prometheus: templates: scrape-main: remove useless systemd labels
Remove unused high-cardinality node_systemd_unit_state labels
2026-06-14 16:17:05 +00:00
mirsal 151972611f ansible: roles: prometheus: Add send e-mail alerts to vinishor 2026-06-14 13:48:56 +00:00
mirsal e1ca88e56d roles: prometheus: alertmanager: Notify mirsal@labolyon.fr
* Send alert notification to mirsal@labolyon.fr
 * Send resolved notifications
2026-06-13 19:27:34 +00:00
vincent f8319b7fe1 Merge pull request 'Add grafana configuration and set up e-mail' (#4) from grafana-config into main
Reviewed-on: #4
2026-06-13 19:15:13 +02:00
vincent 99f7e6e8e0 Merge pull request 'Configure e-mails alerts sent by prometheus-alertmanager' (#3) from prometheus-email into main
Reviewed-on: #3
2026-06-13 19:14:48 +02:00
vincent 6e5c222116 Merge pull request 'Rework blackbox monitoring' (#2) from rework-blackbox-monitoring into main
Reviewed-on: #2
2026-06-13 19:07:13 +02:00
mirsal 71b8ae618d roles: grafana: Add grafana configuration 2026-06-13 16:05:14 +00:00
mirsal eabaff50f7 roles: grafana: tasks: main.yml Switch from CRLF to LF 2026-06-13 16:00:46 +00:00
mirsal be3b09ef66 roles: prometheus: Add alertmanager configuration 2026-06-13 15:17:10 +00:00
mirsal 600912cc95 roles: prometheus: tasks: main.yml: Switch from CRLF to LF 2026-06-13 15:11:18 +00:00
8 changed files with 2099 additions and 82 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ all:
git.labolyon.dn42:
i2p.labolyon.dn42:
labolyon-fr.labolyon.dn42:
lolix-ixpman.labolyon.dn42:
# lolix-ixpman.labolyon.dn42:
lolix-rs1.labolyon.dn42:
lolmox.labolyon.dn42:
lolmox2.labolyon.dn42:
@@ -31,10 +31,10 @@ zone:
name: "labolyon.fr"
zonefile: "labolyon.fr.zone"
## zola.vinishor.xyz
notify: 2a0e:e701:11e7:cafe:3737::1 clesecrete
provide-xfr: 2a0e:e701:11e7:cafe:3737::1 clesecrete
notify: 45.13.105.181 clesecrete
provide-xfr: 45.13.105.181 clesecrete
notify: 2001:41d0:fc32:d710:3737::1 clesecrete
provide-xfr: 2001:41d0:fc32:d710:3737::1 clesecrete
notify: 109.190.187.14 clesecrete
provide-xfr: 109.190.187.14 clesecrete
## ns1.1312.zone
notify: 2a03:b0c0:2:d0::12f0:4001 dns_labolyon_fr_to_ns1_1312_zone
provide-xfr: 2a03:b0c0:2:d0::12f0:4001 dns_labolyon_fr_to_ns1_1312_zone
+5
View File
@@ -0,0 +1,5 @@
## Restart grafana on changes
- name: restart grafana
ansible.builtin.service:
name: 'grafana-server'
state: restarted
+21 -14
View File
@@ -1,14 +1,21 @@
---
- name: Install Grafana
tags: grafana-install
ansible.builtin.package:
name: 'grafana'
state: latest
- name: Enable Grafana service
tags: grafana-enable
ansible.builtin.service:
name: 'grafana-server'
state: started
enabled: yes
---
- name: Install Grafana
tags: grafana-install
ansible.builtin.package:
name: 'grafana'
state: latest
- name: Add grafana configuration
tags: grafana-configure
ansible.builtin.template:
src: grafana.ini.j2
dest: '/etc/grafana/grafana.ini'
notify: restart grafana
- name: Enable Grafana service
tags: grafana-enable
ansible.builtin.service:
name: 'grafana-server'
state: started
enabled: yes
File diff suppressed because it is too large Load Diff
+70 -62
View File
@@ -1,62 +1,70 @@
---
- name: Load variables
include_vars: "{{ ansible_os_family|lower }}.yml"
- name: Install Prometheus
tags: prometheus-install
ansible.builtin.package:
name: '{{ prometheus_package }}'
state: latest
- name: Add scrape configuration
tags: prometheus-scrape-configure
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "/etc/prometheus/{{ item.dest }}"
loop:
- { src: '../templates/scrape-main.yml', dest: 'scrape-main.yml' }
- { src: '../templates/scrape-blackbox.yml', dest: 'scrape-blackbox.yml' }
notify:
- restart prometheus
- name: Create folder for rules definition
ansible.builtin.file:
path: /etc/prometheus/rules
state: directory
mode: 0755
- name: Add rules configuration
tags: alertmanager-rules-configure
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ alertmanager_rules }}/{{ item.dest }}"
loop:
- { src: '../templates/hosts.rules', dest: 'hosts.rules.yml' }
- { src: '../templates/prometheus.rules', dest: 'prometheus.rules.yml' }
- { src: '../templates/blackbox.rules', dest: 'blackbox.rules.yml' }
notify:
- restart prometheus
- restart alertmanager
- name: Enable Prometheus configuration
tags: prometheus-configure
ansible.builtin.template:
src: prometheus.config.j2
dest: '{{ prometheus_config }}'
validate: promtool check config %s
notify: restart prometheus
- name: Enable Prometheus service
tags: prometheus-enable
ansible.builtin.service:
name: '{{ prometheus_service }}'
state: started
enabled: yes
- name: Enable Alertmanager service
tags: alertmanager-enable
ansible.builtin.service:
name: '{{ alertmanager_service }}'
state: started
enabled: yes
---
- name: Load variables
include_vars: "{{ ansible_os_family|lower }}.yml"
- name: Install Prometheus
tags: prometheus-install
ansible.builtin.package:
name: '{{ prometheus_package }}'
state: latest
- name: Add scrape configuration
tags: prometheus-scrape-configure
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "/etc/prometheus/{{ item.dest }}"
loop:
- { src: '../templates/scrape-main.yml', dest: 'scrape-main.yml' }
- { src: '../templates/scrape-blackbox.yml', dest: 'scrape-blackbox.yml' }
notify:
- restart prometheus
- name: Add alertmanager configuration
tags: alertmanager-configure
ansible.builtin.template:
src: alertmanager.yml.j2
dest: '{{ alertmanager_config }}'
notify:
- restart alertmanager
- name: Create folder for rules definition
ansible.builtin.file:
path: /etc/prometheus/rules
state: directory
mode: 0755
- name: Add rules configuration
tags: alertmanager-rules-configure
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ alertmanager_rules }}/{{ item.dest }}"
loop:
- { src: '../templates/hosts.rules', dest: 'hosts.rules.yml' }
- { src: '../templates/prometheus.rules', dest: 'prometheus.rules.yml' }
- { src: '../templates/blackbox.rules', dest: 'blackbox.rules.yml' }
notify:
- restart prometheus
- restart alertmanager
- name: Enable Prometheus configuration
tags: prometheus-configure
ansible.builtin.template:
src: prometheus.config.j2
dest: '{{ prometheus_config }}'
validate: promtool check config %s
notify: restart prometheus
- name: Enable Prometheus service
tags: prometheus-enable
ansible.builtin.service:
name: '{{ prometheus_service }}'
state: started
enabled: yes
- name: Enable Alertmanager service
tags: alertmanager-enable
ansible.builtin.service:
name: '{{ alertmanager_service }}'
state: started
enabled: yes
@@ -0,0 +1,67 @@
{{ ansible_managed | comment }}
# See https://prometheus.io/docs/alerting/configuration/ for documentation.
global:
# The smarthost and SMTP sender used for mail notifications.
smtp_smarthost: 'mail.labolyon.fr:587'
smtp_from: 'alerts@labolyon.fr'
smtp_auth_username: 'alerts@labolyon.fr'
smtp_auth_password: {{ lookup('community.general.passwordstore', 'monitoring/e-mail/alerts@labolyon.fr')}}
# The directory from which notification templates are read.
templates:
- '/etc/prometheus/alertmanager_templates/*.tmpl'
# The root route on which each incoming alert enters.
route:
# The labels by which incoming alerts are grouped together. For example,
# multiple alerts coming in for cluster=A and alertname=LatencyHigh would
# be batched into a single group.
#
# To aggregate by all possible labels use '...' as the sole label name.
# This effectively disables aggregation entirely, passing through all
# alerts as-is. This is unlikely to be what you want, unless you have
# a very low alert volume or your upstream notification system performs
# its own grouping. Example: group_by: [...]
group_by: ['alertname', 'cluster', 'service']
# When a new group of alerts is created by an incoming alert, wait at
# least 'group_wait' to send the initial notification.
# This way ensures that you get multiple alerts for the same group that start
# firing shortly after another are batched together on the first
# notification.
group_wait: 30s
# When the first notification was sent, wait 'group_interval' to send a batch
# of new alerts that started firing for that group.
group_interval: 5m
# If an alert has successfully been sent, wait 'repeat_interval' to
# resend them.
repeat_interval: 3h
# A default receiver
receiver: all-admins-email
# All the above attributes are inherited by all child routes and can
# overwritten on each.
# Inhibition rules allow to mute a set of alerts given that another alert is
# firing.
# We use this to mute any warning-level notifications if the same alert is
# already critical.
inhibit_rules:
- source_matchers: [severity="critical"]
target_matchers: [severity="warning"]
# Apply inhibition if the alertname is the same.
# CAUTION:
# If all label names listed in `equal` are missing
# from both the source and target alerts,
# the inhibition rule will apply!
equal: [alertname, cluster, service]
receivers:
- name: 'all-admins-email'
email_configs:
- to: 'mirsal@mirsal.fr,mirsal@labolyon.fr,vinishor@vinishor.xyz'
send_resolved: true
@@ -8,7 +8,7 @@ scrape_configs:
- git.labolyon.dn42:9100
- i2p.labolyon.dn42:9100
- labolyon-fr.labolyon.dn42:9100
- lolix-ixpman.labolyon.dn42:9100
# - lolix-ixpman.labolyon.dn42:9100
- lolix-rs1.labolyon.dn42:9100
- lolmox.labolyon.dn42:9100
- lolmox2.labolyon.dn42:9100
@@ -20,3 +20,8 @@ scrape_configs:
- reverse-proxy.labolyon.dn42:9100
- wiki.labolyon.dn42:9100
- zigbee2mqtt.labolyon.dn42:9100
metric_relabel_configs:
- source_labels: [__name__, state]
separator: '_'
regex: node_systemd_unit_state_[^f].*
action: drop