This commit is contained in:
Philippe Caseiro 2018-06-04 10:28:55 +02:00
parent a3e5e643e0
commit 638295626b
2 changed files with 21 additions and 8 deletions

View File

@ -36,10 +36,6 @@
<variable name='prometheusScrapeTimeout' type='string' description="Temps d'attente avant que la récupération de données échoue">
<value>10s</value>
</variable>
<variable name='ajout_client_prometheus' type='oui/non' description="Ajouter un nouveau client à Prometheus">
<value>non</value>
</variable>
<variable name='nouveau_node_exporter' type='string' description="url/IP du nouveau node exporter" multi="True" mandatory='True'/>
<variable name='job_name_node' type='string' description="Nom du job pour les noeuds" mode='expert'>
<value>node</value>
</variable>
@ -47,6 +43,14 @@
<value>/etc/prometheus/nodes</value>
</variable>
</family>
<family name='Clients prometheus'>
<variable name='ajout_client_prometheus' type='oui/non' description="Ajouter un nouveau client à Prometheus">
<value>non</value>
</variable>
<variable name='prCli' type='string' description='Nom du client prometheus' multi='True'/>
<variable name='prCliIP' type='ip' description="Adresse IP du client prometheus"/>
<variable name='prCliSonde' type='string' description="Sonde a utiliser pour ce client"/>
</family>
<family name="grafana">
<variable name='grafana_domain' type='string' description="Nom de Domaine ou IP pour accèder à l'interface Grafana" mandatory='True'>
<value>localhost</value>
@ -66,6 +70,15 @@
</family>
</variables>
<constraints>
<group master='prCli'>
<slave>prCliIP</slave>
<slave>prCliSonde</slave>
</group>
<check name='valid_enum' target='prCliSonde'>
<param>['Node Exporter']</param>
</check>
<condition name='disabled_if_in' source='activer_prometheus'>
<param>non</param>
<target type='family'>prometheus</target>

View File

@ -22,11 +22,11 @@ scrape_configs:
- files: [ "%%job_file_config/*.yml" ]
static_configs:
%if %%getVar('ajout_client_prometheus','non') == 'oui'
%if not %%is_empty(%%nouveau_node_exporter)
%for %%client_prometheus in %%nouveau_node_exporter
%for %%cliPr in %%getVar('prCli',[])
%if %%cliPr.CliSonde == 'Node Exporter'
- targets: ['%%client_prometheus:9100']
%end for
%end if
%end for
%end if
#alerting: