55 lines
1.9 KiB
Text
55 lines
1.9 KiB
Text
|
|
/*
|
||
|
|
* Gere par Set-OPS (role serveur_icinga). Ne pas editer a la main.
|
||
|
|
*
|
||
|
|
* LE MATERIEL — hyperviseurs et frontiere (2026-09-17).
|
||
|
|
*
|
||
|
|
* Ces equipements n'accueillent aucun porteur de sante : ils ne peuvent rien pousser. Mais
|
||
|
|
* Prometheus les TIRE deja. Le controle lit donc ce qu'il a recolte, avec le catalogue que
|
||
|
|
* le tableau Grafana « Materiel » affiche — `scripts/materiel.py`, une source, deux lecteurs.
|
||
|
|
*
|
||
|
|
* L'HOTE EST JUGE PAR PROMETHEUS, PAS PAR UN PING. Un `hostalive` depuis cette machine vers
|
||
|
|
* la grappe de controle exigerait un flux ICMP qu'aucune couche ne declare ; il dirait
|
||
|
|
* « eteint » d'une machine en parfaite sante. Le seul chemin qui existe est celui de la
|
||
|
|
* scrutation : c'est lui qu'on interroge.
|
||
|
|
*/
|
||
|
|
|
||
|
|
object CheckCommand "setops-materiel" {
|
||
|
|
command = [ "{{ serveur_icinga_materiel_sonde }}" ]
|
||
|
|
arguments = {
|
||
|
|
"--hote" = "$setops_materiel_hote$"
|
||
|
|
"--catalogue" = "{{ serveur_icinga_materiel_catalogue }}"
|
||
|
|
"--prometheus" = "{{ serveur_icinga_materiel_prometheus }}"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
object CheckCommand "setops-materiel-joignable" {
|
||
|
|
command = [ "{{ serveur_icinga_materiel_sonde }}", "--joignabilite" ]
|
||
|
|
arguments = {
|
||
|
|
"--hote" = "$setops_materiel_hote$"
|
||
|
|
"--catalogue" = "{{ serveur_icinga_materiel_catalogue }}"
|
||
|
|
"--prometheus" = "{{ serveur_icinga_materiel_prometheus }}"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
{% for h in setops_materiel_hotes | default([]) %}
|
||
|
|
object Host "{{ h.nom }}" {
|
||
|
|
check_command = "setops-materiel-joignable"
|
||
|
|
address = "{{ h.adresse }}"
|
||
|
|
check_interval = 1m
|
||
|
|
retry_interval = 30s
|
||
|
|
vars.role = "{{ h.role }}"
|
||
|
|
vars.setops_materiel_hote = "{{ h.nom }}"
|
||
|
|
}
|
||
|
|
|
||
|
|
object Service "materiel" {
|
||
|
|
host_name = "{{ h.nom }}"
|
||
|
|
check_command = "setops-materiel"
|
||
|
|
check_interval = 5m
|
||
|
|
retry_interval = 1m
|
||
|
|
{# Trois lectures avant de crier : le verdict est deja lisse (moyennes de 5 a 15 min), on
|
||
|
|
ne veut pas d'une alerte sur un redemarrage de Prometheus. #}
|
||
|
|
max_check_attempts = 3
|
||
|
|
vars.setops_materiel_hote = "{{ h.nom }}"
|
||
|
|
}
|
||
|
|
{% endfor %}
|