Ver código fonte

Add alerting prediction rules

2.6.2/master
William Petit 1 ano atrás
pai
commit
dc43a0f26c
2 arquivos alterados com 10 adições e 3 exclusões
  1. 4
    3
      dicos/70_prometheus.xml
  2. 6
    0
      tmpl/predict-rules.yml

+ 4
- 3
dicos/70_prometheus.xml Ver arquivo

@@ -1,10 +1,11 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <creole>
3 3
     <files>
4
-		<file filelist='prometheus'   name='/etc/default/prometheus' source='prometheus.defaults'  mkdir='True' rm='True'/>
4
+      <file filelist='prometheus'   name='/etc/default/prometheus' source='prometheus.defaults'  mkdir='True' rm='True'/>
5 5
         <file filelist='prometheus'   name='/etc/prometheus/prometheus.yml'          mkdir='True' rm='True'/>
6 6
         <file filelist='alertmanager' name='/etc/prometheus/alertmanager.yml'        mkdir='True' rm='True'/>
7
-		<file filelist='alertmanager' name='/etc/prometheus/rules.d/alert-rules.yml' mkdir='True' rm='True'/>
7
+        <file filelist='alertmanager' name='/etc/prometheus/rules.d/alert-rules.yml' mkdir='True' rm='True'/>
8
+        <file filelist='alertmanager' name='/etc/prometheus/rules.d/predict-rules.yml' mkdir='True' rm='True'/>
8 9
         <file filelist='grafana'      name='/etc/grafana/grafana.ini'                mkdir='True' rm='True'/>
9 10
 
10 11
         <service>prometheus</service>
@@ -147,7 +148,7 @@
147 148
     <separators>
148 149
         <separator name='activer_grafana'>Services complèmentairse</separator>
149 150
         <separator name='prometheusJobName'>Configuration du serveur Prometheus</separator>
150
-		<separator name='job_name_node'>Configuration des jobs standards</separator>
151
+        <separator name='job_name_node'>Configuration des jobs standards</separator>
151 152
         <separator name='alSMTPHost'>Configuration SMTP pour l'envois des alertes</separator>
152 153
         <separator name='alReceiver'>Destinatires</separator>
153 154
         <separator name='alRoute'>Rêgles de distribution simples</separator>

+ 6
- 0
tmpl/predict-rules.yml Ver arquivo

@@ -0,0 +1,6 @@
1
+groups:
2
+  - name: PredictRules
3
+    rules:
4
+      - alert: disk_full_within_6_hours
5
+        expr: predict_linear(node_filesystem_free{job="%%{job_name_node}",mountpoint="/"}[1h], 6 * 3600) < 0
6
+        for: 5m

Carregando…
Cancelar
Salvar