deuxième commit

This commit is contained in:
Daniel Allaire 2026-03-06 13:35:44 -05:00
parent b038bf01ec
commit 7760d9aaa9
12 changed files with 220 additions and 0 deletions

View file

@ -0,0 +1,9 @@
## Origine du projet
Le concept Life-NOC est né dune réflexion sur la surcharge mentale produite par la complexité du monde moderne.
Lidée centrale est dappliquer les principes de supervision des centres dopérations (NOC) à la gestion du quotidien :
- transformer la charge mentale invisible en état observable.
Le projet est développé et partagé par Chezlepro Inc. afin daider les personnes qui souhaitent retrouver de la clarté et de la sérénité dans leur organisation personnelle.

View file

@ -0,0 +1,5 @@
- hosts: icinga
become: yes
roles:
- life_noc

View file

@ -0,0 +1,15 @@
- name: installer script check
copy:
src: check_echeance_vie.sh
dest: /usr/lib/nagios/plugins/check_echeance_vie.sh
mode: '0755'
- name: déployer configuration icinga
copy:
src: ../../icinga/
dest: /etc/icinga2/conf.d/life-noc/
- name: recharger icinga
service:
name: icinga2
state: reloaded

View file

@ -0,0 +1,8 @@
LIFE-NOC
├ FOCUS
├ FINANCES
├ ADMIN
├ MAISON
├ SANTE
├ PROJETS
└ RESILIENCE

View file

@ -0,0 +1,24 @@
#!/bin/bash
DATE=$1
WARN=$2
CRIT=$3
NOW=$(date +%s)
DUE=$(date -d "$DATE" +%s)
DELTA=$((DUE - NOW))
DAYS=$((DELTA / 86400))
if [ "$DAYS" -le "$CRIT" ]; then
echo "CRITICAL - échéance imminente"
exit 2
fi
if [ "$DAYS" -le "$WARN" ]; then
echo "WARNING - échéance proche"
exit 1
fi
echo "OK - sous contrôle"
exit 0

View file

@ -0,0 +1,13 @@
object CheckCommand "check_echeance_vie" {
command = [ PluginDir + "/check_echeance_vie.sh" ]
arguments = {
"--date" = "$date_echeance$"
"--warn" = "$warning_days$"
"--crit" = "$critical_days$"
}
}

View file

@ -0,0 +1,9 @@
object Host "life-noc" {
import "generic-host"
address = "127.0.0.1"
vars.type = "life-noc"
}

View file

@ -0,0 +1,14 @@
apply Service "CP-MENSUEL-FINANCES-REVISION_COMPTES" {
import "service-echance-vie"
vars.date_echeance = "2026-04-01"
vars.warning_days = 5
vars.critical_days = 1
vars.domaine_vie = "FINANCES"
assign where host.name == "life-noc"
}

View file

@ -0,0 +1,35 @@
apply Service "FOCUS-01" {
import "service-focus"
check_command = "dummy"
vars.dummy_state = 0
vars.dummy_text = "Priorité 1"
assign where host.name == "life-noc"
}
apply Service "FOCUS-02" {
import "service-focus"
check_command = "dummy"
vars.dummy_state = 0
vars.dummy_text = "Priorité 2"
assign where host.name == "life-noc"
}
apply Service "FOCUS-03" {
import "service-focus"
check_command = "dummy"
vars.dummy_state = 0
vars.dummy_text = "Priorité 3"
assign where host.name == "life-noc"
}

View file

@ -0,0 +1,8 @@
template Service "service-echance-vie" {
check_command = "check_echeance_vie"
vars.warning_days = 5
vars.critical_days = 1
}

View file

@ -0,0 +1,5 @@
template Service "service-focus" {
check_command = "dummy"
}

75
prepare_commit.sh Executable file
View file

@ -0,0 +1,75 @@
#!/usr/bin/env bash
set -e
echo "=== Life-NOC repository preparation ==="
# Vérifier qu'on est dans un repo git
if [ ! -d ".git" ]; then
echo "Erreur: ce répertoire n'est pas un dépôt git."
exit 1
fi
echo
echo "1) Suppression du doublon template"
DUPLICATE="icinga/templates/service-echeance.conf"
if [ -f "$DUPLICATE" ]; then
git rm "$DUPLICATE"
echo "Supprimé: $DUPLICATE"
else
echo "Doublon déjà absent."
fi
echo
echo "2) Création du .gitignore"
cat > .gitignore << 'EOF'
*.swp
*.log
*.retry
*.pyc
__pycache__/
.ansible/
.vscode/
EOF
echo ".gitignore créé."
echo
echo "3) Création du CHANGELOG"
cat > CHANGELOG.md << 'EOF'
# CHANGELOG
## v0.1
Initialisation du projet Life-NOC
Contenu :
- concept Life-NOC
- architecture Icinga
- premiers services
- check échéance
- structure BPM
- déploiement Ansible initial
EOF
echo "CHANGELOG.md créé."
echo
echo "4) Ajout des fichiers"
git add .
echo
echo "5) Commit"
git commit -m "Life-NOC v0.1 initial architecture"
echo
echo "=== Terminé ==="
echo
echo "Le dépôt Life-NOC est maintenant cristallisé."