Compare commits
No commits in common. "master" and "pkg/dev/2.6.2-0.0.1-0/0.0.1-0" have entirely different histories.
master
...
pkg/dev/2.
4
Makefile
4
Makefile
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
SOURCE=eole-prometheus
|
SOURCE=eole-prometheus
|
||||||
VERSION=0.1
|
VERSION=0.1
|
||||||
EOLE_VERSION=2.7
|
EOLE_VERSION=2.6
|
||||||
EOLE_RELEASE=2.7.0
|
EOLE_RELEASE=2.6.2
|
||||||
PKGAPPS=non
|
PKGAPPS=non
|
||||||
|
|
||||||
################################
|
################################
|
||||||
|
|
47
README.md
47
README.md
|
@ -1,33 +1,41 @@
|
||||||
# eole-prometheus
|
## eole-prometheus
|
||||||
|
|
||||||
Eolisation de la solution de surveillance Prometheus.
|
Eolisation de la solution de surveillance Prometheus.
|
||||||
|
|
||||||
Grafana est pris en charge dans l'eolisation et peut ou non être activé.
|
Grafana est pris en charge dans l'eolisation et peut ou non être activé.
|
||||||
|
L'exporter système (node-exporter) est dans la configuration par défaut (Prométheus se surveille lui même).
|
||||||
|
|
||||||
L'exporter système (node-exporter) est dans la configuration par défaut (Prometheus se surveille lui même).
|
### eole-prometheus :
|
||||||
|
|
||||||
### Installation
|
|
||||||
|
|
||||||
#### Installer `eole-prometheus`
|
1. gen_config
|
||||||
|
|
||||||
1. Ajouter le dépôt officiel de [Grafana](http://docs.grafana.org/installation/debian/#apt-repository). Dans l'interface `GenConfig`
|
|
||||||
```
|
```
|
||||||
Mode expert > Dépot tiers > Ajouter un dépot
|
Mode expert > Dépot tiers > Ajouter un dépot
|
||||||
Dépôt officiel Grafana
|
Cadoles pour environnement de Qualification
|
||||||
Libellé du dépot = Dépôt officiel Grafana
|
|
||||||
Déclaration du dépôt = deb https://packages.grafana.com/oss/deb stable main
|
|
||||||
Méthode de récupération de la clé = URL de la clé
|
|
||||||
URL de la clé = https://packages.grafana.com/gpg.key
|
|
||||||
```
|
|
||||||
2. Ajouter le dépôt Cadoles. Dans l'interface `GenConfig`
|
|
||||||
```
|
|
||||||
Mode expert > Dépot tiers > Ajouter un dépot
|
|
||||||
Cadoles pour environnement de Dev
|
|
||||||
Libellé du dépot = Cadoles
|
Libellé du dépot = Cadoles
|
||||||
Déclaration du dépôt = deb https://vulcain.cadoles.com 2.7.0-dev main
|
Déclaration du dépôt = deb https://vulcain.cadoles.com 2.6.2-staging main
|
||||||
Méthode de récupération de la clé = URL de la clé
|
Méthode de récupération de la clé = URL de la clé
|
||||||
URL de la clé = https://vulcain.cadoles.com/cadoles.gpg
|
URL de la clé = https://vulcain.cadoles.com/cadoles.gpg
|
||||||
|
```
|
||||||
|
|
||||||
|
* Pour ajouter une sonde sur eole :
|
||||||
|
|
||||||
|
1. gen_config
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Mode expert > Dépot tiers > Ajouter un dépot
|
||||||
|
Cadoles pour environnement de Qualification
|
||||||
|
Libellé du dépot = Cadoles
|
||||||
|
Déclaration du dépôt = deb https://vulcain.cadoles.com xenial-staging main
|
||||||
|
Méthode de récupération de la clé = URL de la clé
|
||||||
|
URL de la clé = https://vulcain.cadoles.com/cadoles.gpg
|
||||||
|
```
|
||||||
|
|
||||||
|
* Pour ajouter une sonde sur ubuntu xenial:
|
||||||
|
|
||||||
|
```
|
||||||
|
echo "deb https://vulcain.cadoles.com xenial-staging main" > /etc/apt/sources.list.d/cadoles.list
|
||||||
|
wget -O - https://vulcain.cadoles.com/cadoles.gpg|apt-key add -
|
||||||
|
```
|
||||||
|
|
||||||
Il faut ouvrir les ports en fonction des exporters. Tous les exporters n'utilisent pas le même port.
|
Il faut ouvrir les ports en fonction des exporters. Tous les exporters n'utilisent pas le même port.
|
||||||
|
|
||||||
|
@ -36,3 +44,4 @@ Le paquet eole-prometheus ouvre les ports sur le serveur où Prometheus sera ins
|
||||||
* 9090 pour le serveur prometheus
|
* 9090 pour le serveur prometheus
|
||||||
* 9100 pour la sonde node-exporter
|
* 9100 pour la sonde node-exporter
|
||||||
* 3000 pour le serveur Grafana
|
* 3000 pour le serveur Grafana
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [[ $(CreoleGet activer_grafana) == "oui" ]]
|
if [ $(CreoleGet activer_grafana) = "oui" ];then
|
||||||
then
|
|
||||||
. /usr/lib/eole/diagnose.sh
|
. /usr/lib/eole/diagnose.sh
|
||||||
|
|
||||||
EchoGras "*** Accès au serveur grafana"
|
EchoGras "*** Accès au serveur grafana"
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [[ $(CreoleGet activer_prometheus) == "oui" ]]
|
if [ $(CreoleGet activer_prometheus) = "oui" ];then
|
||||||
then
|
|
||||||
. /usr/lib/eole/diagnose.sh
|
. /usr/lib/eole/diagnose.sh
|
||||||
|
|
||||||
EchoGras "*** Accès au serveur Prometheus"
|
EchoGras "*** Accès au serveur Prometheus"
|
||||||
|
|
|
@ -1,22 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<creole>
|
<creole>
|
||||||
<files>
|
<files>
|
||||||
<file filelist='prometheus' name='/etc/default/prometheus' source='prometheus.defaults' mkdir='True' rm='True'/>
|
<file filelist='prometheus' name='/etc/prometheus/prometheus.yml' source='prometheus.yml' mkdir='True' rm='True'/>
|
||||||
<file filelist='prometheus' name='/etc/prometheus/prometheus.yml' mkdir='True' rm='True'/>
|
<file filelist='grafana' name='/etc/grafana/grafana.ini' source='grafana.ini' mkdir='True' rm='True'/>
|
||||||
<file filelist='prometheus-alertmanager' name='/etc/prometheus/alertmanager.yml' mkdir='True' rm='True'/>
|
|
||||||
<file filelist='prometheus-alertmanager' name='/etc/prometheus/rules.d/alert-rules.yml' mkdir='True' rm='True'/>
|
|
||||||
<file filelist='prometheus-alertmanager' name='/etc/prometheus/rules.d/predict-rules.yml' mkdir='True' rm='True'/>
|
|
||||||
<file filelist='grafana' name='/etc/grafana/grafana.ini' mkdir='True' rm='True'/>
|
|
||||||
<file filelist='grafana' name='/etc/grafana/provisioning/dashboards/eole.yml' source='grafana-dashboards.yml' mkdir='True' rm='True'/>
|
|
||||||
<file filelist='grafana' name='/etc/grafana/provisioning/datasources/eole.yml' source='grafana-datasources.yml' mkdir='True' rm='True'/>
|
|
||||||
<file filelist='grafana' name='/var/lib/grafana/dashboards/eole.json' source='grafana-node-dashboard.json' mkdir='True' rm='True'/>
|
|
||||||
|
|
||||||
<service>prometheus</service>
|
<service>prometheus</service>
|
||||||
<service>prometheus-alertmanager</service>
|
|
||||||
<service>grafana-server</service>
|
<service>grafana-server</service>
|
||||||
<service_access service='prometheus'>
|
<service_access service='prometheus'>
|
||||||
|
<port service_accesslist="saLemon">80</port>
|
||||||
|
<port service_accesslist="saLemon">443</port>
|
||||||
<port service_accesslist="prometheus">9090</port>
|
<port service_accesslist="prometheus">9090</port>
|
||||||
<port service_accesslist="prometheus-alertmanager">9093</port>
|
|
||||||
</service_access>
|
</service_access>
|
||||||
<service_access service='grafana-server'>
|
<service_access service='grafana-server'>
|
||||||
<port service_accesslist="grafana">3000</port>
|
<port service_accesslist="grafana">3000</port>
|
||||||
|
@ -32,12 +24,6 @@
|
||||||
<variable name='activer_grafana' type='oui/non' description="Activer le service grafana sur le serveur">
|
<variable name='activer_grafana' type='oui/non' description="Activer le service grafana sur le serveur">
|
||||||
<value>oui</value>
|
<value>oui</value>
|
||||||
</variable>
|
</variable>
|
||||||
<variable name='activerAlertmanager' type='oui/non' description="Activer le service d'alertes">
|
|
||||||
<value>oui</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='promStorageRetention' type='number' description='Durée de rétention des métriques (en heures)'>
|
|
||||||
<value>24</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='prometheusJobName' type='string' description="Nom du job ajouté au label">
|
<variable name='prometheusJobName' type='string' description="Nom du job ajouté au label">
|
||||||
<value>prometheus</value>
|
<value>prometheus</value>
|
||||||
</variable>
|
</variable>
|
||||||
|
@ -50,51 +36,17 @@
|
||||||
<variable name='prometheusScrapeTimeout' type='string' description="Temps d'attente avant que la récupération de données échoue">
|
<variable name='prometheusScrapeTimeout' type='string' description="Temps d'attente avant que la récupération de données échoue">
|
||||||
<value>10s</value>
|
<value>10s</value>
|
||||||
</variable>
|
</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'>
|
<variable name='job_name_node' type='string' description="Nom du job pour les noeuds" mode='expert'>
|
||||||
<value>node</value>
|
<value>node</value>
|
||||||
</variable>
|
</variable>
|
||||||
<variable name='job_file_config' type='string' description="Emplacement des fichiers de configuration des noeuds" auto_freeze='True' mode='expert' mandatory='True'>
|
<variable name='job_file_config' type='string' description="Emplacement des fichiers de configuration des noeuds" auto_freeze='True' mode='expert' mandatory='True'>
|
||||||
<value>/etc/prometheus/nodes</value>
|
<value>/etc/prometheus/nodes</value>
|
||||||
</variable>
|
</variable>
|
||||||
<variable name='addTargetPrometheus' type='oui/non' description="Ajouter des cibles statiques à Prometheus">
|
|
||||||
<value>non</value>
|
|
||||||
</variable>
|
|
||||||
|
|
||||||
<!-- Job standard -->
|
|
||||||
<variable name='prTarg' type='string' description='Nom de la cible prometheus' multi='True'/>
|
|
||||||
<variable name='prTargIP' type='string' description="Adresse IP ou nom de domaine de la cible prometheus"/>
|
|
||||||
<variable name='prTargSonde' type='string' description="Sonde a utiliser pour ce client">
|
|
||||||
<value>Node Exporter</value>
|
|
||||||
</variable>
|
|
||||||
</family>
|
</family>
|
||||||
<family name='Jobs prometheus'>
|
|
||||||
<variable name='promJobs' type='string' description="Nom du job prometheus" multi='True'/>
|
|
||||||
<variable name='honorLabels' type='oui/non' description='Garder les labels en cas de conflit' mode='expert'>
|
|
||||||
<value>oui</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='scrpInterval' type='number' description="Interval d'intérogation de la sonde (en secondes)">
|
|
||||||
<value>15</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='scrpTimeout' type='number' description="Délais d'attente maximum lors de l'interrogation d'une sonde">
|
|
||||||
<value>10</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='scrpScheme' type='string' description="Protocole à utiliser pour l'interrogation de la sonde">
|
|
||||||
<value>http</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='scrpMetricPath' type='string' description="Chemin d'accès de la ressource">
|
|
||||||
<value>/metrics</value>
|
|
||||||
</variable>
|
|
||||||
|
|
||||||
<variable name='addPrOpenTarg' type='oui/non' description="Ajouter des cibles statiques pour les jobs personnalisé">
|
|
||||||
<value>non</value>
|
|
||||||
</variable>
|
|
||||||
<!-- Job libre -->
|
|
||||||
<variable name='prOpenTarg' type='string' description='Nom de la cible personnalisé prometheus' multi='True'/>
|
|
||||||
<variable name='prOpenTargJob' type='string' description='Nom du job de rattachement de la cible'/>
|
|
||||||
<variable name='prOpenTargIP' type='string' description="Adresse IP ou nom de domaine de la cible"/>
|
|
||||||
<variable name='prOpenTargPort' type='number' description="Port d'écoute de la sonde"/>
|
|
||||||
</family>
|
|
||||||
|
|
||||||
<family name="grafana">
|
<family name="grafana">
|
||||||
<variable name='grafana_domain' type='string' description="Nom de Domaine ou IP pour accèder à l'interface Grafana" mandatory='True'>
|
<variable name='grafana_domain' type='string' description="Nom de Domaine ou IP pour accèder à l'interface Grafana" mandatory='True'>
|
||||||
<value>localhost</value>
|
<value>localhost</value>
|
||||||
|
@ -111,170 +63,23 @@
|
||||||
<variable name='grafana_auth_anonymous' type='string' description="Activer l'accès aux utilisateurs non enregistrés">
|
<variable name='grafana_auth_anonymous' type='string' description="Activer l'accès aux utilisateurs non enregistrés">
|
||||||
<value>false</value>
|
<value>false</value>
|
||||||
</variable>
|
</variable>
|
||||||
<variable name='grafanaRootURL' type='string' description='Url publique de grafana (avec http:// ou https://)' mode='expert'/>
|
|
||||||
</family>
|
</family>
|
||||||
|
|
||||||
<family name="alertes prometheus">
|
|
||||||
<variable name='alSMTPUseSys' type='oui/non' description="Utiliser la passerelle SMTP du système ?">
|
|
||||||
<value>non</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='alSMTPHost' type='string' description="Adresse du serveur SMTP pour l'envois des alertes"/>
|
|
||||||
<variable name='alSMTPPort' type='string' description="Port d'écoute du serveur SMTP pour l'envois des alertes"/>
|
|
||||||
<variable name='alFrom' type='string' description="Adresse d'origine des emails d'alerte"/>
|
|
||||||
<variable name='alSMTPTLS' type='oui/non' description="Utiliser STARTTLS">
|
|
||||||
<value>non</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='alSMTPAuth' type='oui/non' description="Authentification requise sur le serveur SMTP ?">
|
|
||||||
<value>non</value>
|
|
||||||
</variable>
|
|
||||||
<variable name='alSMTPUser' type='string' description="Utilisateur SMTP"/>
|
|
||||||
<variable name='alSMTPPass' type='string' description="Mot de passe"/>
|
|
||||||
|
|
||||||
|
|
||||||
<variable name='alReceiver' type='string' description="Nom du destinataire" multi='True'/>
|
|
||||||
<variable name='alReceiverEmail' type='string' description="Adresse email du destinataire"/>
|
|
||||||
|
|
||||||
<variable name='alDefaultReceiver' type='string' description='Nom du destinataire par défaut'/>
|
|
||||||
|
|
||||||
<variable name='alRoute' type='string' description="Nom de la rêgle de distribution des alertes" multi="True"/>
|
|
||||||
<variable name='alRouteMatchSource' type='string' description='Source de correspondance'/>
|
|
||||||
<variable name='alRouteMatchValue' type='string' description='Valeur attendue'/>
|
|
||||||
<variable name='alRouteMatchReceiver' type='string' description="Nom du destinataire de l'alerte"/>
|
|
||||||
|
|
||||||
<variable name='alRouteRegxp' type='string' description="Rêgle de distribution des alertes" multi="True"/>
|
|
||||||
<variable name='alRouteMatchRegExpSource' type='string' description='Source de correspondance'/>
|
|
||||||
<variable name='alRouteMatchRegExp' type='string' description='Expression régulière'/>
|
|
||||||
<variable name='alRouteMatchRegxpRecv' type='string' description="Nom du destinataire de l'alerte (regxp)"/>
|
|
||||||
|
|
||||||
<variable name='alSubRoute' type='string' description="Nom de la rêgle maitresse" multi='True'/>
|
|
||||||
<variable name='alSubRouteMatchSource' type='string' description='Source de correspondance'/>
|
|
||||||
<variable name='alSubRouteMatchValue' type='string' description='Valeur attendue'/>
|
|
||||||
<variable name='alSubRouteMatchReceiver' type='string' description="Nom du destinataire de l'alerte"/>
|
|
||||||
</family>
|
|
||||||
|
|
||||||
<separators>
|
|
||||||
<separator name='activer_grafana'>Services complèmentairse</separator>
|
|
||||||
<separator name='prometheusJobName'>Configuration du serveur Prometheus</separator>
|
|
||||||
<separator name='job_name_node'>Configuration des jobs standards</separator>
|
|
||||||
<separator name='alSMTPHost'>Configuration SMTP pour l'envois des alertes</separator>
|
|
||||||
<separator name='alReceiver'>Destinatires</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>
|
|
||||||
</separators>
|
|
||||||
|
|
||||||
</variables>
|
</variables>
|
||||||
<constraints>
|
<constraints>
|
||||||
|
|
||||||
<group master='alReceiver'>
|
|
||||||
<slave>alReceiverEmail</slave>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<group master='promJobs'>
|
|
||||||
<slave>scrpInterval</slave>
|
|
||||||
<slave>scrpTimeout</slave>
|
|
||||||
<slave>honorLabels</slave>
|
|
||||||
<slave>scrpScheme</slave>
|
|
||||||
<slave>scrpMetricPath</slave>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<group master='alRoute'>
|
|
||||||
<slave>alRouteMatchSource</slave>
|
|
||||||
<slave>alRouteMatchValue</slave>
|
|
||||||
<slave>alRouteMatchReceiver</slave>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<group master='alRouteRegxp'>
|
|
||||||
<slave>alRouteMatchRegExpSource</slave>
|
|
||||||
<slave>alRouteMatchRegExp</slave>
|
|
||||||
<slave>alRouteMatchRegxpRecv</slave>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<group master='alSubRoute'>
|
|
||||||
<slave>alSubRouteMatchSource</slave>
|
|
||||||
<slave>alSubRouteMatchValue</slave>
|
|
||||||
<slave>alSubRouteMatchReceiver</slave>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<group master='prTarg'>
|
|
||||||
<slave>prTargIP</slave>
|
|
||||||
<slave>prTargSonde</slave>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<group master='prOpenTarg'>
|
|
||||||
<slave>prOpenTargIP</slave>
|
|
||||||
<slave>prOpenTargPort</slave>
|
|
||||||
<slave>prOpenTargJob</slave>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<check name='valid_enum' target='prTargSonde'>
|
|
||||||
<param>['Node Exporter']</param>
|
|
||||||
</check>
|
|
||||||
|
|
||||||
<check name='valid_enum' target='scrpScheme'>
|
|
||||||
<param>['http','https']</param>
|
|
||||||
</check>
|
|
||||||
|
|
||||||
<check name='valid_enum' target='alRouteMatchSource'>
|
|
||||||
<param>['','service','severity']</param>
|
|
||||||
</check>
|
|
||||||
|
|
||||||
<check name='valid_enum' target='alRouteMatchRegExpSource'>
|
|
||||||
<param>['','service','severity']</param>
|
|
||||||
</check>
|
|
||||||
|
|
||||||
<check name='valid_enum' target='alSubRouteMatchSource'>
|
|
||||||
<param>['','service','severity']</param>
|
|
||||||
</check>
|
|
||||||
|
|
||||||
<condition name='disabled_if_in' source='alSMTPUseSys'>
|
|
||||||
<param>oui</param>
|
|
||||||
<target type='variable'>alSMTPUser</target>
|
|
||||||
<target type='variable'>alSMTPPass</target>
|
|
||||||
<target type='variable'>alSMTPPort</target>
|
|
||||||
<target type='variable'>alSMTPTLS</target>
|
|
||||||
<target type='variable'>alSMTPHost</target>
|
|
||||||
<target type='variable'>alSMTPAuth</target>
|
|
||||||
</condition>
|
|
||||||
|
|
||||||
<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>
|
||||||
<target type='family'>alertes prometheus</target>
|
|
||||||
<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>
|
||||||
<target type='filelist'>grafana</target>
|
<target type='filelist'>grafana</target>
|
||||||
</condition>
|
</condition>
|
||||||
|
<condition name='disabled_if_in' source='ajout_client_prometheus'>
|
||||||
<condition name='disabled_if_in' source='activerAlertmanager'>
|
|
||||||
<param>non</param>
|
<param>non</param>
|
||||||
<target type='family'>alertes prometheus</target>
|
<target type='variable'>nouveau_node_exporter</target>
|
||||||
<target type='filelist'>prometheus-alertmanager</target>
|
|
||||||
<target type='service_accesslist'>prometheus-alertmanager</target>
|
|
||||||
</condition>
|
|
||||||
|
|
||||||
<condition name='disabled_if_in' source='addTargetPrometheus'>
|
|
||||||
<param>non</param>
|
|
||||||
<target type='variable'>prTarg</target>
|
|
||||||
<target type='variable'>prTargIP</target>
|
|
||||||
<target type='variable'>prTargSonde</target>
|
|
||||||
</condition>
|
|
||||||
<condition name='disabled_if_in' source='addPrOpenTarg'>
|
|
||||||
<param>non</param>
|
|
||||||
<target type='variable'>prOpenTarg</target>
|
|
||||||
<target type='variable'>prOpenTargIP</target>
|
|
||||||
<target type='variable'>prOpenTargPort</target>
|
|
||||||
</condition>
|
</condition>
|
||||||
</constraints>
|
</constraints>
|
||||||
<help>
|
<help>
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Prometheus Server
|
||||||
|
Documentation=https://prometheus.io/docs/introduction/overview/
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
Restart=on-failure
|
||||||
|
ExecStart=/usr/bin/prometheus --config.file=/etc/prometheus/prometheus.yml
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -1,50 +0,0 @@
|
||||||
#
|
|
||||||
# Alert Rules
|
|
||||||
#
|
|
||||||
groups:
|
|
||||||
- name: EoleRules
|
|
||||||
rules:
|
|
||||||
# Instance is Down
|
|
||||||
- alert: JobInstanceDown
|
|
||||||
expr: up == 0
|
|
||||||
for: 1m
|
|
||||||
annotations:
|
|
||||||
DESCRIPTION: Job {{ $labels.job }} instance {{ $labels.instance }} is down.
|
|
||||||
SUMMARY: Job instance is down
|
|
||||||
|
|
||||||
# Heavy CPU usage
|
|
||||||
- alert: cpu_threshold_exceeded
|
|
||||||
expr: (100 * (1 - avg by(instance) (irate(node_cpu{job="%%{job_name_node}",mode="idle"}[5m]))))
|
|
||||||
> 80
|
|
||||||
annotations:
|
|
||||||
description: This device's cpu usage has exceeded the threshold with a value
|
|
||||||
of {{ $value }}.
|
|
||||||
summary: Instance {{ $labels.instance }} CPU usage is dangerously high
|
|
||||||
|
|
||||||
# Heavy Memory usage
|
|
||||||
- alert: mem_threshold_exceeded
|
|
||||||
expr: (node_memory_MemFree{job="%%{job_name_node}"} + node_memory_Cached{job="%%{job_name_node}"} + node_memory_Buffers{job="%%{job_name_node}"})
|
|
||||||
/ 1e+06 < 80
|
|
||||||
annotations:
|
|
||||||
description: This device's memory usage has exceeded the threshold with a value
|
|
||||||
of {{ $value }}.
|
|
||||||
summary: Instance {{ $labels.instance }} memory usage is dangerously high
|
|
||||||
|
|
||||||
# Heavy "/" use
|
|
||||||
- alert: filesystem_threshold_exceeded
|
|
||||||
expr: node_filesystem_avail{job="%%{job_name_node}",mountpoint="/"} / node_filesystem_size{job="%%{job_name_node}"}
|
|
||||||
* 100 < 20
|
|
||||||
annotations:
|
|
||||||
description: This device's filesystem usage has exceeded the threshold with
|
|
||||||
a value of {{ $value }}.
|
|
||||||
summary: Instance {{ $labels.instance }} filesystem usage is dangerously high
|
|
||||||
|
|
||||||
# Heavy CPU temperature
|
|
||||||
- alert: cpu_temp_threshold_exceeded
|
|
||||||
expr: avg(node_hwmon_temp_celsius{job="node"}) BY (instance)
|
|
||||||
> 70
|
|
||||||
annotations:
|
|
||||||
description: This device's cpu temperature has exceeded the threshold with a value
|
|
||||||
of {{ $value }}.
|
|
||||||
summary: Instance {{ $labels.instance }} CPU temperature is dangerously high
|
|
||||||
|
|
|
@ -1,142 +0,0 @@
|
||||||
global:
|
|
||||||
# The smarthost and SMTP sender used for mail notifications.
|
|
||||||
%if %%alSMTPUseSys == 'oui'
|
|
||||||
%if %%tls_smtp == "non"
|
|
||||||
smtp_smarthost: '%%exim_relay_smtp:25'
|
|
||||||
%elif %%tls_smtp == "port 25"
|
|
||||||
smtp_smarthost: '%%exim_relay_smtp:25'
|
|
||||||
smtp_require_tls: true
|
|
||||||
%else
|
|
||||||
smtp_smarthost: '%%exim_relay_smtp:465'
|
|
||||||
smtp_require_tls: true
|
|
||||||
%end if
|
|
||||||
smtp_from: '%%system_mail_from'
|
|
||||||
%else
|
|
||||||
smtp_smarthost: '%%alSMTPHost:%%alSMTPPort'
|
|
||||||
smtp_from: '%%alFrom'
|
|
||||||
%if %%getVar('alSMTPAuth','non') == 'oui'
|
|
||||||
smtp_auth_username: '%%alSMTPUser'
|
|
||||||
smtp_auth_password: 'alSMTPPass'
|
|
||||||
%end if
|
|
||||||
|
|
||||||
%if %%getVar('alSMTPTLS','non') == 'oui'
|
|
||||||
smtp_require_tls: true
|
|
||||||
%else
|
|
||||||
smtp_require_tls: false
|
|
||||||
%end if
|
|
||||||
%end if
|
|
||||||
|
|
||||||
# The auth token for Hipchat.
|
|
||||||
#hipchat_auth_token: '1234556789'
|
|
||||||
# Alternative host for Hipchat.
|
|
||||||
#hipchat_api_url: 'https://hipchat.foobar.org/'
|
|
||||||
|
|
||||||
# The directory from which notification templates are read.
|
|
||||||
templates:
|
|
||||||
- '/etc/alertmanager/template/*.tmpl'
|
|
||||||
|
|
||||||
# The root route on which each incoming alert enters.
|
|
||||||
route:
|
|
||||||
# The labels by which incoming alerts are grouped together. For example,
|
|
||||||
# multiple alerts coming in for cluster=A and alertname=LatencyHigh would
|
|
||||||
# be batched into a single group.
|
|
||||||
group_by: ['alertname', 'cluster', 'service']
|
|
||||||
|
|
||||||
# When a new group of alerts is created by an incoming alert, wait at
|
|
||||||
# least 'group_wait' to send the initial notification.
|
|
||||||
# This way ensures that you get multiple alerts for the same group that start
|
|
||||||
# firing shortly after another are batched together on the first
|
|
||||||
# notification.
|
|
||||||
group_wait: 30s
|
|
||||||
|
|
||||||
# When the first notification was sent, wait 'group_interval' to send a batch
|
|
||||||
# of new alerts that started firing for that group.
|
|
||||||
group_interval: 5m
|
|
||||||
|
|
||||||
# If an alert has successfully been sent, wait 'repeat_interval' to
|
|
||||||
# resend them.
|
|
||||||
repeat_interval: 3h
|
|
||||||
|
|
||||||
# A default receiver
|
|
||||||
receiver: %%alDefaultReceiver
|
|
||||||
|
|
||||||
# All the above attributes are inherited by all child routes and can
|
|
||||||
# overwritten on each.
|
|
||||||
|
|
||||||
# The child route trees.
|
|
||||||
routes:
|
|
||||||
# This routes performs a regular expression match on alert labels to
|
|
||||||
# catch alerts that are related to a list of services.
|
|
||||||
%for route in %%getVar('alRouteRegxp',[])
|
|
||||||
- match_re:
|
|
||||||
%%{route.alRouteMatchRegExpSource}: %%{route.alRouteMatchRegExp}
|
|
||||||
receiver: %%route.alRouteMatchRegxpRecv
|
|
||||||
%if not %%is_empty('alSubRoute')
|
|
||||||
routes:
|
|
||||||
%for sroute in %%getVar('alSubRoute',[])
|
|
||||||
# The service has a sub-route for critical alerts, any alerts
|
|
||||||
# that do not match, i.e. severity != critical, fall-back to the
|
|
||||||
# parent node and are sent to 'team-X-mails'
|
|
||||||
%if %%sroute == %%route
|
|
||||||
- match:
|
|
||||||
%%{sroute.alSubRouteMatchSource}: %%alSubRouteMatchValue
|
|
||||||
receiver: %%alSubRouteMatchReceiver
|
|
||||||
continue: true
|
|
||||||
%end if
|
|
||||||
%end for
|
|
||||||
%end if
|
|
||||||
%end for
|
|
||||||
%for rt in %%getVar('alRoute',[])
|
|
||||||
- match:
|
|
||||||
%%{rt.alRouteMatchSource}: %%{rt.alRouteMatchValue}
|
|
||||||
receiver: %%rt.alRouteMatchReceiver
|
|
||||||
continue: true
|
|
||||||
|
|
||||||
%if not %%is_empty('alSubRoute')
|
|
||||||
routes:
|
|
||||||
%for sroute in %%getVar('alSubRoute',[])
|
|
||||||
%if %%sroute == %%rt
|
|
||||||
- match:
|
|
||||||
%%{sroute.alSubRouteMatchSource}: %%{sroute.alSubRouteMatchValue}
|
|
||||||
receiver: %%sroute.alSubRouteMatchReceiver
|
|
||||||
continue: true
|
|
||||||
%end if
|
|
||||||
%end for
|
|
||||||
%end if
|
|
||||||
%end for
|
|
||||||
|
|
||||||
# # This route handles all alerts coming from a database service. If there's
|
|
||||||
# # no team to handle it, it defaults to the DB team.
|
|
||||||
# - match:
|
|
||||||
# service: database
|
|
||||||
# receiver: team-DB-pager
|
|
||||||
# # Also group alerts by affected database.
|
|
||||||
# group_by: [alertname, cluster, database]
|
|
||||||
# routes:
|
|
||||||
# - match:
|
|
||||||
# owner: team-X
|
|
||||||
# receiver: team-X-pager
|
|
||||||
# - match:
|
|
||||||
# owner: team-Y
|
|
||||||
# receiver: team-Y-pager
|
|
||||||
|
|
||||||
|
|
||||||
# Inhibition rules allow to mute a set of alerts given that another alert is
|
|
||||||
# firing.
|
|
||||||
# We use this to mute any warning-level notifications if the same alert is
|
|
||||||
# already critical.
|
|
||||||
inhibit_rules:
|
|
||||||
- source_match:
|
|
||||||
severity: 'critical'
|
|
||||||
target_match:
|
|
||||||
severity: 'warning'
|
|
||||||
# Apply inhibition if the alertname is the same.
|
|
||||||
equal: ['alertname', 'cluster', 'service']
|
|
||||||
|
|
||||||
|
|
||||||
receivers:
|
|
||||||
%for rcv in %%getVar('alReceiver',[])
|
|
||||||
- name: '%%rcv'
|
|
||||||
email_configs:
|
|
||||||
- to: '%%rcv.alReceiverEmail'
|
|
||||||
%end for
|
|
|
@ -1,10 +0,0 @@
|
||||||
# # config file version
|
|
||||||
apiVersion: 1
|
|
||||||
|
|
||||||
providers:
|
|
||||||
- name: 'eole'
|
|
||||||
orgId: 1
|
|
||||||
folder: ''
|
|
||||||
type: file
|
|
||||||
options:
|
|
||||||
path: /var/lib/grafana/dashboards
|
|
|
@ -1,11 +0,0 @@
|
||||||
apiVersion: 1
|
|
||||||
|
|
||||||
datasources:
|
|
||||||
- name: Prometheus
|
|
||||||
type: prometheus
|
|
||||||
access: proxy
|
|
||||||
orgId: 1
|
|
||||||
url: http://%%adresse_ip_eth0:9090
|
|
||||||
isDefault: true
|
|
||||||
version: 1
|
|
||||||
editable: false
|
|
File diff suppressed because it is too large
Load Diff
|
@ -21,7 +21,7 @@
|
||||||
;plugins = /var/lib/grafana/plugins
|
;plugins = /var/lib/grafana/plugins
|
||||||
|
|
||||||
# folder that contains provisioning config files that grafana will apply on startup and while running.
|
# folder that contains provisioning config files that grafana will apply on startup and while running.
|
||||||
provisioning = /etc/grafana/provisioning
|
; provisioning = conf/provisioning
|
||||||
|
|
||||||
#################################### Server ####################################
|
#################################### Server ####################################
|
||||||
[server]
|
[server]
|
||||||
|
@ -40,13 +40,11 @@ domain = %%grafana_domain
|
||||||
|
|
||||||
# Redirect to correct domain if host header does not match domain
|
# Redirect to correct domain if host header does not match domain
|
||||||
# Prevents DNS rebinding attacks
|
# Prevents DNS rebinding attacks
|
||||||
enforce_domain = true
|
;enforce_domain = false
|
||||||
|
|
||||||
# The full public facing url you use in browser, used for redirects and emails
|
# The full public facing url you use in browser, used for redirects and emails
|
||||||
# If you use reverse proxy and sub path specify full url (with sub path)
|
# If you use reverse proxy and sub path specify full url (with sub path)
|
||||||
%if %%is_empty('grafanaRootURL')
|
;root_url = http://localhost:3000
|
||||||
root_url = %%grafanaRootURL
|
|
||||||
%end if
|
|
||||||
|
|
||||||
# Log web requests
|
# Log web requests
|
||||||
;router_logging = false
|
;router_logging = false
|
||||||
|
@ -301,20 +299,18 @@ enabled = %%grafana_auth_anonymous
|
||||||
|
|
||||||
#################################### SMTP / Emailing ##########################
|
#################################### SMTP / Emailing ##########################
|
||||||
[smtp]
|
[smtp]
|
||||||
%if %%getVar('activer_exim_relay_smtp','non') == 'oui'
|
;enabled = false
|
||||||
enabled = true
|
;host = localhost:25
|
||||||
host = %%exim_relay_smtp:25
|
|
||||||
;user =
|
;user =
|
||||||
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
|
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
|
||||||
;password =
|
;password =
|
||||||
;cert_file =
|
;cert_file =
|
||||||
;key_file =
|
;key_file =
|
||||||
skip_verify = true
|
;skip_verify = false
|
||||||
from_address = %%system_mail_from
|
;from_address = admin@grafana.localhost
|
||||||
from_name = Grafana
|
;from_name = Grafana
|
||||||
# EHLO identity in SMTP dialog (defaults to instance_name)
|
# EHLO identity in SMTP dialog (defaults to instance_name)
|
||||||
;ehlo_identity = dashboard.example.com
|
;ehlo_identity = dashboard.example.com
|
||||||
%end if
|
|
||||||
|
|
||||||
[emails]
|
[emails]
|
||||||
;welcome_email_on_sign_up = false
|
;welcome_email_on_sign_up = false
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
groups:
|
|
||||||
- name: PredictRules
|
|
||||||
rules:
|
|
||||||
- alert: disk_full_within_6_hours
|
|
||||||
expr: predict_linear(node_filesystem_free{job="%%{job_name_node}",mountpoint="/"}[1h], 6 * 3600) < 0
|
|
||||||
for: 5m
|
|
|
@ -1 +0,0 @@
|
||||||
PROMETHEUS_OPTS='--config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheus/data'
|
|
|
@ -5,67 +5,35 @@ global:
|
||||||
scrape_timeout: %%prometheusScrapeTimeout
|
scrape_timeout: %%prometheusScrapeTimeout
|
||||||
|
|
||||||
rule_files:
|
rule_files:
|
||||||
- "/etc/prometheus/rules.d/*.yml"
|
- "/etc/prometheus/rules.d/*.yml"
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: %%prometheusJobName
|
- job_name: %%prometheusJobName
|
||||||
honor_labels: true
|
honor_labels: true
|
||||||
|
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['%%nom_domaine_machine:9090'%slurp
|
- targets: ['%%nom_domaine_machine:9090']
|
||||||
%if %%getVar('activerSndNodeExpoter','non') == 'oui'
|
%if %%getVar('activerSndNodeExpoter','non') == 'oui'
|
||||||
, '%%nom_domaine_machine:9100'%slurp
|
- targets: ['%%nom_domaine_machine:9100']
|
||||||
%end if
|
%end if
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- job_name: '%%job_name_node'
|
- job_name: '%%job_name_node'
|
||||||
file_sd_configs:
|
file_sd_configs:
|
||||||
# - files: [ "%%job_file_config/*.yml" ]
|
- files: [ "%%job_file_config/*.yml" ]
|
||||||
%if %%getVar('addTargetPrometheus','non') == 'oui'
|
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: [ "%%adresse_ip_eth0:9100"%slurp
|
%if %%getVar('ajout_client_prometheus','non') == 'oui'
|
||||||
%for %%cliPr in %%getVar('prTarg',[])
|
%if not %%is_empty(%%nouveau_node_exporter)
|
||||||
%if %%cliPr.prTargSonde == 'Node Exporter'
|
%for %%client_prometheus in %%nouveau_node_exporter
|
||||||
, '%%cliPr.prTargIP:9100'%slurp
|
- targets: ['%%client_prometheus:9100']
|
||||||
%end if
|
|
||||||
%end for
|
%end for
|
||||||
]
|
%end if
|
||||||
%end if
|
%end if
|
||||||
|
|
||||||
%for %%job in %%getVar('promJobs', [])
|
#alerting:
|
||||||
- job_name: '%%job'
|
# alertmanagers:
|
||||||
%if %%job.honorLabels == 'oui'
|
# - scheme: https
|
||||||
honor_labels: true
|
# static_configs:
|
||||||
%else
|
# - targets:
|
||||||
honor_labels: false
|
# - "1.2.3.4:9093"
|
||||||
%end if
|
# - "1.2.3.5:9093"
|
||||||
scrape_interval: %%{job.scrpInterval}s
|
# - "1.2.3.6:9093"
|
||||||
scrape_timeout: %%{job.scrpTimeout}s
|
|
||||||
scheme: %%job.scrpScheme
|
|
||||||
metrics_path: %%job.scrpMetricPath
|
|
||||||
%set first = True
|
|
||||||
static_configs:
|
|
||||||
- targets: [ %slurp
|
|
||||||
%for %%target in %%getVar('prOpenTarg',[])
|
|
||||||
%if %%target.prOpenTargJob == %%job
|
|
||||||
%if %%first
|
|
||||||
"%%target.prOpenTargIP:%%target.prOpenTargPort"%slurp
|
|
||||||
%set first = False
|
|
||||||
%else
|
|
||||||
, "%%target.prOpenTargIP:%%target.prOpenTargPort"%slurp
|
|
||||||
%end if
|
|
||||||
%end if
|
|
||||||
%end for
|
|
||||||
]
|
|
||||||
%end for
|
|
||||||
|
|
||||||
%if %%getVar('activerAlertmanager','non') == 'oui'
|
|
||||||
alerting:
|
|
||||||
alertmanagers:
|
|
||||||
- scheme: http
|
|
||||||
static_configs:
|
|
||||||
- targets:
|
|
||||||
- "%%nom_domaine_machine:9093"
|
|
||||||
%end if
|
|
||||||
|
|
Loading…
Reference in New Issue