Compare commits

..

21 Commits

Author SHA1 Message Date
ee26997348 Merge branch 'master' into dist/eole/2.6.2/master 2018-06-19 17:35:10 +02:00
7f9d0d252d Merge branch 'master' into dist/eole/2.6.2/master 2018-06-13 10:40:22 +02:00
16da5b91fa Merge branch 'master' into dist/eole/2.6.2/master 2018-06-13 10:35:02 +02:00
24332a98c8 Merge branch 'master' into dist/eole/2.6.2/master 2018-06-11 15:45:40 +02:00
37d0dee412 Merge branch 'master' into dist/eole/2.6.2/master 2018-06-11 09:36:47 +02:00
be23766fc2 Merge branch 'master' into dist/eole/2.6.2/master 2018-06-06 16:47:31 +02:00
1f6a18a14b We need curl 2018-06-06 14:45:27 +02:00
c0b430ec2c Adding missing depend 2018-06-06 14:42:11 +02:00
39e1ed720d Merge branch 'master' into dist/eole/2.6.2/master 2018-06-06 14:39:46 +02:00
d5fe43fc05 Merge branch 'master' into dist/eole/2.6.2/master 2018-06-06 09:26:34 +02:00
d154fcd94e Merge branch 'master' into dist/eole/2.6.2/master 2018-06-06 09:11:03 +02:00
fb6ee11d7a Merge branch 'master' into dist/eole/2.6.2/master 2018-06-05 17:18:54 +02:00
0614d2863a Merge branch 'master' into dist/eole/2.6.2/master 2018-06-05 14:32:12 +02:00
0bfbcc71ab Adding debian depends 2018-06-01 11:41:59 +02:00
cbf8d62cdc Merge branch 'dist/eole/2.6.2/master' of https://forge.cadoles.com/Cadoles/eole-prometheus into dist/eole/2.6.2/master 2018-06-01 11:32:05 +02:00
2af543c34e Revert "Adding debian packaging files"
This reverts commit 2da03082ec.
2018-06-01 11:32:00 +02:00
2da03082ec Adding debian packaging files 2018-06-01 11:30:56 +02:00
290231b394 Merge branch 'master' into dist/eole/2.6.2/master 2018-05-25 17:24:38 +02:00
4c6d88bae2 Merge branch 'master' into dist/eole/2.6.2/master 2018-05-25 16:01:35 +02:00
0a656de9e6 oubli du dossier debian ... 2018-05-25 15:56:49 +02:00
d1e5392a9a paquet debian 2018-05-25 13:32:18 +02:00
14 changed files with 93 additions and 46 deletions

View File

@ -1,9 +1,9 @@
################################
# Makefile pour XXX-XXX
# Makefile pour eole-prometheus
################################
SOURCE=eole-prometheus
VERSION=0.1
VERSION=0.0.1
EOLE_VERSION=2.6
EOLE_RELEASE=2.6.2
PKGAPPS=non

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
7

11
debian/control vendored Normal file
View File

@ -0,0 +1,11 @@
Source: eole-prometheus
Section: web
Priority: optional
Maintainer: Cadoles <contact@cadoles.com>
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.3
Package: eole-prometheus
Architecture: amd64
Depends: ${misc:Depends}, prometheus, grafana, eole-node-exporter, prometheus-alertmanager, curl
Description: Eolisation de Prometheus

44
debian/copyright vendored Normal file
View File

@ -0,0 +1,44 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Name: {PROJECT}
Source: {URL}
Files: *
Copyright: YEAR {UPSTREAM} {AUTHOR} <{MAIL}>
License: {UPSTREAM LICENSE}
Files: debian/*
Copyright: 2012 Équipe EOLE <eole@ac-dijon.fr>
License: CeCILL-2
License: {UPSTREAM LICENSE}
{TEXT OF THE LICENSE}
License: CeCILL-2
This software is governed by the CeCILL-2 license under French law and
abiding by the rules of distribution of free software. You can use,
modify and or redistribute the software under the terms of the CeCILL-2
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info";.
.
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited
liability.
.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-2 license and that you accept its terms.
.
On Eole systems, the complete text of the CeCILL-2 License can be found
in '/usr/share/common-licenses/CeCILL-2-en'.

0
debian/eole-prometheus.install vendored Normal file
View File

8
debian/rules vendored Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
%:
dh $@

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<creole>
<files>
<file filelist='prometheus' name='/etc/default/prometheus' source='prometheus.defaults' mkdir='True' rm='True'/>
<file filelist='prometheus' name='/etc/default/prometheus' source='prometheus.defaults' mkdir='True' rm='True'/>
<file filelist='prometheus' name='/etc/prometheus/prometheus.yml' mkdir='True' rm='True'/>
<file filelist='alertmanager' name='/etc/prometheus/alertmanager.yml' mkdir='True' rm='True'/>
<file filelist='alertmanager' name='/etc/prometheus/rules.d/alert-rules.yml' mkdir='True' rm='True'/>
<file filelist='alertmanager' name='/etc/prometheus/rules.d/predict-rules.yml' mkdir='True' rm='True'/>
<file filelist='alertmanager' name='/etc/prometheus/rules.d/alert-rules.yml' mkdir='True' rm='True'/>
<file filelist='grafana' name='/etc/grafana/grafana.ini' mkdir='True' rm='True'/>
<service>prometheus</service>
@ -59,7 +58,7 @@
<!-- 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='prTargIP' type='ip' description="Adresse IP de la cible prometheus"/>
<variable name='prTargSonde' type='string' description="Sonde a utiliser pour ce client">
<value>Node Exporter</value>
</variable>
@ -78,9 +77,6 @@
<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>
@ -88,7 +84,7 @@
<!-- 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='prOpenTargIP' type='ip' description="Adresse IP de la cible"/>
<variable name='prOpenTargPort' type='number' description="Port d'écoute de la sonde"/>
</family>
@ -108,7 +104,6 @@
<variable name='grafana_auth_anonymous' type='string' description="Activer l'accès aux utilisateurs non enregistrés">
<value>false</value>
</variable>
<variable name='grafanaRootURL' type='string' description='Url publique de grafana (avec http:// ou https://)' mode='expert'/>
</family>
<family name="alertes prometheus">
@ -152,7 +147,7 @@
<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='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>
@ -171,8 +166,7 @@
<slave>scrpInterval</slave>
<slave>scrpTimeout</slave>
<slave>honorLabels</slave>
<slave>scrpScheme</slave>
<slave>scrpMetricPath</slave>
<slave>scrpScheme</slave>
</group>
<group master='alRoute'>

View File

@ -33,7 +33,7 @@ groups:
# Heavy "/" use
- alert: filesystem_threshold_exceeded
expr: node_filesystem_avail{job="%%{job_name_node}",mountpoint="/"} / node_filesystem_size{job="%%{job_name_node}"}
* 100 < 20
* 100 < 90
annotations:
description: This device's filesystem usage has exceeded the threshold with
a value of {{ $value }}.

View File

@ -4,13 +4,12 @@ global:
%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
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'
@ -32,8 +31,8 @@ global:
#hipchat_api_url: 'https://hipchat.foobar.org/'
# The directory from which notification templates are read.
templates:
- '/etc/alertmanager/template/*.tmpl'
templates:
- '/etc/alertmanager/template/*.tmpl'
# The root route on which each incoming alert enters.
route:
@ -55,12 +54,12 @@ route:
# If an alert has successfully been sent, wait 'repeat_interval' to
# resend them.
repeat_interval: 3h
repeat_interval: 3h
# A default receiver
receiver: %%alDefaultReceiver
# All the above attributes are inherited by all child routes and can
# All the above attributes are inherited by all child routes and can
# overwritten on each.
# The child route trees.
@ -120,7 +119,7 @@ route:
# 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
# We use this to mute any warning-level notifications if the same alert is
# already critical.
inhibit_rules:
- source_match:

View File

@ -40,13 +40,11 @@ domain = %%grafana_domain
# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
enforce_domain = true
;enforce_domain = false
# 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 %%is_empty('grafanaRootURL')
root_url = %%grafanaRootURL
%end if
;root_url = http://localhost:3000
# Log web requests
;router_logging = false
@ -301,20 +299,18 @@ enabled = %%grafana_auth_anonymous
#################################### SMTP / Emailing ##########################
[smtp]
%if %%getVar('activer_exim_relay_smtp','non') == 'oui'
enabled = true
host = %%exim_relay_smtp:25
;enabled = false
;host = localhost:25
;user =
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
;password =
;cert_file =
;key_file =
skip_verify = true
from_address = %%system_mail_from
from_name = Grafana
;skip_verify = false
;from_address = admin@grafana.localhost
;from_name = Grafana
# EHLO identity in SMTP dialog (defaults to instance_name)
;ehlo_identity = dashboard.example.com
%end if
[emails]
;welcome_email_on_sign_up = false

View File

@ -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

View File

@ -1 +1 @@
PROMETHEUS_OPTS='--config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheus/data'
PROMETHEUS_OPTS='--config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheus/data --storage.local.retention=%%{promStorageRetention}h'

View File

@ -22,7 +22,7 @@ scrape_configs:
- job_name: '%%job_name_node'
file_sd_configs:
# - files: [ "%%job_file_config/*.yml" ]
- files: [ "%%job_file_config/*.yml" ]
%if %%getVar('addTargetPrometheus','non') == 'oui'
static_configs:
- targets: [ "%%adresse_ip_eth0:9100"%slurp
@ -44,7 +44,6 @@ scrape_configs:
scrape_interval: %%{job.scrpInterval}s
scrape_timeout: %%{job.scrpTimeout}s
scheme: %%job.scrpScheme
metrics_path: %%job.scrpMetricPath
%set first = True
static_configs:
- targets: [ %slurp