Browse Source

Adding disable support for alert service

Philippe Caseiro 11 months ago
parent
commit
5c16310e5d
1 changed files with 18 additions and 5 deletions
  1. 18
    5
      dicos/70_prometheus.xml

+ 18
- 5
dicos/70_prometheus.xml View File

@@ -1,9 +1,9 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <creole>
3 3
     <files>
4
-        <file filelist='prometheus' name='/etc/prometheus/prometheus.yml'   mkdir='True' rm='True'/>
5
-        <file filelist='prometheus' name='/etc/prometheus/alertmanager.yml' mkdir='True' rm='True'/>
6
-        <file filelist='grafana'    name='/etc/grafana/grafana.ini'         mkdir='True' rm='True'/>
4
+        <file filelist='prometheus'   name='/etc/prometheus/prometheus.yml'   mkdir='True' rm='True'/>
5
+		<file filelist='alertmanager' name='/etc/prometheus/alertmanager.yml' mkdir='True' rm='True'/>
6
+        <file filelist='grafana'      name='/etc/grafana/grafana.ini'         mkdir='True' rm='True'/>
7 7
 
8 8
         <service>prometheus</service>
9 9
         <service>alertmanager</service>
@@ -25,9 +25,12 @@
25 25
     </family>
26 26
         <family name='prometheus'>
27 27
         <variable name='activer_grafana' type='oui/non' description="Activer le service grafana sur le serveur">
28
-        <value>oui</value>
28
+			<value>oui</value>
29
+        </variable>
30
+        <variable name='activerAlertmanager' type='oui/non' description="Activer le service d'alertes">
31
+			<value>oui</value>
29 32
         </variable>
30
-            <variable name='prometheusJobName' type='string' description="Nom du job ajouté au label">
33
+		<variable name='prometheusJobName' type='string' description="Nom du job ajouté au label">
31 34
                 <value>prometheus</value>
32 35
         </variable>
33 36
             <variable name='prometheusScrapeInterval' type='string' description="Intervalle de récupération des données sur les différents noeuds">
@@ -115,6 +118,8 @@
115 118
     </family>
116 119
 
117 120
     <separators>
121
+		<separator name='activer_grafana'>Services complèmentairse</separator>
122
+		<separator name='prometheusJobName'>Configuration du serveur Prometheus</separator>
118 123
         <separator name='alSMTPHost'>Configuration SMTP pour l'envois des alertes</separator>
119 124
         <separator name='alDefaultReceiver'>Destinatires</separator>
120 125
         <separator name='alRoute'>Rêgles de distribution</separator>
@@ -164,6 +169,7 @@
164 169
         <condition name='disabled_if_in' source='activer_prometheus'>
165 170
             <param>non</param>
166 171
             <target type='family'>prometheus</target>
172
+            <target type='family'>alertes prometheus</target>
167 173
             <target type='filelist'>prometheus</target>
168 174
             <target type='variable'>activer_grafana</target>
169 175
         </condition>
@@ -172,6 +178,13 @@
172 178
             <target type='family'>grafana</target>
173 179
             <target type='filelist'>grafana</target>
174 180
         </condition>
181
+
182
+        <condition name='disabled_if_in' source='activerAlertmanager'>
183
+            <param>non</param>
184
+            <target type='family'>alertes prometheus</target>
185
+            <target type='filelist'>alertmanager</target>
186
+        </condition>
187
+
175 188
         <condition name='disabled_if_in' source='ajout_client_prometheus'>
176 189
             <param>non</param>
177 190
             <target type='variable'>prCli</target>