Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ansible
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nounous
Ansible
Commits
d0b97809
Verified
Commit
d0b97809
authored
5 years ago
by
me5na7qbjqbrp
Browse files
Options
Downloads
Patches
Plain Diff
[prometheus] Add rules for ups
parent
22f4fbd7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/prometheus/templates/prometheus/alert.rules.yml.j2
+89
-13
89 additions, 13 deletions
roles/prometheus/templates/prometheus/alert.rules.yml.j2
with
89 additions
and
13 deletions
roles/prometheus/templates/prometheus/alert.rules.yml.j2
+
89
−
13
View file @
d0b97809
...
@@ -13,8 +13,7 @@ groups:
...
@@ -13,8 +13,7 @@ groups:
labels:
labels:
severity: critical
severity: critical
annotations:
annotations:
summary: "Le serveur {{ $labels.instance }} est down"
summary: "{{ $labels.instance }} est invisible depuis plus de 3 minutes !"
description: "Le serveur {{ $labels.instance }} est down depuis plus de 3 minutes."
# Alert for out of memory
# Alert for out of memory
- alert: OutOfMemory
- alert: OutOfMemory
...
@@ -23,8 +22,7 @@ groups:
...
@@ -23,8 +22,7 @@ groups:
labels:
labels:
severity: warning
severity: warning
annotations:
annotations:
summary: "Presque plus de mémoire vive sur {{ $labels.instance }}"
summary: "Mémoire libre de {{ $labels.instance }} à {{ $value }}%."
description: "La mémoire est en train de se remplir ({{ $value }}% restant)"
# Alert for out of disk space
# Alert for out of disk space
- alert: OutOfDiskSpace
- alert: OutOfDiskSpace
...
@@ -33,8 +31,7 @@ groups:
...
@@ -33,8 +31,7 @@ groups:
labels:
labels:
severity: warning
severity: warning
annotations:
annotations:
summary: "Presque plus de stockage sur {{ $labels.mountpoint }} sur {{ $labels.instance }}"
summary: "Espace libre de {{ $labels.mountpoint }} sur {{ $labels.instance }} à {{ $value }}%."
description: "La partition est presque remplie ({{ $value }}% restant)"
# Alert for out of inode space on disk
# Alert for out of inode space on disk
- alert: OutOfInodes
- alert: OutOfInodes
...
@@ -43,18 +40,16 @@ groups:
...
@@ -43,18 +40,16 @@ groups:
labels:
labels:
severity: warning
severity: warning
annotations:
annotations:
summary: "Presque plus d'inodes disque sur {{ $labels.mountpoint }} sur {{ $labels.instance }}"
summary: "Presque plus d'inodes disponibles ({{ $value }}% restant) dans {{ $labels.mountpoint }} sur {{ $labels.instance }}."
description: "Le disque est presque à courre d'inodes disponibles ({{ $value }}% restant)"
# Alert for high CPU usage
# Alert for high CPU usage
- alert: Cpu
Load
- alert: Cpu
Usage
expr:
node_load15 / (count without (
cpu
,
mode
) (node_cpu_seconds_total{mode="system"} or node_cpu{mode="system"}
)) >
2
expr:
((100 - avg by (instance) (irate(node_
cpu
{
mode
="idle"}[5m])) * 100) or (100 - avg by (instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100
)) >
75
for: 5m
for: 5m
labels:
labels:
severity: warning
severity: warning
annotations:
annotations:
summary: "Charge CPU élevée sur {{ $labels.instance }}"
summary: "CPU sur {{ $labels.instance }} à {{ $value }}%."
description: "La charge CPU (moyenne de 15mn) est élevée."
# Check systemd unit (> buster)
# Check systemd unit (> buster)
- alert: SystemdServiceFailed
- alert: SystemdServiceFailed
...
@@ -64,7 +59,88 @@ groups:
...
@@ -64,7 +59,88 @@ groups:
severity: warning
severity: warning
annotations:
annotations:
summary: "{{ $labels.name }} a échoué sur {{ $labels.instance }}"
summary: "{{ $labels.name }} a échoué sur {{ $labels.instance }}"
description: "Le service {{ $labels.name }} a échoué."
# Check UPS
- alert: UpsOutputSourceChanged
expr: upsOutputSource != 3
for: 5m
labels:
severity: warning
annotations:
summary: "La source d'alimentation de {{ $labels.instance }} a changé !"
description: "https://grafana.crans.org/d/qtbg59mZz/alimentation"
- alert: UpsBatteryStatusChanged
expr: upsBatteryStatus != 2
for: 5m
labels:
severity: warning
annotations:
summary: "L'état de la batterie de {{ $labels.instance }} a changé !"
description: "https://grafana.crans.org/d/qtbg59mZz/alimentation"
- alert: UpsTemperatureWarning
expr: (xupsEnvRemoteTemp < 10) or (xupsEnvRemoteTemp > 20)
for: 5m
labels:
severity: warning
annotations:
summary: "La température autour de {{ $labels.instance }} est de {{ $value }}°C."
description: "https://grafana.crans.org/d/qtbg59mZz/alimentation"
- alert: UpsTemperatureCritical
expr: (xupsEnvRemoteTemp < 0) or (xupsEnvRemoteTemp > 30)
for: 5m
labels:
severity: critical
annotations:
summary: "La température autour de {{ $labels.instance }} est de {{ $value }}°C !"
description: "https://grafana.crans.org/d/qtbg59mZz/alimentation"
- alert: UpsHighHumidity
expr: xupsEnvRemoteHumidity > 65
for: 5m
labels:
severity: warning
annotations:
summary: "L'humidité autour de {{ $labels.instance }} est de {{ $value }}%."
description: "https://grafana.crans.org/d/qtbg59mZz/alimentation"
- alert: UpsVeryHighHumidity
expr: xupsEnvRemoteHumidity > 85
for: 5m
labels:
severity: critical
annotations:
summary: "L'humidité autour de {{ $labels.instance }} est de {{ $value }}% !"
description: "https://grafana.crans.org/d/qtbg59mZz/alimentation"
- alert: UpsHighLoad
expr: upsOutputPercentLoad > 70
for: 5m
labels:
severity: critical
annotations:
summary: "La charge de {{ $labels.instance }} est de {{ $value }}% !"
description: "https://grafana.crans.org/d/qtbg59mZz/alimentation"
- alert: UpsWrongInputVoltage
expr: (upsInputVoltage < 220) or (upsInputVoltage > 240)
for: 5m
labels:
severity: warning
annotations:
summary: "La tension d'entrée de {{ $labels.instance }} est de {{ $value }}V."
description: "https://grafana.crans.org/d/qtbg59mZz/alimentation"
- alert: UpsWrongOututVoltage
expr: (upsOutputVoltage < 225) or (upsOutputVoltage > 235)
for: 5m
labels:
severity: warning
annotations:
summary: "La tension de sortie de {{ $labels.instance }} est de {{ $value }}V."
description: "https://grafana.crans.org/d/qtbg59mZz/alimentation"
# NTP (need NTP plugin in node)
# NTP (need NTP plugin in node)
# - alert: ntp_drifting
# - alert: ntp_drifting
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment