Improving alert support

This commit is contained in:
Philippe Caseiro 2018-06-05 17:05:51 +02:00
parent b95d0894d9
commit 5ab3f20789
2 changed files with 11 additions and 3 deletions

View File

@ -122,7 +122,8 @@
<separator name='prometheusJobName'>Configuration du serveur Prometheus</separator> <separator name='prometheusJobName'>Configuration du serveur Prometheus</separator>
<separator name='alSMTPHost'>Configuration SMTP pour l'envois des alertes</separator> <separator name='alSMTPHost'>Configuration SMTP pour l'envois des alertes</separator>
<separator name='alDefaultReceiver'>Destinatires</separator> <separator name='alDefaultReceiver'>Destinatires</separator>
<separator name='alRoute'>Rêgles de distribution</separator> <separator name='alRoute'>Rêgles de distribution simples</separator>
<separator name='alRouteRegxp'>Rêgles de distribution regexp</separator>
<separator name='alSubRoute'>Sous-rêgles de distribution</separator> <separator name='alSubRoute'>Sous-rêgles de distribution</separator>
</separators> </separators>
@ -165,6 +166,12 @@
<param>['Node Exporter','Port']</param> <param>['Node Exporter','Port']</param>
</check> </check>
<condition name='disabled_if_in' source='alSMTPAuth'>
<param>non</param>
<target type='variable'>alSMTPUser</target>
<target type='variable'>alSMTPPass</target>
</condition>
<condition name='disabled_if_in' source='activer_prometheus'> <condition name='disabled_if_in' source='activer_prometheus'>
<param>non</param> <param>non</param>
<target type='family'>prometheus</target> <target type='family'>prometheus</target>
@ -172,6 +179,7 @@
<target type='filelist'>prometheus</target> <target type='filelist'>prometheus</target>
<target type='variable'>activer_grafana</target> <target type='variable'>activer_grafana</target>
</condition> </condition>
<condition name='disabled_if_in' source='activer_grafana'> <condition name='disabled_if_in' source='activer_grafana'>
<param>non</param> <param>non</param>
<target type='family'>grafana</target> <target type='family'>grafana</target>

View File

@ -51,7 +51,7 @@ route:
- match_re: - match_re:
%%{route.alRouteMatchRegExpSource}: %%{route.alRouteMatchRegExp} %%{route.alRouteMatchRegExpSource}: %%{route.alRouteMatchRegExp}
receiver: %%route.alRouteMatchRegxpRecv receiver: %%route.alRouteMatchRegxpRecv
%if not is_empty('alSubRoute') %if not %%is_empty('alSubRoute')
routes: routes:
%for sroute in %%getVar('alSubRoute',[]) %for sroute in %%getVar('alSubRoute',[])
# The service has a sub-route for critical alerts, any alerts # The service has a sub-route for critical alerts, any alerts
@ -70,7 +70,7 @@ route:
%%{rt.alRouteMatchSource}: %%{rt.alRouteMatchValue} %%{rt.alRouteMatchSource}: %%{rt.alRouteMatchValue}
receiver: %%rt.alRouteMatchReceiver receiver: %%rt.alRouteMatchReceiver
%if not is_empty('alSubRoute') %if not %%is_empty('alSubRoute')
routes: routes:
%for sroute in %%getVar('alSubRoute',[]) %for sroute in %%getVar('alSubRoute',[])
%if %%sroute == %%rt %if %%sroute == %%rt