From 41a7e82d0d02f013a097135fa64cfc676119137b Mon Sep 17 00:00:00 2001 From: Daniel Allaire Date: Mon, 16 Mar 2026 18:05:17 -0400 Subject: [PATCH] Interface web pour admin domains.yaml --- ansible/group_vars/all.yml | 1 + ansible/roles/life_noc/defaults/main.yml | 2 + ansible/roles/life_noc/tasks/main.yml | 2 + .../templates/life-noc-input-api.service.j2 | 1 + data/inputs/actifs-chezlepro.yaml | 12 + data/inputs/animaux.yaml | 4 + data/inputs/communaute.yaml | 20 + data/inputs/documentation.yaml | 16 + data/inputs/energie.yaml | 32 + data/inputs/exploitation-chezlepro.yaml | 24 + data/inputs/finances-personnelles.yaml | 36 + data/inputs/fiscalite-personnelle.yaml | 12 + data/inputs/focus.yaml | 12 + data/inputs/garage-et-rangement.yaml | 20 + data/inputs/informatique-personnelle.yaml | 20 + data/inputs/infrastructure-chezlepro.yaml | 40 + data/inputs/jardin.yaml | 32 + data/inputs/maison.yaml | 60 + data/inputs/obligations-chezlepro.yaml | 16 + .../obligations-legales-personnelles.yaml | 20 +- data/inputs/outils-et-equipements.yaml | 20 + data/inputs/projets.yaml | 24 + data/inputs/reseau-chezlepro.yaml | 32 + data/inputs/resilience.yaml | 16 + data/inputs/revue.yaml | 8 + data/inputs/sante.yaml | 4 + data/inputs/securite-chezlepro.yaml | 20 + data/inputs/stock-alimentaire.yaml | 4 + data/inputs/voiture.yaml | 8 + docs/guides/admin-ui-optionnelle.md | 125 + domains.yaml | 2415 ++++++++++++++++- icinga/services/actifs-chezlepro.conf | 61 +- icinga/services/animaux.conf | 23 +- icinga/services/communaute.conf | 95 +- icinga/services/documentation.conf | 76 +- icinga/services/energie.conf | 158 +- icinga/services/exploitation-chezlepro.conf | 114 +- icinga/services/finances-personnelles.conf | 171 +- icinga/services/fiscalite-personnelle.conf | 65 +- icinga/services/focus.conf | 57 +- icinga/services/garage-et-rangement.conf | 95 +- icinga/services/informatique-personnelle.conf | 95 +- icinga/services/infrastructure-chezlepro.conf | 196 +- icinga/services/jardin.conf | 156 +- icinga/services/maison.conf | 287 +- icinga/services/obligations-chezlepro.conf | 84 +- .../obligations-legales-personnelles.conf | 82 +- icinga/services/outils-et-equipements.conf | 95 +- icinga/services/projets.conf | 114 +- icinga/services/reseau-chezlepro.conf | 156 +- icinga/services/resilience.conf | 84 +- icinga/services/revue.conf | 40 +- icinga/services/sante.conf | 27 +- icinga/services/securite-chezlepro.conf | 97 +- icinga/services/stock-alimentaire.conf | 31 +- icinga/services/voiture.conf | 54 +- lib/life_noc_domains.py | 355 +++ scripts/generate_services.py | 16 + scripts/life_noc_input_api.py | 854 +++++- 59 files changed, 5983 insertions(+), 813 deletions(-) create mode 100644 data/inputs/actifs-chezlepro.yaml create mode 100644 data/inputs/animaux.yaml create mode 100644 data/inputs/communaute.yaml create mode 100644 data/inputs/documentation.yaml create mode 100644 data/inputs/energie.yaml create mode 100644 data/inputs/exploitation-chezlepro.yaml create mode 100644 data/inputs/finances-personnelles.yaml create mode 100644 data/inputs/fiscalite-personnelle.yaml create mode 100644 data/inputs/focus.yaml create mode 100644 data/inputs/garage-et-rangement.yaml create mode 100644 data/inputs/informatique-personnelle.yaml create mode 100644 data/inputs/infrastructure-chezlepro.yaml create mode 100644 data/inputs/jardin.yaml create mode 100644 data/inputs/maison.yaml create mode 100644 data/inputs/obligations-chezlepro.yaml create mode 100644 data/inputs/outils-et-equipements.yaml create mode 100644 data/inputs/projets.yaml create mode 100644 data/inputs/reseau-chezlepro.yaml create mode 100644 data/inputs/resilience.yaml create mode 100644 data/inputs/sante.yaml create mode 100644 data/inputs/securite-chezlepro.yaml create mode 100644 data/inputs/stock-alimentaire.yaml create mode 100644 data/inputs/voiture.yaml create mode 100644 docs/guides/admin-ui-optionnelle.md create mode 100644 lib/life_noc_domains.py diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index db53db7..959da6f 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -1,4 +1,5 @@ life_noc_fqdn: c7-life-noc-01 +life_noc_admin_ui_enabled: true life_noc_admin_user: icingadmin life_noc_admin_password: l1f3_N0C_ADM diff --git a/ansible/roles/life_noc/defaults/main.yml b/ansible/roles/life_noc/defaults/main.yml index 30db98d..25ce0c6 100644 --- a/ansible/roles/life_noc/defaults/main.yml +++ b/ansible/roles/life_noc/defaults/main.yml @@ -6,5 +6,7 @@ life_noc_reload_icinga: true life_noc_bpm_deploy_enabled: false life_noc_bpm_destination_dir: /etc/icingaweb2/modules/businessprocess/processes life_noc_bpm_target_file: /etc/icingaweb2/modules/businessprocess/processes/Life-NOC.conf +life_noc_public_base_url: "http://{{ ansible_host | default(inventory_hostname) }}:8787" life_noc_owner: root life_noc_group: root +life_noc_admin_ui_enabled: false diff --git a/ansible/roles/life_noc/tasks/main.yml b/ansible/roles/life_noc/tasks/main.yml index 1869176..bd2037b 100644 --- a/ansible/roles/life_noc/tasks/main.yml +++ b/ansible/roles/life_noc/tasks/main.yml @@ -51,6 +51,8 @@ ansible.builtin.command: cmd: python3 scripts/generate_services.py chdir: "{{ life_noc_project_root }}" + environment: + LIFE_NOC_PUBLIC_BASE_URL: "{{ life_noc_public_base_url }}" changed_when: true - name: generate bpm from domains diff --git a/ansible/roles/life_noc/templates/life-noc-input-api.service.j2 b/ansible/roles/life_noc/templates/life-noc-input-api.service.j2 index 15aeaa8..bf79261 100644 --- a/ansible/roles/life_noc/templates/life-noc-input-api.service.j2 +++ b/ansible/roles/life_noc/templates/life-noc-input-api.service.j2 @@ -7,6 +7,7 @@ Type=simple User=root Group=root WorkingDirectory={{ life_noc_project_root }} +Environment=LIFE_NOC_ADMIN_UI_ENABLED={{ "1" if (life_noc_admin_ui_enabled | bool) else "0" }} ExecStart=/usr/bin/python3 -m uvicorn scripts.life_noc_input_api:app --host 0.0.0.0 --port 8787 Restart=on-failure RestartSec=3 diff --git a/data/inputs/actifs-chezlepro.yaml b/data/inputs/actifs-chezlepro.yaml new file mode 100644 index 0000000..a0ddd27 --- /dev/null +++ b/data/inputs/actifs-chezlepro.yaml @@ -0,0 +1,12 @@ +revision-inventaire-materiel: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-serveurs-et-composants: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revision-actifs-transferts: + value: '2026-03-17' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/animaux.yaml b/data/inputs/animaux.yaml new file mode 100644 index 0000000..2cccb3f --- /dev/null +++ b/data/inputs/animaux.yaml @@ -0,0 +1,4 @@ +revision-routine-soins-animaux: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/communaute.yaml b/data/inputs/communaute.yaml new file mode 100644 index 0000000..3b9a827 --- /dev/null +++ b/data/inputs/communaute.yaml @@ -0,0 +1,20 @@ +verification-outils-aa: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-espace-87-16: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-salles-visio-groupes: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-depots-rapports-rsg: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revision-outils-communication-communaute: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/documentation.yaml b/data/inputs/documentation.yaml new file mode 100644 index 0000000..de01813 --- /dev/null +++ b/data/inputs/documentation.yaml @@ -0,0 +1,16 @@ +revue-docs-personnelles-importantes: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revue-wiki-technique: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revue-base-connaissances: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-sauvegarde-docs-cles: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/energie.yaml b/data/inputs/energie.yaml new file mode 100644 index 0000000..9f65b70 --- /dev/null +++ b/data/inputs/energie.yaml @@ -0,0 +1,32 @@ +inspection-batteries-lifepo4: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-can-rs485: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-cablage-energie: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-busbars: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-parametres-charge: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +test-charge-batteries: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +test-comportement-onduleur: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-journal-evenements-victron: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/exploitation-chezlepro.yaml b/data/inputs/exploitation-chezlepro.yaml new file mode 100644 index 0000000..0067e66 --- /dev/null +++ b/data/inputs/exploitation-chezlepro.yaml @@ -0,0 +1,24 @@ +revision-playbooks-ansible: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-inventaires-ansible: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revision-documentation-technique: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-procedures-reprise: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revue-capacite-ressources: + value: '2026-03-17' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-jobs-automatises: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/finances-personnelles.yaml b/data/inputs/finances-personnelles.yaml new file mode 100644 index 0000000..61ea6df --- /dev/null +++ b/data/inputs/finances-personnelles.yaml @@ -0,0 +1,36 @@ +revision-comptes-bancaires: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-cartes-credit: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +paiement-cartes-credit: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revision-budget-personnel: + value: '2026-03-05' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-prelevements-automatiques: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-placements: + value: '2026-04-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-cotisations-reer: + value: '2026-02-21' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-celi: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +preparation-dossier-financier-annuel: + value: '2025-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/fiscalite-personnelle.yaml b/data/inputs/fiscalite-personnelle.yaml new file mode 100644 index 0000000..53c469e --- /dev/null +++ b/data/inputs/fiscalite-personnelle.yaml @@ -0,0 +1,12 @@ +preparation-documents-impots: + value: '2026-03-08' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-avis-cotisation: + value: '2026-03-02' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +archivage-documents-fiscaux: + value: '2026-03-17' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/focus.yaml b/data/inputs/focus.yaml new file mode 100644 index 0000000..57b90b2 --- /dev/null +++ b/data/inputs/focus.yaml @@ -0,0 +1,12 @@ +entretien-processus-focus: + value: '2026-03-02' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +nettoyage-inbox-mentale: + value: '2026-03-02' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revue-limitation-engagements: + value: '2026-02-28' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/garage-et-rangement.yaml b/data/inputs/garage-et-rangement.yaml new file mode 100644 index 0000000..6053fe2 --- /dev/null +++ b/data/inputs/garage-et-rangement.yaml @@ -0,0 +1,20 @@ +inspection-rangement-plafond: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revue-inventaire-garage: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-rouille-outillage: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-securite-garage: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +rotation-stockage-bacs: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/informatique-personnelle.yaml b/data/inputs/informatique-personnelle.yaml new file mode 100644 index 0000000..53a2fd4 --- /dev/null +++ b/data/inputs/informatique-personnelle.yaml @@ -0,0 +1,20 @@ +verification-sauvegardes-personnelles: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +nettoyage-stockage-personnel: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-comptes-importants: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revue-mots-de-passe-personnels: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-documents-cloud-personnels: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/infrastructure-chezlepro.yaml b/data/inputs/infrastructure-chezlepro.yaml new file mode 100644 index 0000000..7827c65 --- /dev/null +++ b/data/inputs/infrastructure-chezlepro.yaml @@ -0,0 +1,40 @@ +verification-proxmox: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +test-restauration-backups: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-pbs-truenas: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-apt-cacher-ng: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-icinga2: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-keycloak-openldap: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-nextcloud: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-mailcow: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-openvas: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-journaux-systemes: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/jardin.yaml b/data/inputs/jardin.yaml new file mode 100644 index 0000000..2153095 --- /dev/null +++ b/data/inputs/jardin.yaml @@ -0,0 +1,32 @@ +inspection-vignes: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +entretien-bleuetiers: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +entretien-framboisiers: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-kiwis-nordiques: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +entretien-rhubarbe: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-groseillier: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-muriers: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +entretien-houblon: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/maison.yaml b/data/inputs/maison.yaml new file mode 100644 index 0000000..fcc222f --- /dev/null +++ b/data/inputs/maison.yaml @@ -0,0 +1,60 @@ +remplacement-filtre-fournaise: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-fournaise: + value: '2026-03-19' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-thermopompe: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +nettoyage-unites-exterieures: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-toiture: + value: '2026-04-04' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-gouttieres: + value: '2026-05-05' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-fondation: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-drainage-terrain: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +test-detecteurs-fumee: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +test-detecteurs-co: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +remplacement-piles-detecteurs: + value: '2026-04-04' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-plomberie-visible: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-sump-pump: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-calfetrage: + value: '2026-04-18' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-portes-garage: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/obligations-chezlepro.yaml b/data/inputs/obligations-chezlepro.yaml new file mode 100644 index 0000000..2e94837 --- /dev/null +++ b/data/inputs/obligations-chezlepro.yaml @@ -0,0 +1,16 @@ +verification-dossier-comptable-entreprise: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-facturation-clients: + value: '2026-03-10' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-paiements-fournisseurs: + value: '2026-03-10' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +archivage-documents-entreprise: + value: '2026-03-02' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/obligations-legales-personnelles.yaml b/data/inputs/obligations-legales-personnelles.yaml index 7d23679..4edc95c 100644 --- a/data/inputs/obligations-legales-personnelles.yaml +++ b/data/inputs/obligations-legales-personnelles.yaml @@ -1,4 +1,20 @@ renouvellement-permis-conduire: - value: "2026-09-20" - captured_at: "2026-03-14T23:30:00Z" + value: '2026-09-20' + captured_at: '2026-03-14T23:30:00Z' origin: manual +verification-testament: + value: '2026-04-02' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-mandat-inaptitude: + value: '2026-04-02' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-directives-medicales: + value: '2026-01-16' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-papiers-identite: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/outils-et-equipements.yaml b/data/inputs/outils-et-equipements.yaml new file mode 100644 index 0000000..a7ffecf --- /dev/null +++ b/data/inputs/outils-et-equipements.yaml @@ -0,0 +1,20 @@ +entretien-outils-jardin: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +inspection-outils-electriques: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-rallonges-et-connecteurs: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-compresseur-et-accessoires: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revision-inventaire-outillage: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/projets.yaml b/data/inputs/projets.yaml new file mode 100644 index 0000000..7f07fc4 --- /dev/null +++ b/data/inputs/projets.yaml @@ -0,0 +1,24 @@ +revision-life-noc: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revision-alliance-boreale: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revision-erplibre: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revision-semence-numerique: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revision-ortrux-1: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revision-district16: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/reseau-chezlepro.yaml b/data/inputs/reseau-chezlepro.yaml new file mode 100644 index 0000000..8147dec --- /dev/null +++ b/data/inputs/reseau-chezlepro.yaml @@ -0,0 +1,32 @@ +verification-firewalls: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-vpn-openvpn: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-switches: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-vlans-segmentation: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-dns: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-dynamic-dns: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +audit-regles-firewall: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-geoblocking: + value: '2026-02-14' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/resilience.yaml b/data/inputs/resilience.yaml new file mode 100644 index 0000000..10c286d --- /dev/null +++ b/data/inputs/resilience.yaml @@ -0,0 +1,16 @@ +test-generatrice-propane: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-procedure-bascule: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revision-plan-urgence: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +test-autonomie-base: + value: '2026-03-17' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/revue.yaml b/data/inputs/revue.yaml index b496f1c..27e3122 100644 --- a/data/inputs/revue.yaml +++ b/data/inputs/revue.yaml @@ -6,3 +6,11 @@ revue-hebdomadaire-priorites: value: '2026-03-14' captured_at: '2026-03-14T23:16:41Z' origin: manual +revue-mensuelle-systeme-vie: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revue-trimestrielle-orientation: + value: '2026-04-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/sante.yaml b/data/inputs/sante.yaml new file mode 100644 index 0000000..d7b1f8a --- /dev/null +++ b/data/inputs/sante.yaml @@ -0,0 +1,4 @@ +verification-dossier-sante: + value: '2026-03-17' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/securite-chezlepro.yaml b/data/inputs/securite-chezlepro.yaml new file mode 100644 index 0000000..16efb7d --- /dev/null +++ b/data/inputs/securite-chezlepro.yaml @@ -0,0 +1,20 @@ +verification-mises-a-jour-securite: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +audit-comptes-acces: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-ids-snort: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +revue-politiques-securite: + value: '2026-03-03' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-sauvegardes-configuration: + value: '2026-03-15' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/stock-alimentaire.yaml b/data/inputs/stock-alimentaire.yaml new file mode 100644 index 0000000..bf90480 --- /dev/null +++ b/data/inputs/stock-alimentaire.yaml @@ -0,0 +1,4 @@ +rotation-nourriture-seche: + value: '2026-03-01' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/data/inputs/voiture.yaml b/data/inputs/voiture.yaml new file mode 100644 index 0000000..866171c --- /dev/null +++ b/data/inputs/voiture.yaml @@ -0,0 +1,8 @@ +verification-balais-essuie-glace: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date +verification-eclairage: + value: '2026-01-31' + captured_at: '2026-03-16T00:00:00Z' + origin: seed_from_legacy_date diff --git a/docs/guides/admin-ui-optionnelle.md b/docs/guides/admin-ui-optionnelle.md new file mode 100644 index 0000000..b2aa6ce --- /dev/null +++ b/docs/guides/admin-ui-optionnelle.md @@ -0,0 +1,125 @@ +# Interface web d'administration optionnelle — Life-NOC + +## Objet + +Ce document décrit l'interface web d'administration optionnelle ajoutée au service FastAPI existant de Life-NOC. + +Elle permet de consulter et modifier `domains.yaml` depuis le web, en mode mobile-first, sans remplacer le flux opérationnel existant. + +## Principes retenus + +- `domains.yaml` demeure la **source de vérité opérationnelle** +- l'interface admin est **désactivée par défaut** +- si elle n'est pas activée, le comportement existant ne change pas +- l'API des intrants et les pages item continuent d'exister comme avant +- l'écriture vers `domains.yaml` est **atomique** +- une **copie de sauvegarde horodatée** de `domains.yaml` est produite avant chaque écriture + +## Activation + +Variable d'environnement utilisée par le service API : + +```text +LIFE_NOC_ADMIN_UI_ENABLED=1 +``` + +Côté Ansible, cette capacité est pilotée par : + +```yaml +life_noc_admin_ui_enabled: true +``` + +Par défaut : + +```yaml +life_noc_admin_ui_enabled: false +``` + +## Routes ajoutées + +### Accueil admin + +```text +GET /life-noc/admin +``` + +### Vue domaine + +```text +GET /life-noc/admin/domain/ +``` + +### Création d'item + +```text +GET /life-noc/admin/domain//new +POST /life-noc/admin/domain//new +``` + +### Fiche item admin + +```text +GET /life-noc/admin/item// +``` + +### Édition item + +```text +GET /life-noc/admin/item///edit +POST /life-noc/admin/item///edit +``` + +### Réorganisation + +```text +POST /life-noc/admin/domain///move +``` + +### Suppression + +```text +POST /life-noc/admin/item///delete +``` + +## Champs éditables en v1 + +L'éditeur couvre les champs suivants : + +- `name` +- `date` +- `title` +- `summary` +- `notes` +- `instructions` +- `notes_url` +- `instructions_url` +- `action_url` +- `probe.type` +- `probe.source.type` +- `probe.source.inputs_file` +- `probe.source.item_key` +- `metric.unit` +- `thresholds.*` +- `policy.on_error` +- `ui.form_mode` +- `ui.allow_complete` +- `ui.allow_manual_edit` + +## Limites volontaires de cette tranche + +- pas d'édition brute YAML +- pas de création de domaine +- pas d'import massif +- pas de validation métier avancée par type de sonde +- pas d'authentification applicative dédiée à ce stade + +## Intégration retenue + +L'interface admin est greffée au service FastAPI existant afin de : + +- éviter un second service inutile +- réutiliser le point de déploiement déjà validé +- conserver une seule surface HTTP locale + +L'interface admin ne devient pas le centre du système. +Elle n'est qu'une **surface d'édition facultative** du SSOT. diff --git a/domains.yaml b/domains.yaml index a42e463..48239a4 100644 --- a/domains.yaml +++ b/domains.yaml @@ -21,7 +21,7 @@ domains: - name: revue-hebdomadaire-priorites date: '2026-03-10' notes: Revoir les priorités de la semaine - instructions_url: "https://chezlepro.ca/life-noc/test-instructions" + instructions_url: https://chezlepro.ca/life-noc/test-instructions probe: type: elapsed_time source: @@ -40,51 +40,336 @@ domains: - name: revue-mensuelle-systeme-vie date: 2026-04-01 notes: Revue mensuelle de l'ensemble du système Life-NOC + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/revue.yaml + item_key: revue-mensuelle-systeme-vie + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revue-trimestrielle-orientation date: 2026-06-30 notes: Revue trimestrielle des orientations de vie et de Chezlepro + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/revue.yaml + item_key: revue-trimestrielle-orientation + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true focus: - name: entretien-processus-focus date: 2026-03-09 notes: Vérifier que les cartouches FOCUS sont à jour + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/focus.yaml + item_key: entretien-processus-focus + metric: + unit: days + thresholds: + unknown_lt: 5 + ok_gte: 5 + warning_gte: 7 + critical_gte: 10 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: nettoyage-inbox-mentale date: 2026-03-09 notes: Vider et clarifier les éléments capturés hors système + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/focus.yaml + item_key: nettoyage-inbox-mentale + metric: + unit: days + thresholds: + unknown_lt: 5 + ok_gte: 5 + warning_gte: 7 + critical_gte: 10 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revue-limitation-engagements date: 2026-03-31 notes: Vérifier que les engagements actifs demeurent réalistes + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/focus.yaml + item_key: revue-limitation-engagements + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true finances-personnelles: - name: revision-comptes-bancaires date: 2026-04-01 notes: Révision mensuelle des comptes bancaires personnels + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/finances-personnelles.yaml + item_key: revision-comptes-bancaires + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-cartes-credit date: 2026-04-01 notes: Vérification des soldes et transactions des cartes de crédit + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/finances-personnelles.yaml + item_key: verification-cartes-credit + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: paiement-cartes-credit date: 2026-04-15 notes: Paiement des cartes de crédit personnelles + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/finances-personnelles.yaml + item_key: paiement-cartes-credit + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revision-budget-personnel date: 2026-04-05 notes: Révision mensuelle du budget personnel + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/finances-personnelles.yaml + item_key: revision-budget-personnel + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-prelevements-automatiques date: 2026-04-03 notes: Vérification des prélèvements automatiques personnels + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/finances-personnelles.yaml + item_key: verification-prelevements-automatiques + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-placements date: 2026-06-30 notes: Vérification périodique des placements et comptes enregistrés + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/finances-personnelles.yaml + item_key: verification-placements + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-cotisations-reer date: 2026-02-28 notes: Vérification des cotisations REER + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/finances-personnelles.yaml + item_key: verification-cotisations-reer + metric: + unit: days + thresholds: + unknown_lt: 5 + ok_gte: 5 + warning_gte: 7 + critical_gte: 10 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-celi date: 2026-05-01 notes: Vérification de l'espace CELI et de son utilisation + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/finances-personnelles.yaml + item_key: verification-celi + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: preparation-dossier-financier-annuel date: 2026-01-31 notes: Préparer le dossier financier annuel personnel + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/finances-personnelles.yaml + item_key: preparation-dossier-financier-annuel + metric: + unit: days + thresholds: + unknown_lt: 300 + ok_gte: 300 + warning_gte: 365 + critical_gte: 395 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true fiscalite-personnelle: - name: preparation-documents-impots date: 2026-03-15 notes: Rassembler tous les documents fiscaux personnels + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/fiscalite-personnelle.yaml + item_key: preparation-documents-impots + metric: + unit: days + thresholds: + unknown_lt: 5 + ok_gte: 5 + warning_gte: 7 + critical_gte: 10 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: production-impots-federal date: 2026-04-30 notes: Produire la déclaration de revenus fédérale @@ -97,9 +382,47 @@ domains: - name: verification-avis-cotisation date: 2026-05-31 notes: Vérifier les avis de cotisation ARC et Revenu Québec + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/fiscalite-personnelle.yaml + item_key: verification-avis-cotisation + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: archivage-documents-fiscaux date: 2026-06-15 notes: Archiver les documents fiscaux personnels + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/fiscalite-personnelle.yaml + item_key: archivage-documents-fiscaux + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-acomptes-provisionnels date: 2026-03-15 notes: Vérifier si des acomptes provisionnels sont requis @@ -107,15 +430,91 @@ domains: - name: verification-testament date: 2026-07-01 notes: Vérifier la pertinence et l'actualité du testament + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/obligations-legales-personnelles.yaml + item_key: verification-testament + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-mandat-inaptitude date: 2026-07-01 notes: Vérifier le mandat de protection et documents connexes + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/obligations-legales-personnelles.yaml + item_key: verification-mandat-inaptitude + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-directives-medicales date: 2026-07-15 notes: Vérifier les directives médicales anticipées + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/obligations-legales-personnelles.yaml + item_key: verification-directives-medicales + metric: + unit: days + thresholds: + unknown_lt: 150 + ok_gte: 150 + warning_gte: 180 + critical_gte: 210 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-papiers-identite date: 2026-06-01 notes: Vérifier l'expiration des papiers d'identité + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/obligations-legales-personnelles.yaml + item_key: verification-papiers-identite + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: renouvellement-permis-conduire date: '2026-09-20' notes: Vérifier la proximité de l’échéance du permis @@ -144,48 +543,333 @@ domains: - name: remplacement-filtre-fournaise date: 2026-04-01 notes: Remplacer le filtre de la fournaise + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: remplacement-filtre-fournaise + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-fournaise date: 2026-09-15 notes: Inspection générale de la fournaise avant saison froide + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: inspection-fournaise + metric: + unit: days + thresholds: + unknown_lt: 150 + ok_gte: 150 + warning_gte: 180 + critical_gte: 210 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-thermopompe date: 2026-05-01 notes: Inspection et entretien de la thermopompe + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: inspection-thermopompe + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: nettoyage-unites-exterieures date: 2026-05-15 notes: Nettoyer les unités extérieures et vérifier le dégagement + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: nettoyage-unites-exterieures + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-toiture date: 2026-10-01 notes: Inspection annuelle de la toiture + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: inspection-toiture + metric: + unit: days + thresholds: + unknown_lt: 150 + ok_gte: 150 + warning_gte: 180 + critical_gte: 210 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-gouttieres date: 2026-11-01 notes: Inspection et nettoyage des gouttières + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: inspection-gouttieres + metric: + unit: days + thresholds: + unknown_lt: 150 + ok_gte: 150 + warning_gte: 180 + critical_gte: 210 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-fondation date: 2026-06-01 notes: Inspection de la fondation et des fissures + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: inspection-fondation + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-drainage-terrain date: 2026-05-15 notes: Vérification du drainage autour de la maison + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: verification-drainage-terrain + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: test-detecteurs-fumee date: 2026-04-01 notes: Test des détecteurs de fumée + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: test-detecteurs-fumee + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: test-detecteurs-co date: 2026-04-01 notes: Test des détecteurs de monoxyde de carbone + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: test-detecteurs-co + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: remplacement-piles-detecteurs date: 2026-10-01 notes: Remplacement préventif des piles des détecteurs + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: remplacement-piles-detecteurs + metric: + unit: days + thresholds: + unknown_lt: 150 + ok_gte: 150 + warning_gte: 180 + critical_gte: 210 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-plomberie-visible date: 2026-05-01 notes: Vérification visuelle de la plomberie accessible + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: verification-plomberie-visible + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-sump-pump date: 2026-04-15 notes: Vérification de la pompe de puisard si applicable + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: inspection-sump-pump + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-calfetrage date: 2026-10-15 notes: Vérification du calfeutrage portes et fenêtres + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: verification-calfetrage + metric: + unit: days + thresholds: + unknown_lt: 150 + ok_gte: 150 + warning_gte: 180 + critical_gte: 210 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-portes-garage date: 2026-05-15 notes: Vérification mécanique et sécurité des portes de garage + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/maison.yaml + item_key: inspection-portes-garage + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-extincteurs date: 2026-06-01 notes: Vérification des extincteurs @@ -193,22 +877,136 @@ domains: - name: inspection-rangement-plafond date: 2026-05-01 notes: Vérification des supports suspendus au plafond du garage + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/garage-et-rangement.yaml + item_key: inspection-rangement-plafond + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revue-inventaire-garage date: 2026-04-15 notes: Revue de l'inventaire et de l'ordre du garage + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/garage-et-rangement.yaml + item_key: revue-inventaire-garage + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-rouille-outillage date: 2026-05-15 notes: Vérification de la corrosion sur les outils et équipements + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/garage-et-rangement.yaml + item_key: verification-rouille-outillage + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-securite-garage date: 2026-06-01 notes: Vérification des conditions de sécurité du garage + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/garage-et-rangement.yaml + item_key: inspection-securite-garage + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: rotation-stockage-bacs date: 2026-05-15 notes: Revue des contenus de bacs de rangement + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/garage-et-rangement.yaml + item_key: rotation-stockage-bacs + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true energie: - name: inspection-batteries-lifepo4 date: 2026-04-01 notes: Inspection physique et logique des batteries LiFePO4 + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/energie.yaml + item_key: inspection-batteries-lifepo4 + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-tension-batteries date: 2026-03-15 notes: Vérification des tensions et cohérence des batteries @@ -221,34 +1019,205 @@ domains: - name: verification-can-rs485 date: 2026-04-15 notes: Vérification des communications CAN ou RS485 + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/energie.yaml + item_key: verification-can-rs485 + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-cablage-energie date: 2026-05-01 notes: Inspection du câblage et des connexions énergétiques + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/energie.yaml + item_key: inspection-cablage-energie + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-busbars date: 2026-05-01 notes: Vérification du serrage, corrosion et échauffement des busbars + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/energie.yaml + item_key: verification-busbars + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-parametres-charge date: 2026-04-01 notes: Vérification des paramètres de charge et float + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/energie.yaml + item_key: verification-parametres-charge + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: test-charge-batteries date: 2026-04-15 notes: Test de comportement en charge des batteries + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/energie.yaml + item_key: test-charge-batteries + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: test-comportement-onduleur date: 2026-05-01 notes: Vérifier le comportement du Multiplus sous charge légère + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/energie.yaml + item_key: test-comportement-onduleur + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-journal-evenements-victron date: 2026-04-15 notes: Vérification des événements et anomalies Victron + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/energie.yaml + item_key: verification-journal-evenements-victron + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true resilience: - name: test-generatrice-propane date: 2026-04-01 notes: Test mensuel de la génératrice au propane + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/resilience.yaml + item_key: test-generatrice-propane + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-carburant-generatrice date: 2026-04-01 notes: Vérification de l'approvisionnement propane lié à la génératrice - name: verification-procedure-bascule date: 2026-04-15 notes: Réviser la procédure de bascule en mode secours + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/resilience.yaml + item_key: verification-procedure-bascule + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-stock-lampes-piles date: 2026-05-01 notes: Vérification des lampes, piles et éclairage d'urgence @@ -258,9 +1227,47 @@ domains: - name: revision-plan-urgence date: 2026-06-01 notes: Réviser le plan d'urgence domestique + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/resilience.yaml + item_key: revision-plan-urgence + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: test-autonomie-base date: 2026-06-15 notes: Vérifier l'autonomie énergétique minimale attendue + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/resilience.yaml + item_key: test-autonomie-base + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-moyens-cuisson-secours date: 2026-05-15 notes: Vérification des moyens de cuisson de secours @@ -268,6 +1275,25 @@ domains: - name: rotation-nourriture-seche date: 2026-04-01 notes: Rotation des stocks de nourriture sèche + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/stock-alimentaire.yaml + item_key: rotation-nourriture-seche + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-reserve-eau date: 2026-04-15 notes: Vérification de la réserve d'eau potable @@ -302,6 +1328,25 @@ domains: - name: verification-dossier-sante date: 2026-06-15 notes: Vérifier l'ordre et l'accessibilité des documents de santé + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/sante.yaml + item_key: verification-dossier-sante + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true voiture: - name: verification-huile-moteur date: 2026-04-01 @@ -324,12 +1369,50 @@ domains: - name: verification-balais-essuie-glace date: 2026-05-01 notes: Vérification des essuie-glaces + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/voiture.yaml + item_key: verification-balais-essuie-glace + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-liquides date: 2026-04-15 notes: Vérification des liquides de la voiture - name: verification-eclairage date: 2026-05-01 notes: Vérification de l'éclairage et des phares + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/voiture.yaml + item_key: verification-eclairage + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-immatriculation-assurance date: 2026-06-01 notes: Vérification papiers d'assurance et immatriculation @@ -337,27 +1420,179 @@ domains: - name: inspection-vignes date: 2026-04-15 notes: Inspection et entretien des vignes + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/jardin.yaml + item_key: inspection-vignes + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: entretien-bleuetiers date: 2026-05-01 notes: Entretien des bleuetiers + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/jardin.yaml + item_key: entretien-bleuetiers + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: entretien-framboisiers date: 2026-06-01 notes: Entretien des framboisiers + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/jardin.yaml + item_key: entretien-framboisiers + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-kiwis-nordiques date: 2026-05-15 notes: Vérification des kiwis nordiques + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/jardin.yaml + item_key: inspection-kiwis-nordiques + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: entretien-rhubarbe date: 2026-05-15 notes: Entretien de la rhubarbe + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/jardin.yaml + item_key: entretien-rhubarbe + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-groseillier date: 2026-05-15 notes: Inspection du groseillier + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/jardin.yaml + item_key: inspection-groseillier + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-muriers date: 2026-05-15 notes: Inspection des mûriers + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/jardin.yaml + item_key: inspection-muriers + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: entretien-houblon date: 2026-06-01 notes: Vérification et entretien du houblon + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/jardin.yaml + item_key: entretien-houblon + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revision-pharmacopée-jardin date: 2026-05-01 notes: Vérification du stock de soins pour végétaux @@ -368,47 +1603,294 @@ domains: - name: entretien-outils-jardin date: 2026-04-15 notes: Nettoyage et entretien des outils de jardin + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/outils-et-equipements.yaml + item_key: entretien-outils-jardin + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: inspection-outils-electriques date: 2026-05-01 notes: Vérification des outils électriques + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/outils-et-equipements.yaml + item_key: inspection-outils-electriques + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-rallonges-et-connecteurs date: 2026-05-01 notes: Vérification des rallonges et connecteurs + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/outils-et-equipements.yaml + item_key: verification-rallonges-et-connecteurs + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-compresseur-et-accessoires date: 2026-05-15 notes: Vérification du compresseur et accessoires + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/outils-et-equipements.yaml + item_key: verification-compresseur-et-accessoires + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revision-inventaire-outillage date: 2026-06-01 notes: Revue de l'inventaire d'outillage + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/outils-et-equipements.yaml + item_key: revision-inventaire-outillage + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true informatique-personnelle: - name: verification-sauvegardes-personnelles date: 2026-04-01 notes: Vérification des sauvegardes personnelles + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/informatique-personnelle.yaml + item_key: verification-sauvegardes-personnelles + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: nettoyage-stockage-personnel date: 2026-04-15 notes: Nettoyage du stockage numérique personnel + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/informatique-personnelle.yaml + item_key: nettoyage-stockage-personnel + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-comptes-importants date: 2026-05-01 notes: Vérification des comptes numériques personnels importants + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/informatique-personnelle.yaml + item_key: verification-comptes-importants + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revue-mots-de-passe-personnels date: 2026-06-01 notes: Revue des mots de passe personnels critiques + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/informatique-personnelle.yaml + item_key: revue-mots-de-passe-personnels + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-documents-cloud-personnels date: 2026-05-15 notes: Vérifier la cohérence des documents personnels sauvegardés + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/informatique-personnelle.yaml + item_key: verification-documents-cloud-personnels + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true infrastructure-chezlepro: - name: verification-proxmox date: 2026-04-01 notes: Vérification générale de l'environnement Proxmox + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/infrastructure-chezlepro.yaml + item_key: verification-proxmox + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-ceph date: 2026-04-01 notes: Vérification générale de l'état Ceph - name: test-restauration-backups date: 2026-04-15 notes: Test de restauration des sauvegardes + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/infrastructure-chezlepro.yaml + item_key: test-restauration-backups + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-pbs-truenas date: 2026-05-01 notes: Vérification des solutions de sauvegarde et synchronisation + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/infrastructure-chezlepro.yaml + item_key: verification-pbs-truenas + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-ups-infrastructure date: 2026-04-15 notes: Vérification des UPS de l'infrastructure @@ -418,52 +1900,337 @@ domains: - name: verification-apt-cacher-ng date: 2026-05-01 notes: Vérification du bon fonctionnement d'apt-cacher-ng + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/infrastructure-chezlepro.yaml + item_key: verification-apt-cacher-ng + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-icinga2 date: 2026-04-01 notes: Vérification de la supervision Icinga2 + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/infrastructure-chezlepro.yaml + item_key: verification-icinga2 + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-keycloak-openldap date: 2026-05-01 notes: Vérification de l'identité et de l'authentification centralisées + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/infrastructure-chezlepro.yaml + item_key: verification-keycloak-openldap + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-nextcloud date: 2026-04-15 notes: Vérification de l'état Nextcloud + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/infrastructure-chezlepro.yaml + item_key: verification-nextcloud + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-mailcow date: 2026-05-01 notes: Vérification de l'infrastructure Mailcow + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/infrastructure-chezlepro.yaml + item_key: verification-mailcow + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-openvas date: 2026-05-15 notes: Vérification de la plateforme OpenVAS + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/infrastructure-chezlepro.yaml + item_key: verification-openvas + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-journaux-systemes date: 2026-04-15 notes: Revue des journaux systèmes critiques + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/infrastructure-chezlepro.yaml + item_key: verification-journaux-systemes + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true reseau-chezlepro: - name: verification-firewalls date: 2026-04-01 notes: Vérification des firewalls + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/reseau-chezlepro.yaml + item_key: verification-firewalls + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-vpn-openvpn date: 2026-04-15 notes: Vérification des tunnels OpenVPN + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/reseau-chezlepro.yaml + item_key: verification-vpn-openvpn + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-crl-certificats date: 2026-04-15 notes: Vérification de la CRL et des certificats - name: verification-switches date: 2026-05-01 notes: Vérification des switches et uplinks + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/reseau-chezlepro.yaml + item_key: verification-switches + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-vlans-segmentation date: 2026-05-01 notes: Vérification de la segmentation réseau + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/reseau-chezlepro.yaml + item_key: verification-vlans-segmentation + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-dns date: 2026-05-15 notes: Vérification DNS interne et externe + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/reseau-chezlepro.yaml + item_key: verification-dns + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-dynamic-dns date: 2026-05-15 notes: Vérification du DNS dynamique si utilisé + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/reseau-chezlepro.yaml + item_key: verification-dynamic-dns + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: audit-regles-firewall date: 2026-06-01 notes: Audit périodique des règles de firewall + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/reseau-chezlepro.yaml + item_key: audit-regles-firewall + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-geoblocking date: 2026-05-15 notes: Vérifier le geoblocking et son effet attendu + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/reseau-chezlepro.yaml + item_key: verification-geoblocking + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-certificats-publics date: 2026-06-01 notes: Vérifier les expirations de certificats publics @@ -471,40 +2238,249 @@ domains: - name: verification-mises-a-jour-securite date: 2026-04-01 notes: Vérification des mises à jour de sécurité + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/securite-chezlepro.yaml + item_key: verification-mises-a-jour-securite + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: audit-comptes-acces date: 2026-05-01 notes: Audit des comptes et accès privilégiés + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/securite-chezlepro.yaml + item_key: audit-comptes-acces + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-ids-snort date: 2026-05-01 notes: Vérification des IDS et de leur état + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/securite-chezlepro.yaml + item_key: verification-ids-snort + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revue-pki-privee date: 2026-05-15 notes: Revue de la PKI privée et des autorités intermédiaires - name: revue-politiques-securite date: 2026-06-01 notes: Revue des politiques et pratiques de sécurité numérique + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/securite-chezlepro.yaml + item_key: revue-politiques-securite + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-sauvegardes-configuration date: 2026-04-15 notes: Vérifier les sauvegardes des configurations critiques + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/securite-chezlepro.yaml + item_key: verification-sauvegardes-configuration + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true exploitation-chezlepro: - name: revision-playbooks-ansible date: 2026-05-01 notes: Revue des playbooks Ansible + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/exploitation-chezlepro.yaml + item_key: revision-playbooks-ansible + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-inventaires-ansible date: 2026-05-01 notes: Vérification des inventaires Ansible + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/exploitation-chezlepro.yaml + item_key: verification-inventaires-ansible + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revision-documentation-technique date: 2026-05-15 notes: Revue de la documentation technique Chezlepro + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/exploitation-chezlepro.yaml + item_key: revision-documentation-technique + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-procedures-reprise date: 2026-06-01 notes: Vérifier les procédures de reprise et restauration + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/exploitation-chezlepro.yaml + item_key: verification-procedures-reprise + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revue-capacite-ressources date: 2026-06-15 notes: Revue CPU RAM stockage et charge de l'infrastructure + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/exploitation-chezlepro.yaml + item_key: revue-capacite-ressources + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-jobs-automatises date: 2026-05-15 notes: Vérification des jobs automatisés et scripts périodiques + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/exploitation-chezlepro.yaml + item_key: verification-jobs-automatises + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true obligations-chezlepro: - name: verification-registraire-entreprise date: 2026-06-15 @@ -515,12 +2491,69 @@ domains: - name: verification-dossier-comptable-entreprise date: 2026-04-15 notes: Vérifier l'ordre du dossier comptable Chezlepro + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/obligations-chezlepro.yaml + item_key: verification-dossier-comptable-entreprise + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-facturation-clients date: 2026-04-10 notes: Vérifier la facturation et son suivi + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/obligations-chezlepro.yaml + item_key: verification-facturation-clients + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-paiements-fournisseurs date: 2026-04-10 notes: Vérifier les paiements fournisseurs + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/obligations-chezlepro.yaml + item_key: verification-paiements-fournisseurs + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-contrats-ententes date: 2026-05-15 notes: Vérifier contrats, ententes et obligations associées @@ -530,70 +2563,431 @@ domains: - name: archivage-documents-entreprise date: 2026-05-31 notes: Archiver les documents administratifs et financiers de l'entreprise + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/obligations-chezlepro.yaml + item_key: archivage-documents-entreprise + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true actifs-chezlepro: - name: revision-inventaire-materiel date: 2026-05-01 notes: Revoir l'inventaire du matériel de Chezlepro + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/actifs-chezlepro.yaml + item_key: revision-inventaire-materiel + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-amortissables date: 2026-06-01 notes: Vérifier le registre des biens amortissables - name: verification-serveurs-et-composants date: 2026-05-15 notes: Vérifier l'état des serveurs et composants matériels + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/actifs-chezlepro.yaml + item_key: verification-serveurs-et-composants + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-reserve-pieces date: 2026-06-01 notes: Vérifier les pièces de rechange critiques - name: revision-actifs-transferts date: 2026-06-15 notes: Réviser les actifs transférés ou à transférer à l'entreprise + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/actifs-chezlepro.yaml + item_key: revision-actifs-transferts + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true projets: - name: revision-life-noc date: 2026-04-01 notes: Révision du projet Life-NOC + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/projets.yaml + item_key: revision-life-noc + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revision-alliance-boreale date: 2026-04-15 notes: Révision du projet Alliance Boréale + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/projets.yaml + item_key: revision-alliance-boreale + metric: + unit: days + thresholds: + unknown_lt: 20 + ok_gte: 20 + warning_gte: 31 + critical_gte: 45 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revision-erplibre date: 2026-05-01 notes: Révision du projet ERPLibre + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/projets.yaml + item_key: revision-erplibre + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revision-semence-numerique date: 2026-05-15 notes: Révision du projet semence numérique + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/projets.yaml + item_key: revision-semence-numerique + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revision-ortrux-1 date: 2026-05-15 notes: Révision du système Ortrux-1 + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/projets.yaml + item_key: revision-ortrux-1 + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revision-district16 date: 2026-05-01 notes: Révision du projet DISTRICT16 + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/projets.yaml + item_key: revision-district16 + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true communaute: - name: verification-outils-aa date: 2026-05-01 notes: Vérifier les outils numériques liés aux activités communautaires + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/communaute.yaml + item_key: verification-outils-aa + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-espace-87-16 date: 2026-05-01 notes: Vérifier l'espace Nextcloud du district + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/communaute.yaml + item_key: verification-espace-87-16 + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-salles-visio-groupes date: 2026-05-15 notes: Vérifier les salles de visioconférence des groupes + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/communaute.yaml + item_key: verification-salles-visio-groupes + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-depots-rapports-rsg date: 2026-05-15 notes: Vérifier les dépôts de rapports RSG + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/communaute.yaml + item_key: verification-depots-rapports-rsg + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revision-outils-communication-communaute date: 2026-06-01 notes: Réviser les moyens de communication communautaires + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/communaute.yaml + item_key: revision-outils-communication-communaute + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true documentation: - name: revue-docs-personnelles-importantes date: 2026-05-15 notes: Revoir l'organisation des documents personnels importants + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/documentation.yaml + item_key: revue-docs-personnelles-importantes + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revue-wiki-technique date: 2026-05-15 notes: Revoir le wiki technique et sa cohérence + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/documentation.yaml + item_key: revue-wiki-technique + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: revue-base-connaissances date: 2026-06-01 notes: Revoir la base de connaissances globale + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/documentation.yaml + item_key: revue-base-connaissances + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true - name: verification-sauvegarde-docs-cles date: 2026-05-15 notes: Vérifier la sauvegarde des documents clés + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/documentation.yaml + item_key: verification-sauvegarde-docs-cles + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true animaux: - name: verification-stock-nourriture-chats date: 2026-04-15 @@ -604,3 +2998,22 @@ domains: - name: revision-routine-soins-animaux date: 2026-05-01 notes: Revue de la routine de soins et des besoins matériels des chats + probe: + type: elapsed_time + source: + type: manual_date + inputs_file: /opt/life-noc/data/inputs/animaux.yaml + item_key: revision-routine-soins-animaux + metric: + unit: days + thresholds: + unknown_lt: 60 + ok_gte: 60 + warning_gte: 90 + critical_gte: 120 + policy: + on_error: critical + ui: + form_mode: complete_date + allow_complete: true + allow_manual_edit: true diff --git a/icinga/services/actifs-chezlepro.conf b/icinga/services/actifs-chezlepro.conf index dd8a163..4b4a46a 100644 --- a/icinga/services/actifs-chezlepro.conf +++ b/icinga/services/actifs-chezlepro.conf @@ -5,13 +5,22 @@ */ apply Service "actifs-chezlepro-revision-inventaire-materiel" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/actifs-chezlepro.yaml" + vars.life_noc_item_key = "revision-inventaire-materiel" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-inventaire-materiel" groups = [ "ACTIFS-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revoir l'inventaire du matériel de Chezlepro" - vars.instructions_url = "/life-noc/item/actifs-chezlepro/revision-inventaire-materiel" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/actifs-chezlepro/revision-inventaire-materiel" assign where host.name == "life-noc" } @@ -22,18 +31,27 @@ apply Service "actifs-chezlepro-verification-amortissables" { vars.mock_message = "Sous contrôle" groups = [ "ACTIFS-CHEZLEPRO" ] notes = "Vérifier le registre des biens amortissables" - vars.instructions_url = "/life-noc/item/actifs-chezlepro/verification-amortissables" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/actifs-chezlepro/verification-amortissables" assign where host.name == "life-noc" } apply Service "actifs-chezlepro-verification-serveurs-et-composants" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/actifs-chezlepro.yaml" + vars.life_noc_item_key = "verification-serveurs-et-composants" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-serveurs-et-composants" groups = [ "ACTIFS-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier l'état des serveurs et composants matériels" - vars.instructions_url = "/life-noc/item/actifs-chezlepro/verification-serveurs-et-composants" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/actifs-chezlepro/verification-serveurs-et-composants" assign where host.name == "life-noc" } @@ -44,17 +62,26 @@ apply Service "actifs-chezlepro-verification-reserve-pieces" { vars.mock_message = "Sous contrôle" groups = [ "ACTIFS-CHEZLEPRO" ] notes = "Vérifier les pièces de rechange critiques" - vars.instructions_url = "/life-noc/item/actifs-chezlepro/verification-reserve-pieces" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/actifs-chezlepro/verification-reserve-pieces" assign where host.name == "life-noc" } apply Service "actifs-chezlepro-revision-actifs-transferts" { - import "service_echeance" - vars.date_echeance = "2026-06-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/actifs-chezlepro.yaml" + vars.life_noc_item_key = "revision-actifs-transferts" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-actifs-transferts" groups = [ "ACTIFS-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Réviser les actifs transférés ou à transférer à l'entreprise" - vars.instructions_url = "/life-noc/item/actifs-chezlepro/revision-actifs-transferts" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/actifs-chezlepro/revision-actifs-transferts" assign where host.name == "life-noc" } diff --git a/icinga/services/animaux.conf b/icinga/services/animaux.conf index 90482e0..41da7b4 100644 --- a/icinga/services/animaux.conf +++ b/icinga/services/animaux.conf @@ -11,7 +11,7 @@ apply Service "animaux-verification-stock-nourriture-chats" { vars.mock_message = "Sous contrôle" groups = [ "ANIMAUX" ] notes = "Vérification du stock de nourriture pour chats" - vars.instructions_url = "/life-noc/item/animaux/verification-stock-nourriture-chats" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/animaux/verification-stock-nourriture-chats" assign where host.name == "life-noc" } @@ -22,17 +22,26 @@ apply Service "animaux-verification-friandises-et-litiere" { vars.mock_message = "Sous contrôle" groups = [ "ANIMAUX" ] notes = "Vérification des stocks de friandises et de litière" - vars.instructions_url = "/life-noc/item/animaux/verification-friandises-et-litiere" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/animaux/verification-friandises-et-litiere" assign where host.name == "life-noc" } apply Service "animaux-revision-routine-soins-animaux" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/animaux.yaml" + vars.life_noc_item_key = "revision-routine-soins-animaux" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-routine-soins-animaux" groups = [ "ANIMAUX" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revue de la routine de soins et des besoins matériels des chats" - vars.instructions_url = "/life-noc/item/animaux/revision-routine-soins-animaux" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/animaux/revision-routine-soins-animaux" assign where host.name == "life-noc" } diff --git a/icinga/services/communaute.conf b/icinga/services/communaute.conf index 19171cc..23521d8 100644 --- a/icinga/services/communaute.conf +++ b/icinga/services/communaute.conf @@ -5,56 +5,101 @@ */ apply Service "communaute-verification-outils-aa" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/communaute.yaml" + vars.life_noc_item_key = "verification-outils-aa" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-outils-aa" groups = [ "COMMUNAUTE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier les outils numériques liés aux activités communautaires" - vars.instructions_url = "/life-noc/item/communaute/verification-outils-aa" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/communaute/verification-outils-aa" assign where host.name == "life-noc" } apply Service "communaute-verification-espace-87-16" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/communaute.yaml" + vars.life_noc_item_key = "verification-espace-87-16" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-espace-87-16" groups = [ "COMMUNAUTE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier l'espace Nextcloud du district" - vars.instructions_url = "/life-noc/item/communaute/verification-espace-87-16" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/communaute/verification-espace-87-16" assign where host.name == "life-noc" } apply Service "communaute-verification-salles-visio-groupes" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/communaute.yaml" + vars.life_noc_item_key = "verification-salles-visio-groupes" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-salles-visio-groupes" groups = [ "COMMUNAUTE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier les salles de visioconférence des groupes" - vars.instructions_url = "/life-noc/item/communaute/verification-salles-visio-groupes" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/communaute/verification-salles-visio-groupes" assign where host.name == "life-noc" } apply Service "communaute-verification-depots-rapports-rsg" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/communaute.yaml" + vars.life_noc_item_key = "verification-depots-rapports-rsg" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-depots-rapports-rsg" groups = [ "COMMUNAUTE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier les dépôts de rapports RSG" - vars.instructions_url = "/life-noc/item/communaute/verification-depots-rapports-rsg" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/communaute/verification-depots-rapports-rsg" assign where host.name == "life-noc" } apply Service "communaute-revision-outils-communication-communaute" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/communaute.yaml" + vars.life_noc_item_key = "revision-outils-communication-communaute" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-outils-communication-communaute" groups = [ "COMMUNAUTE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Réviser les moyens de communication communautaires" - vars.instructions_url = "/life-noc/item/communaute/revision-outils-communication-communaute" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/communaute/revision-outils-communication-communaute" assign where host.name == "life-noc" } diff --git a/icinga/services/documentation.conf b/icinga/services/documentation.conf index 4e16ff6..845ae54 100644 --- a/icinga/services/documentation.conf +++ b/icinga/services/documentation.conf @@ -5,45 +5,81 @@ */ apply Service "documentation-revue-docs-personnelles-importantes" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/documentation.yaml" + vars.life_noc_item_key = "revue-docs-personnelles-importantes" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revue-docs-personnelles-importantes" groups = [ "DOCUMENTATION" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revoir l'organisation des documents personnels importants" - vars.instructions_url = "/life-noc/item/documentation/revue-docs-personnelles-importantes" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/documentation/revue-docs-personnelles-importantes" assign where host.name == "life-noc" } apply Service "documentation-revue-wiki-technique" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/documentation.yaml" + vars.life_noc_item_key = "revue-wiki-technique" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revue-wiki-technique" groups = [ "DOCUMENTATION" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revoir le wiki technique et sa cohérence" - vars.instructions_url = "/life-noc/item/documentation/revue-wiki-technique" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/documentation/revue-wiki-technique" assign where host.name == "life-noc" } apply Service "documentation-revue-base-connaissances" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/documentation.yaml" + vars.life_noc_item_key = "revue-base-connaissances" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revue-base-connaissances" groups = [ "DOCUMENTATION" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revoir la base de connaissances globale" - vars.instructions_url = "/life-noc/item/documentation/revue-base-connaissances" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/documentation/revue-base-connaissances" assign where host.name == "life-noc" } apply Service "documentation-verification-sauvegarde-docs-cles" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/documentation.yaml" + vars.life_noc_item_key = "verification-sauvegarde-docs-cles" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-sauvegarde-docs-cles" groups = [ "DOCUMENTATION" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier la sauvegarde des documents clés" - vars.instructions_url = "/life-noc/item/documentation/verification-sauvegarde-docs-cles" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/documentation/verification-sauvegarde-docs-cles" assign where host.name == "life-noc" } diff --git a/icinga/services/energie.conf b/icinga/services/energie.conf index 8a9d777..67a5832 100644 --- a/icinga/services/energie.conf +++ b/icinga/services/energie.conf @@ -5,13 +5,22 @@ */ apply Service "energie-inspection-batteries-lifepo4" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/energie.yaml" + vars.life_noc_item_key = "inspection-batteries-lifepo4" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-batteries-lifepo4" groups = [ "ENERGIE" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Inspection physique et logique des batteries LiFePO4" - vars.instructions_url = "/life-noc/item/energie/inspection-batteries-lifepo4" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/energie/inspection-batteries-lifepo4" assign where host.name == "life-noc" } @@ -22,7 +31,7 @@ apply Service "energie-verification-tension-batteries" { vars.mock_message = "Sous contrôle" groups = [ "ENERGIE" ] notes = "Vérification des tensions et cohérence des batteries" - vars.instructions_url = "/life-noc/item/energie/verification-tension-batteries" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/energie/verification-tension-batteries" assign where host.name == "life-noc" } @@ -33,7 +42,7 @@ apply Service "energie-verification-smartshunt" { vars.mock_message = "Sous contrôle" groups = [ "ENERGIE" ] notes = "Vérification SmartShunt et cohérence du monitoring" - vars.instructions_url = "/life-noc/item/energie/verification-smartshunt" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/energie/verification-smartshunt" assign where host.name == "life-noc" } @@ -44,83 +53,146 @@ apply Service "energie-verification-cerbo-gx" { vars.mock_message = "Sous contrôle" groups = [ "ENERGIE" ] notes = "Vérification Cerbo GX et remontée des données" - vars.instructions_url = "/life-noc/item/energie/verification-cerbo-gx" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/energie/verification-cerbo-gx" assign where host.name == "life-noc" } apply Service "energie-verification-can-rs485" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/energie.yaml" + vars.life_noc_item_key = "verification-can-rs485" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-can-rs485" groups = [ "ENERGIE" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification des communications CAN ou RS485" - vars.instructions_url = "/life-noc/item/energie/verification-can-rs485" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/energie/verification-can-rs485" assign where host.name == "life-noc" } apply Service "energie-inspection-cablage-energie" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/energie.yaml" + vars.life_noc_item_key = "inspection-cablage-energie" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-cablage-energie" groups = [ "ENERGIE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Inspection du câblage et des connexions énergétiques" - vars.instructions_url = "/life-noc/item/energie/inspection-cablage-energie" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/energie/inspection-cablage-energie" assign where host.name == "life-noc" } apply Service "energie-verification-busbars" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/energie.yaml" + vars.life_noc_item_key = "verification-busbars" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-busbars" groups = [ "ENERGIE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification du serrage, corrosion et échauffement des busbars" - vars.instructions_url = "/life-noc/item/energie/verification-busbars" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/energie/verification-busbars" assign where host.name == "life-noc" } apply Service "energie-verification-parametres-charge" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/energie.yaml" + vars.life_noc_item_key = "verification-parametres-charge" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-parametres-charge" groups = [ "ENERGIE" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification des paramètres de charge et float" - vars.instructions_url = "/life-noc/item/energie/verification-parametres-charge" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/energie/verification-parametres-charge" assign where host.name == "life-noc" } apply Service "energie-test-charge-batteries" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/energie.yaml" + vars.life_noc_item_key = "test-charge-batteries" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "test-charge-batteries" groups = [ "ENERGIE" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Test de comportement en charge des batteries" - vars.instructions_url = "/life-noc/item/energie/test-charge-batteries" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/energie/test-charge-batteries" assign where host.name == "life-noc" } apply Service "energie-test-comportement-onduleur" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/energie.yaml" + vars.life_noc_item_key = "test-comportement-onduleur" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "test-comportement-onduleur" groups = [ "ENERGIE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier le comportement du Multiplus sous charge légère" - vars.instructions_url = "/life-noc/item/energie/test-comportement-onduleur" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/energie/test-comportement-onduleur" assign where host.name == "life-noc" } apply Service "energie-verification-journal-evenements-victron" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/energie.yaml" + vars.life_noc_item_key = "verification-journal-evenements-victron" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-journal-evenements-victron" groups = [ "ENERGIE" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification des événements et anomalies Victron" - vars.instructions_url = "/life-noc/item/energie/verification-journal-evenements-victron" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/energie/verification-journal-evenements-victron" assign where host.name == "life-noc" } diff --git a/icinga/services/exploitation-chezlepro.conf b/icinga/services/exploitation-chezlepro.conf index aedb773..c635018 100644 --- a/icinga/services/exploitation-chezlepro.conf +++ b/icinga/services/exploitation-chezlepro.conf @@ -5,67 +5,121 @@ */ apply Service "exploitation-chezlepro-revision-playbooks-ansible" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/exploitation-chezlepro.yaml" + vars.life_noc_item_key = "revision-playbooks-ansible" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-playbooks-ansible" groups = [ "EXPLOITATION-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revue des playbooks Ansible" - vars.instructions_url = "/life-noc/item/exploitation-chezlepro/revision-playbooks-ansible" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/exploitation-chezlepro/revision-playbooks-ansible" assign where host.name == "life-noc" } apply Service "exploitation-chezlepro-verification-inventaires-ansible" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/exploitation-chezlepro.yaml" + vars.life_noc_item_key = "verification-inventaires-ansible" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-inventaires-ansible" groups = [ "EXPLOITATION-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des inventaires Ansible" - vars.instructions_url = "/life-noc/item/exploitation-chezlepro/verification-inventaires-ansible" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/exploitation-chezlepro/verification-inventaires-ansible" assign where host.name == "life-noc" } apply Service "exploitation-chezlepro-revision-documentation-technique" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/exploitation-chezlepro.yaml" + vars.life_noc_item_key = "revision-documentation-technique" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-documentation-technique" groups = [ "EXPLOITATION-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revue de la documentation technique Chezlepro" - vars.instructions_url = "/life-noc/item/exploitation-chezlepro/revision-documentation-technique" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/exploitation-chezlepro/revision-documentation-technique" assign where host.name == "life-noc" } apply Service "exploitation-chezlepro-verification-procedures-reprise" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/exploitation-chezlepro.yaml" + vars.life_noc_item_key = "verification-procedures-reprise" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-procedures-reprise" groups = [ "EXPLOITATION-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier les procédures de reprise et restauration" - vars.instructions_url = "/life-noc/item/exploitation-chezlepro/verification-procedures-reprise" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/exploitation-chezlepro/verification-procedures-reprise" assign where host.name == "life-noc" } apply Service "exploitation-chezlepro-revue-capacite-ressources" { - import "service_echeance" - vars.date_echeance = "2026-06-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/exploitation-chezlepro.yaml" + vars.life_noc_item_key = "revue-capacite-ressources" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revue-capacite-ressources" groups = [ "EXPLOITATION-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revue CPU RAM stockage et charge de l'infrastructure" - vars.instructions_url = "/life-noc/item/exploitation-chezlepro/revue-capacite-ressources" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/exploitation-chezlepro/revue-capacite-ressources" assign where host.name == "life-noc" } apply Service "exploitation-chezlepro-verification-jobs-automatises" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/exploitation-chezlepro.yaml" + vars.life_noc_item_key = "verification-jobs-automatises" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-jobs-automatises" groups = [ "EXPLOITATION-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des jobs automatisés et scripts périodiques" - vars.instructions_url = "/life-noc/item/exploitation-chezlepro/verification-jobs-automatises" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/exploitation-chezlepro/verification-jobs-automatises" assign where host.name == "life-noc" } diff --git a/icinga/services/finances-personnelles.conf b/icinga/services/finances-personnelles.conf index 138ad58..29fea8c 100644 --- a/icinga/services/finances-personnelles.conf +++ b/icinga/services/finances-personnelles.conf @@ -5,100 +5,181 @@ */ apply Service "finances-personnelles-revision-comptes-bancaires" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/finances-personnelles.yaml" + vars.life_noc_item_key = "revision-comptes-bancaires" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-comptes-bancaires" groups = [ "FINANCES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Révision mensuelle des comptes bancaires personnels" - vars.instructions_url = "/life-noc/item/finances-personnelles/revision-comptes-bancaires" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/finances-personnelles/revision-comptes-bancaires" assign where host.name == "life-noc" } apply Service "finances-personnelles-verification-cartes-credit" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/finances-personnelles.yaml" + vars.life_noc_item_key = "verification-cartes-credit" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-cartes-credit" groups = [ "FINANCES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification des soldes et transactions des cartes de crédit" - vars.instructions_url = "/life-noc/item/finances-personnelles/verification-cartes-credit" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/finances-personnelles/verification-cartes-credit" assign where host.name == "life-noc" } apply Service "finances-personnelles-paiement-cartes-credit" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/finances-personnelles.yaml" + vars.life_noc_item_key = "paiement-cartes-credit" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "paiement-cartes-credit" groups = [ "FINANCES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Paiement des cartes de crédit personnelles" - vars.instructions_url = "/life-noc/item/finances-personnelles/paiement-cartes-credit" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/finances-personnelles/paiement-cartes-credit" assign where host.name == "life-noc" } apply Service "finances-personnelles-revision-budget-personnel" { - import "service_echeance" - vars.date_echeance = "2026-04-05" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/finances-personnelles.yaml" + vars.life_noc_item_key = "revision-budget-personnel" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-budget-personnel" groups = [ "FINANCES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Révision mensuelle du budget personnel" - vars.instructions_url = "/life-noc/item/finances-personnelles/revision-budget-personnel" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/finances-personnelles/revision-budget-personnel" assign where host.name == "life-noc" } apply Service "finances-personnelles-verification-prelevements-automatiques" { - import "service_echeance" - vars.date_echeance = "2026-04-03" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/finances-personnelles.yaml" + vars.life_noc_item_key = "verification-prelevements-automatiques" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-prelevements-automatiques" groups = [ "FINANCES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification des prélèvements automatiques personnels" - vars.instructions_url = "/life-noc/item/finances-personnelles/verification-prelevements-automatiques" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/finances-personnelles/verification-prelevements-automatiques" assign where host.name == "life-noc" } apply Service "finances-personnelles-verification-placements" { - import "service_echeance" - vars.date_echeance = "2026-06-30" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/finances-personnelles.yaml" + vars.life_noc_item_key = "verification-placements" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-placements" groups = [ "FINANCES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification périodique des placements et comptes enregistrés" - vars.instructions_url = "/life-noc/item/finances-personnelles/verification-placements" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/finances-personnelles/verification-placements" assign where host.name == "life-noc" } apply Service "finances-personnelles-verification-cotisations-reer" { - import "service_echeance" - vars.date_echeance = "2026-02-28" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/finances-personnelles.yaml" + vars.life_noc_item_key = "verification-cotisations-reer" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-cotisations-reer" groups = [ "FINANCES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "5" + vars.life_noc_threshold_ok_gte = "5" + vars.life_noc_threshold_warning_gte = "7" + vars.life_noc_threshold_critical_gte = "10" + vars.life_noc_on_error = "critical" notes = "Vérification des cotisations REER" - vars.instructions_url = "/life-noc/item/finances-personnelles/verification-cotisations-reer" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/finances-personnelles/verification-cotisations-reer" assign where host.name == "life-noc" } apply Service "finances-personnelles-verification-celi" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/finances-personnelles.yaml" + vars.life_noc_item_key = "verification-celi" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-celi" groups = [ "FINANCES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification de l'espace CELI et de son utilisation" - vars.instructions_url = "/life-noc/item/finances-personnelles/verification-celi" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/finances-personnelles/verification-celi" assign where host.name == "life-noc" } apply Service "finances-personnelles-preparation-dossier-financier-annuel" { - import "service_echeance" - vars.date_echeance = "2026-01-31" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/finances-personnelles.yaml" + vars.life_noc_item_key = "preparation-dossier-financier-annuel" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "preparation-dossier-financier-annuel" groups = [ "FINANCES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "300" + vars.life_noc_threshold_ok_gte = "300" + vars.life_noc_threshold_warning_gte = "365" + vars.life_noc_threshold_critical_gte = "395" + vars.life_noc_on_error = "critical" notes = "Préparer le dossier financier annuel personnel" - vars.instructions_url = "/life-noc/item/finances-personnelles/preparation-dossier-financier-annuel" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/finances-personnelles/preparation-dossier-financier-annuel" assign where host.name == "life-noc" } diff --git a/icinga/services/fiscalite-personnelle.conf b/icinga/services/fiscalite-personnelle.conf index 135db7b..9605ff3 100644 --- a/icinga/services/fiscalite-personnelle.conf +++ b/icinga/services/fiscalite-personnelle.conf @@ -5,13 +5,22 @@ */ apply Service "fiscalite-personnelle-preparation-documents-impots" { - import "service_echeance" - vars.date_echeance = "2026-03-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/fiscalite-personnelle.yaml" + vars.life_noc_item_key = "preparation-documents-impots" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "preparation-documents-impots" groups = [ "FISCALITE-PERSONNELLE" ] + vars.life_noc_threshold_unknown_lt = "5" + vars.life_noc_threshold_ok_gte = "5" + vars.life_noc_threshold_warning_gte = "7" + vars.life_noc_threshold_critical_gte = "10" + vars.life_noc_on_error = "critical" notes = "Rassembler tous les documents fiscaux personnels" - vars.instructions_url = "/life-noc/item/fiscalite-personnelle/preparation-documents-impots" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/fiscalite-personnelle/preparation-documents-impots" assign where host.name == "life-noc" } @@ -22,7 +31,7 @@ apply Service "fiscalite-personnelle-production-impots-federal" { vars.mock_message = "Sous contrôle" groups = [ "FISCALITE-PERSONNELLE" ] notes = "Produire la déclaration de revenus fédérale" - vars.instructions_url = "/life-noc/item/fiscalite-personnelle/production-impots-federal" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/fiscalite-personnelle/production-impots-federal" assign where host.name == "life-noc" } @@ -33,7 +42,7 @@ apply Service "fiscalite-personnelle-production-impots-quebec" { vars.mock_message = "Sous contrôle" groups = [ "FISCALITE-PERSONNELLE" ] notes = "Produire la déclaration de revenus Québec" - vars.instructions_url = "/life-noc/item/fiscalite-personnelle/production-impots-quebec" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/fiscalite-personnelle/production-impots-quebec" assign where host.name == "life-noc" } @@ -44,29 +53,47 @@ apply Service "fiscalite-personnelle-paiement-solde-impots" { vars.mock_message = "Sous contrôle" groups = [ "FISCALITE-PERSONNELLE" ] notes = "Payer tout solde d'impôt exigible" - vars.instructions_url = "/life-noc/item/fiscalite-personnelle/paiement-solde-impots" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/fiscalite-personnelle/paiement-solde-impots" assign where host.name == "life-noc" } apply Service "fiscalite-personnelle-verification-avis-cotisation" { - import "service_echeance" - vars.date_echeance = "2026-05-31" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/fiscalite-personnelle.yaml" + vars.life_noc_item_key = "verification-avis-cotisation" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-avis-cotisation" groups = [ "FISCALITE-PERSONNELLE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier les avis de cotisation ARC et Revenu Québec" - vars.instructions_url = "/life-noc/item/fiscalite-personnelle/verification-avis-cotisation" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/fiscalite-personnelle/verification-avis-cotisation" assign where host.name == "life-noc" } apply Service "fiscalite-personnelle-archivage-documents-fiscaux" { - import "service_echeance" - vars.date_echeance = "2026-06-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/fiscalite-personnelle.yaml" + vars.life_noc_item_key = "archivage-documents-fiscaux" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "archivage-documents-fiscaux" groups = [ "FISCALITE-PERSONNELLE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Archiver les documents fiscaux personnels" - vars.instructions_url = "/life-noc/item/fiscalite-personnelle/archivage-documents-fiscaux" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/fiscalite-personnelle/archivage-documents-fiscaux" assign where host.name == "life-noc" } @@ -77,6 +104,6 @@ apply Service "fiscalite-personnelle-verification-acomptes-provisionnels" { vars.mock_message = "Sous contrôle" groups = [ "FISCALITE-PERSONNELLE" ] notes = "Vérifier si des acomptes provisionnels sont requis" - vars.instructions_url = "/life-noc/item/fiscalite-personnelle/verification-acomptes-provisionnels" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/fiscalite-personnelle/verification-acomptes-provisionnels" assign where host.name == "life-noc" } diff --git a/icinga/services/focus.conf b/icinga/services/focus.conf index 4037af6..500f7aa 100644 --- a/icinga/services/focus.conf +++ b/icinga/services/focus.conf @@ -5,34 +5,61 @@ */ apply Service "focus-entretien-processus-focus" { - import "service_echeance" - vars.date_echeance = "2026-03-09" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/focus.yaml" + vars.life_noc_item_key = "entretien-processus-focus" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "entretien-processus-focus" groups = [ "FOCUS" ] + vars.life_noc_threshold_unknown_lt = "5" + vars.life_noc_threshold_ok_gte = "5" + vars.life_noc_threshold_warning_gte = "7" + vars.life_noc_threshold_critical_gte = "10" + vars.life_noc_on_error = "critical" notes = "Vérifier que les cartouches FOCUS sont à jour" - vars.instructions_url = "/life-noc/item/focus/entretien-processus-focus" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/focus/entretien-processus-focus" assign where host.name == "life-noc" } apply Service "focus-nettoyage-inbox-mentale" { - import "service_echeance" - vars.date_echeance = "2026-03-09" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/focus.yaml" + vars.life_noc_item_key = "nettoyage-inbox-mentale" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "nettoyage-inbox-mentale" groups = [ "FOCUS" ] + vars.life_noc_threshold_unknown_lt = "5" + vars.life_noc_threshold_ok_gte = "5" + vars.life_noc_threshold_warning_gte = "7" + vars.life_noc_threshold_critical_gte = "10" + vars.life_noc_on_error = "critical" notes = "Vider et clarifier les éléments capturés hors système" - vars.instructions_url = "/life-noc/item/focus/nettoyage-inbox-mentale" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/focus/nettoyage-inbox-mentale" assign where host.name == "life-noc" } apply Service "focus-revue-limitation-engagements" { - import "service_echeance" - vars.date_echeance = "2026-03-31" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/focus.yaml" + vars.life_noc_item_key = "revue-limitation-engagements" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revue-limitation-engagements" groups = [ "FOCUS" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérifier que les engagements actifs demeurent réalistes" - vars.instructions_url = "/life-noc/item/focus/revue-limitation-engagements" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/focus/revue-limitation-engagements" assign where host.name == "life-noc" } diff --git a/icinga/services/garage-et-rangement.conf b/icinga/services/garage-et-rangement.conf index 5fa2205..0836cdd 100644 --- a/icinga/services/garage-et-rangement.conf +++ b/icinga/services/garage-et-rangement.conf @@ -5,56 +5,101 @@ */ apply Service "garage-et-rangement-inspection-rangement-plafond" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/garage-et-rangement.yaml" + vars.life_noc_item_key = "inspection-rangement-plafond" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-rangement-plafond" groups = [ "GARAGE-ET-RANGEMENT" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des supports suspendus au plafond du garage" - vars.instructions_url = "/life-noc/item/garage-et-rangement/inspection-rangement-plafond" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/garage-et-rangement/inspection-rangement-plafond" assign where host.name == "life-noc" } apply Service "garage-et-rangement-revue-inventaire-garage" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/garage-et-rangement.yaml" + vars.life_noc_item_key = "revue-inventaire-garage" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revue-inventaire-garage" groups = [ "GARAGE-ET-RANGEMENT" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Revue de l'inventaire et de l'ordre du garage" - vars.instructions_url = "/life-noc/item/garage-et-rangement/revue-inventaire-garage" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/garage-et-rangement/revue-inventaire-garage" assign where host.name == "life-noc" } apply Service "garage-et-rangement-verification-rouille-outillage" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/garage-et-rangement.yaml" + vars.life_noc_item_key = "verification-rouille-outillage" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-rouille-outillage" groups = [ "GARAGE-ET-RANGEMENT" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification de la corrosion sur les outils et équipements" - vars.instructions_url = "/life-noc/item/garage-et-rangement/verification-rouille-outillage" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/garage-et-rangement/verification-rouille-outillage" assign where host.name == "life-noc" } apply Service "garage-et-rangement-inspection-securite-garage" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/garage-et-rangement.yaml" + vars.life_noc_item_key = "inspection-securite-garage" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-securite-garage" groups = [ "GARAGE-ET-RANGEMENT" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des conditions de sécurité du garage" - vars.instructions_url = "/life-noc/item/garage-et-rangement/inspection-securite-garage" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/garage-et-rangement/inspection-securite-garage" assign where host.name == "life-noc" } apply Service "garage-et-rangement-rotation-stockage-bacs" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/garage-et-rangement.yaml" + vars.life_noc_item_key = "rotation-stockage-bacs" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "rotation-stockage-bacs" groups = [ "GARAGE-ET-RANGEMENT" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revue des contenus de bacs de rangement" - vars.instructions_url = "/life-noc/item/garage-et-rangement/rotation-stockage-bacs" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/garage-et-rangement/rotation-stockage-bacs" assign where host.name == "life-noc" } diff --git a/icinga/services/informatique-personnelle.conf b/icinga/services/informatique-personnelle.conf index b0c05be..16a0967 100644 --- a/icinga/services/informatique-personnelle.conf +++ b/icinga/services/informatique-personnelle.conf @@ -5,56 +5,101 @@ */ apply Service "informatique-personnelle-verification-sauvegardes-personnelles" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/informatique-personnelle.yaml" + vars.life_noc_item_key = "verification-sauvegardes-personnelles" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-sauvegardes-personnelles" groups = [ "INFORMATIQUE-PERSONNELLE" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification des sauvegardes personnelles" - vars.instructions_url = "/life-noc/item/informatique-personnelle/verification-sauvegardes-personnelles" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/informatique-personnelle/verification-sauvegardes-personnelles" assign where host.name == "life-noc" } apply Service "informatique-personnelle-nettoyage-stockage-personnel" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/informatique-personnelle.yaml" + vars.life_noc_item_key = "nettoyage-stockage-personnel" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "nettoyage-stockage-personnel" groups = [ "INFORMATIQUE-PERSONNELLE" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Nettoyage du stockage numérique personnel" - vars.instructions_url = "/life-noc/item/informatique-personnelle/nettoyage-stockage-personnel" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/informatique-personnelle/nettoyage-stockage-personnel" assign where host.name == "life-noc" } apply Service "informatique-personnelle-verification-comptes-importants" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/informatique-personnelle.yaml" + vars.life_noc_item_key = "verification-comptes-importants" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-comptes-importants" groups = [ "INFORMATIQUE-PERSONNELLE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des comptes numériques personnels importants" - vars.instructions_url = "/life-noc/item/informatique-personnelle/verification-comptes-importants" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/informatique-personnelle/verification-comptes-importants" assign where host.name == "life-noc" } apply Service "informatique-personnelle-revue-mots-de-passe-personnels" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/informatique-personnelle.yaml" + vars.life_noc_item_key = "revue-mots-de-passe-personnels" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revue-mots-de-passe-personnels" groups = [ "INFORMATIQUE-PERSONNELLE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revue des mots de passe personnels critiques" - vars.instructions_url = "/life-noc/item/informatique-personnelle/revue-mots-de-passe-personnels" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/informatique-personnelle/revue-mots-de-passe-personnels" assign where host.name == "life-noc" } apply Service "informatique-personnelle-verification-documents-cloud-personnels" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/informatique-personnelle.yaml" + vars.life_noc_item_key = "verification-documents-cloud-personnels" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-documents-cloud-personnels" groups = [ "INFORMATIQUE-PERSONNELLE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier la cohérence des documents personnels sauvegardés" - vars.instructions_url = "/life-noc/item/informatique-personnelle/verification-documents-cloud-personnels" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/informatique-personnelle/verification-documents-cloud-personnels" assign where host.name == "life-noc" } diff --git a/icinga/services/infrastructure-chezlepro.conf b/icinga/services/infrastructure-chezlepro.conf index 813bd88..893c785 100644 --- a/icinga/services/infrastructure-chezlepro.conf +++ b/icinga/services/infrastructure-chezlepro.conf @@ -5,13 +5,22 @@ */ apply Service "infrastructure-chezlepro-verification-proxmox" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/infrastructure-chezlepro.yaml" + vars.life_noc_item_key = "verification-proxmox" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-proxmox" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification générale de l'environnement Proxmox" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-proxmox" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-proxmox" assign where host.name == "life-noc" } @@ -22,29 +31,47 @@ apply Service "infrastructure-chezlepro-verification-ceph" { vars.mock_message = "Sous contrôle" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] notes = "Vérification générale de l'état Ceph" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-ceph" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-ceph" assign where host.name == "life-noc" } apply Service "infrastructure-chezlepro-test-restauration-backups" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/infrastructure-chezlepro.yaml" + vars.life_noc_item_key = "test-restauration-backups" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "test-restauration-backups" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Test de restauration des sauvegardes" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/test-restauration-backups" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/test-restauration-backups" assign where host.name == "life-noc" } apply Service "infrastructure-chezlepro-verification-pbs-truenas" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/infrastructure-chezlepro.yaml" + vars.life_noc_item_key = "verification-pbs-truenas" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-pbs-truenas" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des solutions de sauvegarde et synchronisation" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-pbs-truenas" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-pbs-truenas" assign where host.name == "life-noc" } @@ -55,7 +82,7 @@ apply Service "infrastructure-chezlepro-verification-ups-infrastructure" { vars.mock_message = "Sous contrôle" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] notes = "Vérification des UPS de l'infrastructure" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-ups-infrastructure" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-ups-infrastructure" assign where host.name == "life-noc" } @@ -66,83 +93,146 @@ apply Service "infrastructure-chezlepro-verification-capacite-stockage" { vars.mock_message = "Sous contrôle" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] notes = "Vérifier capacité et croissance du stockage" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-capacite-stockage" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-capacite-stockage" assign where host.name == "life-noc" } apply Service "infrastructure-chezlepro-verification-apt-cacher-ng" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/infrastructure-chezlepro.yaml" + vars.life_noc_item_key = "verification-apt-cacher-ng" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-apt-cacher-ng" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification du bon fonctionnement d'apt-cacher-ng" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-apt-cacher-ng" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-apt-cacher-ng" assign where host.name == "life-noc" } apply Service "infrastructure-chezlepro-verification-icinga2" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/infrastructure-chezlepro.yaml" + vars.life_noc_item_key = "verification-icinga2" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-icinga2" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification de la supervision Icinga2" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-icinga2" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-icinga2" assign where host.name == "life-noc" } apply Service "infrastructure-chezlepro-verification-keycloak-openldap" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/infrastructure-chezlepro.yaml" + vars.life_noc_item_key = "verification-keycloak-openldap" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-keycloak-openldap" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification de l'identité et de l'authentification centralisées" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-keycloak-openldap" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-keycloak-openldap" assign where host.name == "life-noc" } apply Service "infrastructure-chezlepro-verification-nextcloud" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/infrastructure-chezlepro.yaml" + vars.life_noc_item_key = "verification-nextcloud" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-nextcloud" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification de l'état Nextcloud" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-nextcloud" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-nextcloud" assign where host.name == "life-noc" } apply Service "infrastructure-chezlepro-verification-mailcow" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/infrastructure-chezlepro.yaml" + vars.life_noc_item_key = "verification-mailcow" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-mailcow" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification de l'infrastructure Mailcow" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-mailcow" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-mailcow" assign where host.name == "life-noc" } apply Service "infrastructure-chezlepro-verification-openvas" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/infrastructure-chezlepro.yaml" + vars.life_noc_item_key = "verification-openvas" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-openvas" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification de la plateforme OpenVAS" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-openvas" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-openvas" assign where host.name == "life-noc" } apply Service "infrastructure-chezlepro-verification-journaux-systemes" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/infrastructure-chezlepro.yaml" + vars.life_noc_item_key = "verification-journaux-systemes" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-journaux-systemes" groups = [ "INFRASTRUCTURE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Revue des journaux systèmes critiques" - vars.instructions_url = "/life-noc/item/infrastructure-chezlepro/verification-journaux-systemes" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/infrastructure-chezlepro/verification-journaux-systemes" assign where host.name == "life-noc" } diff --git a/icinga/services/jardin.conf b/icinga/services/jardin.conf index 7240a23..4d333b3 100644 --- a/icinga/services/jardin.conf +++ b/icinga/services/jardin.conf @@ -5,90 +5,162 @@ */ apply Service "jardin-inspection-vignes" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/jardin.yaml" + vars.life_noc_item_key = "inspection-vignes" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-vignes" groups = [ "JARDIN" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Inspection et entretien des vignes" - vars.instructions_url = "/life-noc/item/jardin/inspection-vignes" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/jardin/inspection-vignes" assign where host.name == "life-noc" } apply Service "jardin-entretien-bleuetiers" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/jardin.yaml" + vars.life_noc_item_key = "entretien-bleuetiers" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "entretien-bleuetiers" groups = [ "JARDIN" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Entretien des bleuetiers" - vars.instructions_url = "/life-noc/item/jardin/entretien-bleuetiers" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/jardin/entretien-bleuetiers" assign where host.name == "life-noc" } apply Service "jardin-entretien-framboisiers" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/jardin.yaml" + vars.life_noc_item_key = "entretien-framboisiers" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "entretien-framboisiers" groups = [ "JARDIN" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Entretien des framboisiers" - vars.instructions_url = "/life-noc/item/jardin/entretien-framboisiers" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/jardin/entretien-framboisiers" assign where host.name == "life-noc" } apply Service "jardin-inspection-kiwis-nordiques" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/jardin.yaml" + vars.life_noc_item_key = "inspection-kiwis-nordiques" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-kiwis-nordiques" groups = [ "JARDIN" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des kiwis nordiques" - vars.instructions_url = "/life-noc/item/jardin/inspection-kiwis-nordiques" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/jardin/inspection-kiwis-nordiques" assign where host.name == "life-noc" } apply Service "jardin-entretien-rhubarbe" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/jardin.yaml" + vars.life_noc_item_key = "entretien-rhubarbe" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "entretien-rhubarbe" groups = [ "JARDIN" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Entretien de la rhubarbe" - vars.instructions_url = "/life-noc/item/jardin/entretien-rhubarbe" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/jardin/entretien-rhubarbe" assign where host.name == "life-noc" } apply Service "jardin-inspection-groseillier" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/jardin.yaml" + vars.life_noc_item_key = "inspection-groseillier" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-groseillier" groups = [ "JARDIN" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Inspection du groseillier" - vars.instructions_url = "/life-noc/item/jardin/inspection-groseillier" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/jardin/inspection-groseillier" assign where host.name == "life-noc" } apply Service "jardin-inspection-muriers" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/jardin.yaml" + vars.life_noc_item_key = "inspection-muriers" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-muriers" groups = [ "JARDIN" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Inspection des mûriers" - vars.instructions_url = "/life-noc/item/jardin/inspection-muriers" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/jardin/inspection-muriers" assign where host.name == "life-noc" } apply Service "jardin-entretien-houblon" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/jardin.yaml" + vars.life_noc_item_key = "entretien-houblon" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "entretien-houblon" groups = [ "JARDIN" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification et entretien du houblon" - vars.instructions_url = "/life-noc/item/jardin/entretien-houblon" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/jardin/entretien-houblon" assign where host.name == "life-noc" } @@ -99,7 +171,7 @@ apply Service "jardin-revision-pharmacopée-jardin" { vars.mock_message = "Sous contrôle" groups = [ "JARDIN" ] notes = "Vérification du stock de soins pour végétaux" - vars.instructions_url = "/life-noc/item/jardin/revision-pharmacopée-jardin" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/jardin/revision-pharmacopée-jardin" assign where host.name == "life-noc" } @@ -110,6 +182,6 @@ apply Service "jardin-revision-armoire-produits-jardin" { vars.mock_message = "Sous contrôle" groups = [ "JARDIN" ] notes = "Vérification et ordre de l'armoire des produits pour végétaux" - vars.instructions_url = "/life-noc/item/jardin/revision-armoire-produits-jardin" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/jardin/revision-armoire-produits-jardin" assign where host.name == "life-noc" } diff --git a/icinga/services/maison.conf b/icinga/services/maison.conf index 1d2a81b..f3bba93 100644 --- a/icinga/services/maison.conf +++ b/icinga/services/maison.conf @@ -5,167 +5,302 @@ */ apply Service "maison-remplacement-filtre-fournaise" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "remplacement-filtre-fournaise" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "remplacement-filtre-fournaise" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Remplacer le filtre de la fournaise" - vars.instructions_url = "/life-noc/item/maison/remplacement-filtre-fournaise" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/remplacement-filtre-fournaise" assign where host.name == "life-noc" } apply Service "maison-inspection-fournaise" { - import "service_echeance" - vars.date_echeance = "2026-09-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "inspection-fournaise" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-fournaise" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "150" + vars.life_noc_threshold_ok_gte = "150" + vars.life_noc_threshold_warning_gte = "180" + vars.life_noc_threshold_critical_gte = "210" + vars.life_noc_on_error = "critical" notes = "Inspection générale de la fournaise avant saison froide" - vars.instructions_url = "/life-noc/item/maison/inspection-fournaise" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/inspection-fournaise" assign where host.name == "life-noc" } apply Service "maison-inspection-thermopompe" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "inspection-thermopompe" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-thermopompe" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Inspection et entretien de la thermopompe" - vars.instructions_url = "/life-noc/item/maison/inspection-thermopompe" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/inspection-thermopompe" assign where host.name == "life-noc" } apply Service "maison-nettoyage-unites-exterieures" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "nettoyage-unites-exterieures" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "nettoyage-unites-exterieures" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Nettoyer les unités extérieures et vérifier le dégagement" - vars.instructions_url = "/life-noc/item/maison/nettoyage-unites-exterieures" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/nettoyage-unites-exterieures" assign where host.name == "life-noc" } apply Service "maison-inspection-toiture" { - import "service_echeance" - vars.date_echeance = "2026-10-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "inspection-toiture" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-toiture" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "150" + vars.life_noc_threshold_ok_gte = "150" + vars.life_noc_threshold_warning_gte = "180" + vars.life_noc_threshold_critical_gte = "210" + vars.life_noc_on_error = "critical" notes = "Inspection annuelle de la toiture" - vars.instructions_url = "/life-noc/item/maison/inspection-toiture" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/inspection-toiture" assign where host.name == "life-noc" } apply Service "maison-inspection-gouttieres" { - import "service_echeance" - vars.date_echeance = "2026-11-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "inspection-gouttieres" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-gouttieres" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "150" + vars.life_noc_threshold_ok_gte = "150" + vars.life_noc_threshold_warning_gte = "180" + vars.life_noc_threshold_critical_gte = "210" + vars.life_noc_on_error = "critical" notes = "Inspection et nettoyage des gouttières" - vars.instructions_url = "/life-noc/item/maison/inspection-gouttieres" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/inspection-gouttieres" assign where host.name == "life-noc" } apply Service "maison-inspection-fondation" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "inspection-fondation" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-fondation" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Inspection de la fondation et des fissures" - vars.instructions_url = "/life-noc/item/maison/inspection-fondation" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/inspection-fondation" assign where host.name == "life-noc" } apply Service "maison-verification-drainage-terrain" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "verification-drainage-terrain" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-drainage-terrain" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification du drainage autour de la maison" - vars.instructions_url = "/life-noc/item/maison/verification-drainage-terrain" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/verification-drainage-terrain" assign where host.name == "life-noc" } apply Service "maison-test-detecteurs-fumee" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "test-detecteurs-fumee" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "test-detecteurs-fumee" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Test des détecteurs de fumée" - vars.instructions_url = "/life-noc/item/maison/test-detecteurs-fumee" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/test-detecteurs-fumee" assign where host.name == "life-noc" } apply Service "maison-test-detecteurs-co" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "test-detecteurs-co" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "test-detecteurs-co" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Test des détecteurs de monoxyde de carbone" - vars.instructions_url = "/life-noc/item/maison/test-detecteurs-co" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/test-detecteurs-co" assign where host.name == "life-noc" } apply Service "maison-remplacement-piles-detecteurs" { - import "service_echeance" - vars.date_echeance = "2026-10-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "remplacement-piles-detecteurs" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "remplacement-piles-detecteurs" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "150" + vars.life_noc_threshold_ok_gte = "150" + vars.life_noc_threshold_warning_gte = "180" + vars.life_noc_threshold_critical_gte = "210" + vars.life_noc_on_error = "critical" notes = "Remplacement préventif des piles des détecteurs" - vars.instructions_url = "/life-noc/item/maison/remplacement-piles-detecteurs" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/remplacement-piles-detecteurs" assign where host.name == "life-noc" } apply Service "maison-verification-plomberie-visible" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "verification-plomberie-visible" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-plomberie-visible" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification visuelle de la plomberie accessible" - vars.instructions_url = "/life-noc/item/maison/verification-plomberie-visible" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/verification-plomberie-visible" assign where host.name == "life-noc" } apply Service "maison-inspection-sump-pump" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "inspection-sump-pump" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-sump-pump" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification de la pompe de puisard si applicable" - vars.instructions_url = "/life-noc/item/maison/inspection-sump-pump" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/inspection-sump-pump" assign where host.name == "life-noc" } apply Service "maison-verification-calfetrage" { - import "service_echeance" - vars.date_echeance = "2026-10-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "verification-calfetrage" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-calfetrage" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "150" + vars.life_noc_threshold_ok_gte = "150" + vars.life_noc_threshold_warning_gte = "180" + vars.life_noc_threshold_critical_gte = "210" + vars.life_noc_on_error = "critical" notes = "Vérification du calfeutrage portes et fenêtres" - vars.instructions_url = "/life-noc/item/maison/verification-calfetrage" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/verification-calfetrage" assign where host.name == "life-noc" } apply Service "maison-inspection-portes-garage" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/maison.yaml" + vars.life_noc_item_key = "inspection-portes-garage" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-portes-garage" groups = [ "MAISON" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification mécanique et sécurité des portes de garage" - vars.instructions_url = "/life-noc/item/maison/inspection-portes-garage" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/inspection-portes-garage" assign where host.name == "life-noc" } @@ -176,6 +311,6 @@ apply Service "maison-verification-extincteurs" { vars.mock_message = "Sous contrôle" groups = [ "MAISON" ] notes = "Vérification des extincteurs" - vars.instructions_url = "/life-noc/item/maison/verification-extincteurs" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/maison/verification-extincteurs" assign where host.name == "life-noc" } diff --git a/icinga/services/obligations-chezlepro.conf b/icinga/services/obligations-chezlepro.conf index 22b50f0..33bb956 100644 --- a/icinga/services/obligations-chezlepro.conf +++ b/icinga/services/obligations-chezlepro.conf @@ -11,7 +11,7 @@ apply Service "obligations-chezlepro-verification-registraire-entreprise" { vars.mock_message = "Sous contrôle" groups = [ "OBLIGATIONS-CHEZLEPRO" ] notes = "Vérifier les obligations au Registraire des entreprises" - vars.instructions_url = "/life-noc/item/obligations-chezlepro/verification-registraire-entreprise" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-chezlepro/verification-registraire-entreprise" assign where host.name == "life-noc" } @@ -22,40 +22,67 @@ apply Service "obligations-chezlepro-verification-declarations-taxes" { vars.mock_message = "Sous contrôle" groups = [ "OBLIGATIONS-CHEZLEPRO" ] notes = "Vérifier les obligations de taxes de l'entreprise si applicables" - vars.instructions_url = "/life-noc/item/obligations-chezlepro/verification-declarations-taxes" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-chezlepro/verification-declarations-taxes" assign where host.name == "life-noc" } apply Service "obligations-chezlepro-verification-dossier-comptable-entreprise" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/obligations-chezlepro.yaml" + vars.life_noc_item_key = "verification-dossier-comptable-entreprise" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-dossier-comptable-entreprise" groups = [ "OBLIGATIONS-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérifier l'ordre du dossier comptable Chezlepro" - vars.instructions_url = "/life-noc/item/obligations-chezlepro/verification-dossier-comptable-entreprise" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-chezlepro/verification-dossier-comptable-entreprise" assign where host.name == "life-noc" } apply Service "obligations-chezlepro-verification-facturation-clients" { - import "service_echeance" - vars.date_echeance = "2026-04-10" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/obligations-chezlepro.yaml" + vars.life_noc_item_key = "verification-facturation-clients" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-facturation-clients" groups = [ "OBLIGATIONS-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérifier la facturation et son suivi" - vars.instructions_url = "/life-noc/item/obligations-chezlepro/verification-facturation-clients" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-chezlepro/verification-facturation-clients" assign where host.name == "life-noc" } apply Service "obligations-chezlepro-verification-paiements-fournisseurs" { - import "service_echeance" - vars.date_echeance = "2026-04-10" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/obligations-chezlepro.yaml" + vars.life_noc_item_key = "verification-paiements-fournisseurs" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-paiements-fournisseurs" groups = [ "OBLIGATIONS-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérifier les paiements fournisseurs" - vars.instructions_url = "/life-noc/item/obligations-chezlepro/verification-paiements-fournisseurs" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-chezlepro/verification-paiements-fournisseurs" assign where host.name == "life-noc" } @@ -66,7 +93,7 @@ apply Service "obligations-chezlepro-verification-contrats-ententes" { vars.mock_message = "Sous contrôle" groups = [ "OBLIGATIONS-CHEZLEPRO" ] notes = "Vérifier contrats, ententes et obligations associées" - vars.instructions_url = "/life-noc/item/obligations-chezlepro/verification-contrats-ententes" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-chezlepro/verification-contrats-ententes" assign where host.name == "life-noc" } @@ -77,17 +104,26 @@ apply Service "obligations-chezlepro-verification-assurances-entreprise" { vars.mock_message = "Sous contrôle" groups = [ "OBLIGATIONS-CHEZLEPRO" ] notes = "Vérifier les assurances de l'entreprise" - vars.instructions_url = "/life-noc/item/obligations-chezlepro/verification-assurances-entreprise" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-chezlepro/verification-assurances-entreprise" assign where host.name == "life-noc" } apply Service "obligations-chezlepro-archivage-documents-entreprise" { - import "service_echeance" - vars.date_echeance = "2026-05-31" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/obligations-chezlepro.yaml" + vars.life_noc_item_key = "archivage-documents-entreprise" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "archivage-documents-entreprise" groups = [ "OBLIGATIONS-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Archiver les documents administratifs et financiers de l'entreprise" - vars.instructions_url = "/life-noc/item/obligations-chezlepro/archivage-documents-entreprise" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-chezlepro/archivage-documents-entreprise" assign where host.name == "life-noc" } diff --git a/icinga/services/obligations-legales-personnelles.conf b/icinga/services/obligations-legales-personnelles.conf index f63322f..cde546f 100644 --- a/icinga/services/obligations-legales-personnelles.conf +++ b/icinga/services/obligations-legales-personnelles.conf @@ -5,46 +5,82 @@ */ apply Service "obligations-legales-personnelles-verification-testament" { - import "service_echeance" - vars.date_echeance = "2026-07-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/obligations-legales-personnelles.yaml" + vars.life_noc_item_key = "verification-testament" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-testament" groups = [ "OBLIGATIONS-LEGALES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier la pertinence et l'actualité du testament" - vars.instructions_url = "/life-noc/item/obligations-legales-personnelles/verification-testament" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-legales-personnelles/verification-testament" assign where host.name == "life-noc" } apply Service "obligations-legales-personnelles-verification-mandat-inaptitude" { - import "service_echeance" - vars.date_echeance = "2026-07-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/obligations-legales-personnelles.yaml" + vars.life_noc_item_key = "verification-mandat-inaptitude" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-mandat-inaptitude" groups = [ "OBLIGATIONS-LEGALES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier le mandat de protection et documents connexes" - vars.instructions_url = "/life-noc/item/obligations-legales-personnelles/verification-mandat-inaptitude" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-legales-personnelles/verification-mandat-inaptitude" assign where host.name == "life-noc" } apply Service "obligations-legales-personnelles-verification-directives-medicales" { - import "service_echeance" - vars.date_echeance = "2026-07-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/obligations-legales-personnelles.yaml" + vars.life_noc_item_key = "verification-directives-medicales" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-directives-medicales" groups = [ "OBLIGATIONS-LEGALES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "150" + vars.life_noc_threshold_ok_gte = "150" + vars.life_noc_threshold_warning_gte = "180" + vars.life_noc_threshold_critical_gte = "210" + vars.life_noc_on_error = "critical" notes = "Vérifier les directives médicales anticipées" - vars.instructions_url = "/life-noc/item/obligations-legales-personnelles/verification-directives-medicales" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-legales-personnelles/verification-directives-medicales" assign where host.name == "life-noc" } apply Service "obligations-legales-personnelles-verification-papiers-identite" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/obligations-legales-personnelles.yaml" + vars.life_noc_item_key = "verification-papiers-identite" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-papiers-identite" groups = [ "OBLIGATIONS-LEGALES-PERSONNELLES" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier l'expiration des papiers d'identité" - vars.instructions_url = "/life-noc/item/obligations-legales-personnelles/verification-papiers-identite" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-legales-personnelles/verification-papiers-identite" assign where host.name == "life-noc" } @@ -64,7 +100,7 @@ apply Service "obligations-legales-personnelles-renouvellement-permis-conduire" vars.life_noc_threshold_critical_lt = "7" vars.life_noc_on_error = "critical" notes = "Vérifier la proximité de l’échéance du permis" - vars.instructions_url = "/life-noc/item/obligations-legales-personnelles/renouvellement-permis-conduire" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-legales-personnelles/renouvellement-permis-conduire" assign where host.name == "life-noc" } @@ -75,7 +111,7 @@ apply Service "obligations-legales-personnelles-verification-carte-assurance-mal vars.mock_message = "Sous contrôle" groups = [ "OBLIGATIONS-LEGALES-PERSONNELLES" ] notes = "Vérifier l'expiration de la carte d'assurance maladie" - vars.instructions_url = "/life-noc/item/obligations-legales-personnelles/verification-carte-assurance-maladie" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-legales-personnelles/verification-carte-assurance-maladie" assign where host.name == "life-noc" } @@ -86,6 +122,6 @@ apply Service "obligations-legales-personnelles-verification-passeport" { vars.mock_message = "Sous contrôle" groups = [ "OBLIGATIONS-LEGALES-PERSONNELLES" ] notes = "Vérifier l'expiration du passeport" - vars.instructions_url = "/life-noc/item/obligations-legales-personnelles/verification-passeport" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/obligations-legales-personnelles/verification-passeport" assign where host.name == "life-noc" } diff --git a/icinga/services/outils-et-equipements.conf b/icinga/services/outils-et-equipements.conf index baa2150..bc0af37 100644 --- a/icinga/services/outils-et-equipements.conf +++ b/icinga/services/outils-et-equipements.conf @@ -5,56 +5,101 @@ */ apply Service "outils-et-equipements-entretien-outils-jardin" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/outils-et-equipements.yaml" + vars.life_noc_item_key = "entretien-outils-jardin" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "entretien-outils-jardin" groups = [ "OUTILS-ET-EQUIPEMENTS" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Nettoyage et entretien des outils de jardin" - vars.instructions_url = "/life-noc/item/outils-et-equipements/entretien-outils-jardin" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/outils-et-equipements/entretien-outils-jardin" assign where host.name == "life-noc" } apply Service "outils-et-equipements-inspection-outils-electriques" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/outils-et-equipements.yaml" + vars.life_noc_item_key = "inspection-outils-electriques" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "inspection-outils-electriques" groups = [ "OUTILS-ET-EQUIPEMENTS" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des outils électriques" - vars.instructions_url = "/life-noc/item/outils-et-equipements/inspection-outils-electriques" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/outils-et-equipements/inspection-outils-electriques" assign where host.name == "life-noc" } apply Service "outils-et-equipements-verification-rallonges-et-connecteurs" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/outils-et-equipements.yaml" + vars.life_noc_item_key = "verification-rallonges-et-connecteurs" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-rallonges-et-connecteurs" groups = [ "OUTILS-ET-EQUIPEMENTS" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des rallonges et connecteurs" - vars.instructions_url = "/life-noc/item/outils-et-equipements/verification-rallonges-et-connecteurs" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/outils-et-equipements/verification-rallonges-et-connecteurs" assign where host.name == "life-noc" } apply Service "outils-et-equipements-verification-compresseur-et-accessoires" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/outils-et-equipements.yaml" + vars.life_noc_item_key = "verification-compresseur-et-accessoires" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-compresseur-et-accessoires" groups = [ "OUTILS-ET-EQUIPEMENTS" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification du compresseur et accessoires" - vars.instructions_url = "/life-noc/item/outils-et-equipements/verification-compresseur-et-accessoires" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/outils-et-equipements/verification-compresseur-et-accessoires" assign where host.name == "life-noc" } apply Service "outils-et-equipements-revision-inventaire-outillage" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/outils-et-equipements.yaml" + vars.life_noc_item_key = "revision-inventaire-outillage" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-inventaire-outillage" groups = [ "OUTILS-ET-EQUIPEMENTS" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revue de l'inventaire d'outillage" - vars.instructions_url = "/life-noc/item/outils-et-equipements/revision-inventaire-outillage" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/outils-et-equipements/revision-inventaire-outillage" assign where host.name == "life-noc" } diff --git a/icinga/services/projets.conf b/icinga/services/projets.conf index d163de8..6ba24a0 100644 --- a/icinga/services/projets.conf +++ b/icinga/services/projets.conf @@ -5,67 +5,121 @@ */ apply Service "projets-revision-life-noc" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/projets.yaml" + vars.life_noc_item_key = "revision-life-noc" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-life-noc" groups = [ "PROJETS" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Révision du projet Life-NOC" - vars.instructions_url = "/life-noc/item/projets/revision-life-noc" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/projets/revision-life-noc" assign where host.name == "life-noc" } apply Service "projets-revision-alliance-boreale" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/projets.yaml" + vars.life_noc_item_key = "revision-alliance-boreale" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-alliance-boreale" groups = [ "PROJETS" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Révision du projet Alliance Boréale" - vars.instructions_url = "/life-noc/item/projets/revision-alliance-boreale" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/projets/revision-alliance-boreale" assign where host.name == "life-noc" } apply Service "projets-revision-erplibre" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/projets.yaml" + vars.life_noc_item_key = "revision-erplibre" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-erplibre" groups = [ "PROJETS" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Révision du projet ERPLibre" - vars.instructions_url = "/life-noc/item/projets/revision-erplibre" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/projets/revision-erplibre" assign where host.name == "life-noc" } apply Service "projets-revision-semence-numerique" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/projets.yaml" + vars.life_noc_item_key = "revision-semence-numerique" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-semence-numerique" groups = [ "PROJETS" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Révision du projet semence numérique" - vars.instructions_url = "/life-noc/item/projets/revision-semence-numerique" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/projets/revision-semence-numerique" assign where host.name == "life-noc" } apply Service "projets-revision-ortrux-1" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/projets.yaml" + vars.life_noc_item_key = "revision-ortrux-1" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-ortrux-1" groups = [ "PROJETS" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Révision du système Ortrux-1" - vars.instructions_url = "/life-noc/item/projets/revision-ortrux-1" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/projets/revision-ortrux-1" assign where host.name == "life-noc" } apply Service "projets-revision-district16" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/projets.yaml" + vars.life_noc_item_key = "revision-district16" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-district16" groups = [ "PROJETS" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Révision du projet DISTRICT16" - vars.instructions_url = "/life-noc/item/projets/revision-district16" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/projets/revision-district16" assign where host.name == "life-noc" } diff --git a/icinga/services/reseau-chezlepro.conf b/icinga/services/reseau-chezlepro.conf index 18a32bb..bccd327 100644 --- a/icinga/services/reseau-chezlepro.conf +++ b/icinga/services/reseau-chezlepro.conf @@ -5,24 +5,42 @@ */ apply Service "reseau-chezlepro-verification-firewalls" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/reseau-chezlepro.yaml" + vars.life_noc_item_key = "verification-firewalls" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-firewalls" groups = [ "RESEAU-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification des firewalls" - vars.instructions_url = "/life-noc/item/reseau-chezlepro/verification-firewalls" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/reseau-chezlepro/verification-firewalls" assign where host.name == "life-noc" } apply Service "reseau-chezlepro-verification-vpn-openvpn" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/reseau-chezlepro.yaml" + vars.life_noc_item_key = "verification-vpn-openvpn" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-vpn-openvpn" groups = [ "RESEAU-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification des tunnels OpenVPN" - vars.instructions_url = "/life-noc/item/reseau-chezlepro/verification-vpn-openvpn" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/reseau-chezlepro/verification-vpn-openvpn" assign where host.name == "life-noc" } @@ -33,73 +51,127 @@ apply Service "reseau-chezlepro-verification-crl-certificats" { vars.mock_message = "Sous contrôle" groups = [ "RESEAU-CHEZLEPRO" ] notes = "Vérification de la CRL et des certificats" - vars.instructions_url = "/life-noc/item/reseau-chezlepro/verification-crl-certificats" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/reseau-chezlepro/verification-crl-certificats" assign where host.name == "life-noc" } apply Service "reseau-chezlepro-verification-switches" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/reseau-chezlepro.yaml" + vars.life_noc_item_key = "verification-switches" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-switches" groups = [ "RESEAU-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des switches et uplinks" - vars.instructions_url = "/life-noc/item/reseau-chezlepro/verification-switches" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/reseau-chezlepro/verification-switches" assign where host.name == "life-noc" } apply Service "reseau-chezlepro-verification-vlans-segmentation" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/reseau-chezlepro.yaml" + vars.life_noc_item_key = "verification-vlans-segmentation" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-vlans-segmentation" groups = [ "RESEAU-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification de la segmentation réseau" - vars.instructions_url = "/life-noc/item/reseau-chezlepro/verification-vlans-segmentation" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/reseau-chezlepro/verification-vlans-segmentation" assign where host.name == "life-noc" } apply Service "reseau-chezlepro-verification-dns" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/reseau-chezlepro.yaml" + vars.life_noc_item_key = "verification-dns" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-dns" groups = [ "RESEAU-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification DNS interne et externe" - vars.instructions_url = "/life-noc/item/reseau-chezlepro/verification-dns" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/reseau-chezlepro/verification-dns" assign where host.name == "life-noc" } apply Service "reseau-chezlepro-verification-dynamic-dns" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/reseau-chezlepro.yaml" + vars.life_noc_item_key = "verification-dynamic-dns" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-dynamic-dns" groups = [ "RESEAU-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification du DNS dynamique si utilisé" - vars.instructions_url = "/life-noc/item/reseau-chezlepro/verification-dynamic-dns" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/reseau-chezlepro/verification-dynamic-dns" assign where host.name == "life-noc" } apply Service "reseau-chezlepro-audit-regles-firewall" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/reseau-chezlepro.yaml" + vars.life_noc_item_key = "audit-regles-firewall" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "audit-regles-firewall" groups = [ "RESEAU-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Audit périodique des règles de firewall" - vars.instructions_url = "/life-noc/item/reseau-chezlepro/audit-regles-firewall" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/reseau-chezlepro/audit-regles-firewall" assign where host.name == "life-noc" } apply Service "reseau-chezlepro-verification-geoblocking" { - import "service_echeance" - vars.date_echeance = "2026-05-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/reseau-chezlepro.yaml" + vars.life_noc_item_key = "verification-geoblocking" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-geoblocking" groups = [ "RESEAU-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier le geoblocking et son effet attendu" - vars.instructions_url = "/life-noc/item/reseau-chezlepro/verification-geoblocking" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/reseau-chezlepro/verification-geoblocking" assign where host.name == "life-noc" } @@ -110,6 +182,6 @@ apply Service "reseau-chezlepro-verification-certificats-publics" { vars.mock_message = "Sous contrôle" groups = [ "RESEAU-CHEZLEPRO" ] notes = "Vérifier les expirations de certificats publics" - vars.instructions_url = "/life-noc/item/reseau-chezlepro/verification-certificats-publics" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/reseau-chezlepro/verification-certificats-publics" assign where host.name == "life-noc" } diff --git a/icinga/services/resilience.conf b/icinga/services/resilience.conf index f291e18..e42baa4 100644 --- a/icinga/services/resilience.conf +++ b/icinga/services/resilience.conf @@ -5,13 +5,22 @@ */ apply Service "resilience-test-generatrice-propane" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/resilience.yaml" + vars.life_noc_item_key = "test-generatrice-propane" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "test-generatrice-propane" groups = [ "RESILIENCE" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Test mensuel de la génératrice au propane" - vars.instructions_url = "/life-noc/item/resilience/test-generatrice-propane" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/resilience/test-generatrice-propane" assign where host.name == "life-noc" } @@ -22,18 +31,27 @@ apply Service "resilience-verification-carburant-generatrice" { vars.mock_message = "Sous contrôle" groups = [ "RESILIENCE" ] notes = "Vérification de l'approvisionnement propane lié à la génératrice" - vars.instructions_url = "/life-noc/item/resilience/verification-carburant-generatrice" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/resilience/verification-carburant-generatrice" assign where host.name == "life-noc" } apply Service "resilience-verification-procedure-bascule" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/resilience.yaml" + vars.life_noc_item_key = "verification-procedure-bascule" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-procedure-bascule" groups = [ "RESILIENCE" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Réviser la procédure de bascule en mode secours" - vars.instructions_url = "/life-noc/item/resilience/verification-procedure-bascule" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/resilience/verification-procedure-bascule" assign where host.name == "life-noc" } @@ -44,7 +62,7 @@ apply Service "resilience-verification-stock-lampes-piles" { vars.mock_message = "Sous contrôle" groups = [ "RESILIENCE" ] notes = "Vérification des lampes, piles et éclairage d'urgence" - vars.instructions_url = "/life-noc/item/resilience/verification-stock-lampes-piles" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/resilience/verification-stock-lampes-piles" assign where host.name == "life-noc" } @@ -55,29 +73,47 @@ apply Service "resilience-verification-trousses-urgence" { vars.mock_message = "Sous contrôle" groups = [ "RESILIENCE" ] notes = "Vérification des trousses d'urgence" - vars.instructions_url = "/life-noc/item/resilience/verification-trousses-urgence" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/resilience/verification-trousses-urgence" assign where host.name == "life-noc" } apply Service "resilience-revision-plan-urgence" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/resilience.yaml" + vars.life_noc_item_key = "revision-plan-urgence" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revision-plan-urgence" groups = [ "RESILIENCE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Réviser le plan d'urgence domestique" - vars.instructions_url = "/life-noc/item/resilience/revision-plan-urgence" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/resilience/revision-plan-urgence" assign where host.name == "life-noc" } apply Service "resilience-test-autonomie-base" { - import "service_echeance" - vars.date_echeance = "2026-06-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/resilience.yaml" + vars.life_noc_item_key = "test-autonomie-base" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "test-autonomie-base" groups = [ "RESILIENCE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier l'autonomie énergétique minimale attendue" - vars.instructions_url = "/life-noc/item/resilience/test-autonomie-base" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/resilience/test-autonomie-base" assign where host.name == "life-noc" } @@ -88,6 +124,6 @@ apply Service "resilience-verification-moyens-cuisson-secours" { vars.mock_message = "Sous contrôle" groups = [ "RESILIENCE" ] notes = "Vérification des moyens de cuisson de secours" - vars.instructions_url = "/life-noc/item/resilience/verification-moyens-cuisson-secours" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/resilience/verification-moyens-cuisson-secours" assign where host.name == "life-noc" } diff --git a/icinga/services/revue.conf b/icinga/services/revue.conf index 2c36046..00e6bfd 100644 --- a/icinga/services/revue.conf +++ b/icinga/services/revue.conf @@ -20,7 +20,7 @@ apply Service "revue-revue-quotidienne-life-noc" { vars.life_noc_threshold_critical_gte = "3" vars.life_noc_on_error = "critical" notes = "Vérifier le tableau de bord Life-NOC" - vars.instructions_url = "/life-noc/item/revue/revue-quotidienne-life-noc" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/revue/revue-quotidienne-life-noc" assign where host.name == "life-noc" } @@ -45,23 +45,41 @@ apply Service "revue-revue-hebdomadaire-priorites" { } apply Service "revue-revue-mensuelle-systeme-vie" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/revue.yaml" + vars.life_noc_item_key = "revue-mensuelle-systeme-vie" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revue-mensuelle-systeme-vie" groups = [ "REVUE" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Revue mensuelle de l'ensemble du système Life-NOC" - vars.instructions_url = "/life-noc/item/revue/revue-mensuelle-systeme-vie" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/revue/revue-mensuelle-systeme-vie" assign where host.name == "life-noc" } apply Service "revue-revue-trimestrielle-orientation" { - import "service_echeance" - vars.date_echeance = "2026-06-30" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/revue.yaml" + vars.life_noc_item_key = "revue-trimestrielle-orientation" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revue-trimestrielle-orientation" groups = [ "REVUE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revue trimestrielle des orientations de vie et de Chezlepro" - vars.instructions_url = "/life-noc/item/revue/revue-trimestrielle-orientation" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/revue/revue-trimestrielle-orientation" assign where host.name == "life-noc" } diff --git a/icinga/services/sante.conf b/icinga/services/sante.conf index 686aa92..13c0c71 100644 --- a/icinga/services/sante.conf +++ b/icinga/services/sante.conf @@ -11,7 +11,7 @@ apply Service "sante-verification-trousse-premiers-soins" { vars.mock_message = "Sous contrôle" groups = [ "SANTE" ] notes = "Vérification de la trousse de premiers soins" - vars.instructions_url = "/life-noc/item/sante/verification-trousse-premiers-soins" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/sante/verification-trousse-premiers-soins" assign where host.name == "life-noc" } @@ -22,7 +22,7 @@ apply Service "sante-verification-expiration-medicaments" { vars.mock_message = "Sous contrôle" groups = [ "SANTE" ] notes = "Vérification des dates d'expiration des médicaments" - vars.instructions_url = "/life-noc/item/sante/verification-expiration-medicaments" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/sante/verification-expiration-medicaments" assign where host.name == "life-noc" } @@ -33,7 +33,7 @@ apply Service "sante-revision-rendez-vous-medicaux" { vars.mock_message = "Sous contrôle" groups = [ "SANTE" ] notes = "Revoir les rendez-vous médicaux requis" - vars.instructions_url = "/life-noc/item/sante/revision-rendez-vous-medicaux" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/sante/revision-rendez-vous-medicaux" assign where host.name == "life-noc" } @@ -44,17 +44,26 @@ apply Service "sante-verification-lunettes-prescriptions" { vars.mock_message = "Sous contrôle" groups = [ "SANTE" ] notes = "Vérifier les prescriptions et besoins de renouvellement" - vars.instructions_url = "/life-noc/item/sante/verification-lunettes-prescriptions" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/sante/verification-lunettes-prescriptions" assign where host.name == "life-noc" } apply Service "sante-verification-dossier-sante" { - import "service_echeance" - vars.date_echeance = "2026-06-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/sante.yaml" + vars.life_noc_item_key = "verification-dossier-sante" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-dossier-sante" groups = [ "SANTE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérifier l'ordre et l'accessibilité des documents de santé" - vars.instructions_url = "/life-noc/item/sante/verification-dossier-sante" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/sante/verification-dossier-sante" assign where host.name == "life-noc" } diff --git a/icinga/services/securite-chezlepro.conf b/icinga/services/securite-chezlepro.conf index b4e0c04..b17598d 100644 --- a/icinga/services/securite-chezlepro.conf +++ b/icinga/services/securite-chezlepro.conf @@ -5,35 +5,62 @@ */ apply Service "securite-chezlepro-verification-mises-a-jour-securite" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/securite-chezlepro.yaml" + vars.life_noc_item_key = "verification-mises-a-jour-securite" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-mises-a-jour-securite" groups = [ "SECURITE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérification des mises à jour de sécurité" - vars.instructions_url = "/life-noc/item/securite-chezlepro/verification-mises-a-jour-securite" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/securite-chezlepro/verification-mises-a-jour-securite" assign where host.name == "life-noc" } apply Service "securite-chezlepro-audit-comptes-acces" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/securite-chezlepro.yaml" + vars.life_noc_item_key = "audit-comptes-acces" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "audit-comptes-acces" groups = [ "SECURITE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Audit des comptes et accès privilégiés" - vars.instructions_url = "/life-noc/item/securite-chezlepro/audit-comptes-acces" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/securite-chezlepro/audit-comptes-acces" assign where host.name == "life-noc" } apply Service "securite-chezlepro-verification-ids-snort" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/securite-chezlepro.yaml" + vars.life_noc_item_key = "verification-ids-snort" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-ids-snort" groups = [ "SECURITE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des IDS et de leur état" - vars.instructions_url = "/life-noc/item/securite-chezlepro/verification-ids-snort" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/securite-chezlepro/verification-ids-snort" assign where host.name == "life-noc" } @@ -44,28 +71,46 @@ apply Service "securite-chezlepro-revue-pki-privee" { vars.mock_message = "Sous contrôle" groups = [ "SECURITE-CHEZLEPRO" ] notes = "Revue de la PKI privée et des autorités intermédiaires" - vars.instructions_url = "/life-noc/item/securite-chezlepro/revue-pki-privee" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/securite-chezlepro/revue-pki-privee" assign where host.name == "life-noc" } apply Service "securite-chezlepro-revue-politiques-securite" { - import "service_echeance" - vars.date_echeance = "2026-06-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/securite-chezlepro.yaml" + vars.life_noc_item_key = "revue-politiques-securite" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "revue-politiques-securite" groups = [ "SECURITE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Revue des politiques et pratiques de sécurité numérique" - vars.instructions_url = "/life-noc/item/securite-chezlepro/revue-politiques-securite" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/securite-chezlepro/revue-politiques-securite" assign where host.name == "life-noc" } apply Service "securite-chezlepro-verification-sauvegardes-configuration" { - import "service_echeance" - vars.date_echeance = "2026-04-15" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/securite-chezlepro.yaml" + vars.life_noc_item_key = "verification-sauvegardes-configuration" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-sauvegardes-configuration" groups = [ "SECURITE-CHEZLEPRO" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Vérifier les sauvegardes des configurations critiques" - vars.instructions_url = "/life-noc/item/securite-chezlepro/verification-sauvegardes-configuration" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/securite-chezlepro/verification-sauvegardes-configuration" assign where host.name == "life-noc" } diff --git a/icinga/services/stock-alimentaire.conf b/icinga/services/stock-alimentaire.conf index b032cf9..18f26b3 100644 --- a/icinga/services/stock-alimentaire.conf +++ b/icinga/services/stock-alimentaire.conf @@ -5,13 +5,22 @@ */ apply Service "stock-alimentaire-rotation-nourriture-seche" { - import "service_echeance" - vars.date_echeance = "2026-04-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/stock-alimentaire.yaml" + vars.life_noc_item_key = "rotation-nourriture-seche" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "rotation-nourriture-seche" groups = [ "STOCK-ALIMENTAIRE" ] + vars.life_noc_threshold_unknown_lt = "20" + vars.life_noc_threshold_ok_gte = "20" + vars.life_noc_threshold_warning_gte = "31" + vars.life_noc_threshold_critical_gte = "45" + vars.life_noc_on_error = "critical" notes = "Rotation des stocks de nourriture sèche" - vars.instructions_url = "/life-noc/item/stock-alimentaire/rotation-nourriture-seche" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/stock-alimentaire/rotation-nourriture-seche" assign where host.name == "life-noc" } @@ -22,7 +31,7 @@ apply Service "stock-alimentaire-verification-reserve-eau" { vars.mock_message = "Sous contrôle" groups = [ "STOCK-ALIMENTAIRE" ] notes = "Vérification de la réserve d'eau potable" - vars.instructions_url = "/life-noc/item/stock-alimentaire/verification-reserve-eau" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/stock-alimentaire/verification-reserve-eau" assign where host.name == "life-noc" } @@ -33,7 +42,7 @@ apply Service "stock-alimentaire-verification-mylar-absorbeurs" { vars.mock_message = "Sous contrôle" groups = [ "STOCK-ALIMENTAIRE" ] notes = "Vérifier l'intégrité des emballages Mylar et absorbeurs" - vars.instructions_url = "/life-noc/item/stock-alimentaire/verification-mylar-absorbeurs" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/stock-alimentaire/verification-mylar-absorbeurs" assign where host.name == "life-noc" } @@ -44,7 +53,7 @@ apply Service "stock-alimentaire-revue-inventaire-conserves" { vars.mock_message = "Sous contrôle" groups = [ "STOCK-ALIMENTAIRE" ] notes = "Revue des conserves et dates de rotation" - vars.instructions_url = "/life-noc/item/stock-alimentaire/revue-inventaire-conserves" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/stock-alimentaire/revue-inventaire-conserves" assign where host.name == "life-noc" } @@ -55,7 +64,7 @@ apply Service "stock-alimentaire-revue-inventaire-farine-riz-pates" { vars.mock_message = "Sous contrôle" groups = [ "STOCK-ALIMENTAIRE" ] notes = "Vérification des gros stocks alimentaires de base" - vars.instructions_url = "/life-noc/item/stock-alimentaire/revue-inventaire-farine-riz-pates" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/stock-alimentaire/revue-inventaire-farine-riz-pates" assign where host.name == "life-noc" } @@ -66,7 +75,7 @@ apply Service "stock-alimentaire-verification-bacs-legumes-racines" { vars.mock_message = "Sous contrôle" groups = [ "STOCK-ALIMENTAIRE" ] notes = "Vérification des bacs de stockage de légumes racines" - vars.instructions_url = "/life-noc/item/stock-alimentaire/verification-bacs-legumes-racines" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/stock-alimentaire/verification-bacs-legumes-racines" assign where host.name == "life-noc" } @@ -77,6 +86,6 @@ apply Service "stock-alimentaire-revue-supplements-vitamines" { vars.mock_message = "Sous contrôle" groups = [ "STOCK-ALIMENTAIRE" ] notes = "Vérification du stock de suppléments et dates utiles" - vars.instructions_url = "/life-noc/item/stock-alimentaire/revue-supplements-vitamines" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/stock-alimentaire/revue-supplements-vitamines" assign where host.name == "life-noc" } diff --git a/icinga/services/voiture.conf b/icinga/services/voiture.conf index 6a454b2..ce3148f 100644 --- a/icinga/services/voiture.conf +++ b/icinga/services/voiture.conf @@ -11,7 +11,7 @@ apply Service "voiture-verification-huile-moteur" { vars.mock_message = "Sous contrôle" groups = [ "VOITURE" ] notes = "Vérification de l'huile moteur" - vars.instructions_url = "/life-noc/item/voiture/verification-huile-moteur" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/voiture/verification-huile-moteur" assign where host.name == "life-noc" } @@ -22,7 +22,7 @@ apply Service "voiture-inspection-freins" { vars.mock_message = "Sous contrôle" groups = [ "VOITURE" ] notes = "Inspection des freins" - vars.instructions_url = "/life-noc/item/voiture/inspection-freins" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/voiture/inspection-freins" assign where host.name == "life-noc" } @@ -33,7 +33,7 @@ apply Service "voiture-verification-pneus" { vars.mock_message = "Sous contrôle" groups = [ "VOITURE" ] notes = "Vérification usure, pression et permutation des pneus" - vars.instructions_url = "/life-noc/item/voiture/verification-pneus" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/voiture/verification-pneus" assign where host.name == "life-noc" } @@ -44,7 +44,7 @@ apply Service "voiture-ajustement-valves" { vars.mock_message = "Sous contrôle" groups = [ "VOITURE" ] notes = "Vérification et ajustement des valves Honda Accord" - vars.instructions_url = "/life-noc/item/voiture/ajustement-valves" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/voiture/ajustement-valves" assign where host.name == "life-noc" } @@ -55,7 +55,7 @@ apply Service "voiture-verification-timing-belt" { vars.mock_message = "Sous contrôle" groups = [ "VOITURE" ] notes = "Vérification de la courroie de distribution et pompe à eau" - vars.instructions_url = "/life-noc/item/voiture/verification-timing-belt" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/voiture/verification-timing-belt" assign where host.name == "life-noc" } @@ -66,18 +66,27 @@ apply Service "voiture-verification-batterie-voiture" { vars.mock_message = "Sous contrôle" groups = [ "VOITURE" ] notes = "Vérification de l'état de la batterie automobile" - vars.instructions_url = "/life-noc/item/voiture/verification-batterie-voiture" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/voiture/verification-batterie-voiture" assign where host.name == "life-noc" } apply Service "voiture-verification-balais-essuie-glace" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/voiture.yaml" + vars.life_noc_item_key = "verification-balais-essuie-glace" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-balais-essuie-glace" groups = [ "VOITURE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification des essuie-glaces" - vars.instructions_url = "/life-noc/item/voiture/verification-balais-essuie-glace" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/voiture/verification-balais-essuie-glace" assign where host.name == "life-noc" } @@ -88,18 +97,27 @@ apply Service "voiture-verification-liquides" { vars.mock_message = "Sous contrôle" groups = [ "VOITURE" ] notes = "Vérification des liquides de la voiture" - vars.instructions_url = "/life-noc/item/voiture/verification-liquides" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/voiture/verification-liquides" assign where host.name == "life-noc" } apply Service "voiture-verification-eclairage" { - import "service_echeance" - vars.date_echeance = "2026-05-01" - vars.mock_state = "OK" - vars.mock_message = "Sous contrôle" + import "service_life_noc_probe" + vars.life_noc_probe_type = "elapsed_time" + vars.life_noc_source_type = "manual_date" + vars.life_noc_source_value = "" + vars.life_noc_inputs_file = "/opt/life-noc/data/inputs/voiture.yaml" + vars.life_noc_item_key = "verification-eclairage" + vars.life_noc_metric_unit = "days" + vars.life_noc_label = "verification-eclairage" groups = [ "VOITURE" ] + vars.life_noc_threshold_unknown_lt = "60" + vars.life_noc_threshold_ok_gte = "60" + vars.life_noc_threshold_warning_gte = "90" + vars.life_noc_threshold_critical_gte = "120" + vars.life_noc_on_error = "critical" notes = "Vérification de l'éclairage et des phares" - vars.instructions_url = "/life-noc/item/voiture/verification-eclairage" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/voiture/verification-eclairage" assign where host.name == "life-noc" } @@ -110,6 +128,6 @@ apply Service "voiture-verification-immatriculation-assurance" { vars.mock_message = "Sous contrôle" groups = [ "VOITURE" ] notes = "Vérification papiers d'assurance et immatriculation" - vars.instructions_url = "/life-noc/item/voiture/verification-immatriculation-assurance" + vars.instructions_url = "http://192.168.12.40:8787/life-noc/item/voiture/verification-immatriculation-assurance" assign where host.name == "life-noc" } diff --git a/lib/life_noc_domains.py b/lib/life_noc_domains.py new file mode 100644 index 0000000..512d97d --- /dev/null +++ b/lib/life_noc_domains.py @@ -0,0 +1,355 @@ +from __future__ import annotations + +from copy import deepcopy +from datetime import datetime, timezone +from pathlib import Path +from typing import Any +import os +import tempfile +import yaml + +DOMAINS_FILE = Path(os.environ.get("LIFE_NOC_DOMAINS_FILE", "domains.yaml")) + +ALLOWED_PROBE_TYPES = [ + "", + "elapsed_time", + "days_until_due", + "elapsed_distance", + "current_value", + "remaining_quantity", +] +ALLOWED_SOURCE_TYPES = [ + "", + "manual_date", + "manual_counter", + "manual_value", + "mqtt", + "file_json", + "file_text", + "csv", + "api", + "command", + "derived", +] +ALLOWED_METRIC_UNITS = [ + "", + "days", + "km", + "units", + "%", + "volts", + "litres", + "watts", +] +ALLOWED_ON_ERROR = ["", "critical", "warning", "unknown"] +ALLOWED_FORM_MODES = [ + "", + "complete_date", + "due_date", + "counter_pair", + "numeric_value", + "remaining_quantity", +] +THRESHOLD_FIELDS = [ + "unknown_lt", + "ok_gte", + "warning_gte", + "critical_gte", + "unknown_gte", + "ok_lt", + "warning_lt", + "critical_lt", +] + + +class DomainsError(ValueError): + pass + + +class DomainsConflictError(DomainsError): + pass + + +def _now_suffix() -> str: + return datetime.now(timezone.utc).strftime('%Y%m%dT%H%M%SZ') + + +def load_domains_document() -> dict[str, Any]: + if not DOMAINS_FILE.exists(): + raise DomainsError(f'Fichier introuvable: {DOMAINS_FILE}') + data = yaml.safe_load(DOMAINS_FILE.read_text(encoding='utf-8')) + if not isinstance(data, dict): + raise DomainsError('domains.yaml invalide') + domains = data.get('domains') + if not isinstance(domains, dict): + raise DomainsError("domains.yaml invalide: clé 'domains' absente ou invalide") + return data + + +def save_domains_document(doc: dict[str, Any], create_backup: bool = True) -> Path: + if not isinstance(doc, dict) or not isinstance(doc.get('domains'), dict): + raise DomainsError("document domains invalide") + + target = DOMAINS_FILE + target.parent.mkdir(parents=True, exist_ok=True) + rendered = yaml.safe_dump(doc, sort_keys=False, allow_unicode=True, width=1000) + + if create_backup and target.exists(): + backup = target.with_suffix(target.suffix + f'.bak.{_now_suffix()}') + backup.write_text(target.read_text(encoding='utf-8'), encoding='utf-8') + + fd, tmp_name = tempfile.mkstemp(prefix=target.name + '.', dir=str(target.parent)) + try: + with os.fdopen(fd, 'w', encoding='utf-8') as handle: + handle.write(rendered) + os.replace(tmp_name, target) + finally: + if os.path.exists(tmp_name): + os.unlink(tmp_name) + return target + + +def list_domains() -> list[str]: + doc = load_domains_document() + return list(doc['domains'].keys()) + + +def list_domain_items(domain: str) -> list[dict[str, Any]]: + doc = load_domains_document() + items = doc['domains'].get(domain) + if not isinstance(items, list): + raise KeyError(domain) + return items + + +def get_domain_item(domain: str, item_key: str) -> dict[str, Any]: + items = list_domain_items(domain) + for item in items: + if isinstance(item, dict) and str(item.get('name', '')).strip() == item_key: + return deepcopy(item) + raise KeyError(item_key) + + +def _find_item_index(items: list[dict[str, Any]], item_key: str) -> int: + for index, item in enumerate(items): + if isinstance(item, dict) and str(item.get('name', '')).strip() == item_key: + return index + raise KeyError(item_key) + + +def _clean_value(value: Any) -> Any: + if isinstance(value, dict): + cleaned = {} + for key, subvalue in value.items(): + candidate = _clean_value(subvalue) + if candidate in ('', None, {}, []): + continue + cleaned[key] = candidate + return cleaned + if isinstance(value, list): + cleaned_list = [_clean_value(v) for v in value] + return [v for v in cleaned_list if v not in ('', None, {}, [])] + return value + + +def _parse_number(value: Any) -> Any: + if value is None: + return None + text = str(value).strip() + if text == '': + return None + try: + if any(ch in text for ch in ('.', 'e', 'E')): + number = float(text) + return int(number) if number.is_integer() else number + return int(text) + except ValueError: + raise DomainsError(f'Valeur numérique invalide: {text}') + + +def _coerce_bool(value: Any) -> bool: + return str(value).strip().lower() in {'1', 'true', 'yes', 'on'} + + +def _validate_choice(label: str, value: str, allowed: list[str]) -> str: + if value not in allowed: + raise DomainsError(f'{label} invalide: {value}') + return value + + +def normalize_item_payload(form: dict[str, Any], existing_item: dict[str, Any] | None = None) -> dict[str, Any]: + base = deepcopy(existing_item) if existing_item else {} + + name = str(form.get('name', base.get('name', ''))).strip() + if not name: + raise DomainsError("Le champ 'name' est obligatoire.") + item: dict[str, Any] = {'name': name} + + date_value = str(form.get('date', base.get('date', ''))).strip() + if date_value: + item['date'] = date_value + + for field in ['title', 'summary', 'notes', 'instructions', 'notes_url', 'instructions_url', 'action_url']: + raw = form.get(field, base.get(field, '')) + value = str(raw).strip() if raw is not None else '' + if value: + item[field] = value + + probe_type = str(form.get('probe_type', base.get('probe', {}).get('type', ''))).strip() + source_type = str(form.get('probe_source_type', base.get('probe', {}).get('source', {}).get('type', ''))).strip() + inputs_file = str(form.get('probe_inputs_file', base.get('probe', {}).get('source', {}).get('inputs_file', ''))).strip() + source_item_key = str(form.get('probe_item_key', base.get('probe', {}).get('source', {}).get('item_key', ''))).strip() + metric_unit = str(form.get('metric_unit', base.get('probe', {}).get('metric', {}).get('unit', ''))).strip() + on_error = str(form.get('policy_on_error', base.get('probe', {}).get('policy', {}).get('on_error', ''))).strip() + + _validate_choice('probe.type', probe_type, ALLOWED_PROBE_TYPES) + _validate_choice('probe.source.type', source_type, ALLOWED_SOURCE_TYPES) + _validate_choice('metric.unit', metric_unit, ALLOWED_METRIC_UNITS) + _validate_choice('policy.on_error', on_error, ALLOWED_ON_ERROR) + + thresholds: dict[str, Any] = {} + base_thresholds = base.get('probe', {}).get('thresholds', {}) if isinstance(base.get('probe'), dict) else {} + for field in THRESHOLD_FIELDS: + raw = form.get(field, base_thresholds.get(field, '')) + parsed = _parse_number(raw) + if parsed is not None: + thresholds[field] = parsed + + if probe_type or source_type or inputs_file or source_item_key or metric_unit or thresholds or on_error: + probe: dict[str, Any] = {} + if probe_type: + probe['type'] = probe_type + source: dict[str, Any] = {} + if source_type: + source['type'] = source_type + if inputs_file: + source['inputs_file'] = inputs_file + if source_item_key: + source['item_key'] = source_item_key + if source: + probe['source'] = source + if metric_unit: + probe['metric'] = {'unit': metric_unit} + if thresholds: + probe['thresholds'] = thresholds + if on_error: + probe['policy'] = {'on_error': on_error} + item['probe'] = probe + + form_mode = str(form.get('ui_form_mode', base.get('ui', {}).get('form_mode', ''))).strip() + _validate_choice('ui.form_mode', form_mode, ALLOWED_FORM_MODES) + allow_complete = _coerce_bool(form.get('ui_allow_complete', base.get('ui', {}).get('allow_complete', False))) + allow_manual_edit = _coerce_bool(form.get('ui_allow_manual_edit', base.get('ui', {}).get('allow_manual_edit', False))) + if form_mode or allow_complete or allow_manual_edit: + ui: dict[str, Any] = {} + if form_mode: + ui['form_mode'] = form_mode + if allow_complete: + ui['allow_complete'] = True + if allow_manual_edit: + ui['allow_manual_edit'] = True + item['ui'] = ui + + normalized = _clean_value(item) + _validate_item_structure(normalized) + return normalized + + +def _validate_item_structure(item: dict[str, Any]) -> None: + if 'name' not in item or not str(item['name']).strip(): + raise DomainsError("Le champ 'name' est obligatoire.") + probe = item.get('probe') + if probe is None: + return + if not isinstance(probe, dict): + raise DomainsError('probe doit être un objet') + if 'type' not in probe: + raise DomainsError("probe.type est requis dès qu'un probe est défini") + source = probe.get('source') + if source is not None and not isinstance(source, dict): + raise DomainsError('probe.source doit être un objet') + metric = probe.get('metric') + if metric is not None and not isinstance(metric, dict): + raise DomainsError('probe.metric doit être un objet') + thresholds = probe.get('thresholds') + if thresholds is not None and not isinstance(thresholds, dict): + raise DomainsError('probe.thresholds doit être un objet') + + +def upsert_item(domain: str, item: dict[str, Any], original_item_key: str | None = None) -> Path: + doc = load_domains_document() + items = doc['domains'].get(domain) + if not isinstance(items, list): + raise KeyError(domain) + + existing_names = [str(entry.get('name', '')).strip() for entry in items if isinstance(entry, dict)] + new_name = str(item['name']).strip() + if new_name in existing_names and original_item_key != new_name: + raise DomainsConflictError(f"Un item nommé '{new_name}' existe déjà dans le domaine '{domain}'.") + + if original_item_key: + index = _find_item_index(items, original_item_key) + items[index] = item + else: + items.append(item) + return save_domains_document(doc) + + +def delete_item(domain: str, item_key: str) -> Path: + doc = load_domains_document() + items = doc['domains'].get(domain) + if not isinstance(items, list): + raise KeyError(domain) + index = _find_item_index(items, item_key) + items.pop(index) + return save_domains_document(doc) + + +def reorder_item(domain: str, item_key: str, direction: str) -> Path: + if direction not in {'up', 'down'}: + raise DomainsError('direction invalide') + doc = load_domains_document() + items = doc['domains'].get(domain) + if not isinstance(items, list): + raise KeyError(domain) + index = _find_item_index(items, item_key) + if direction == 'up' and index > 0: + items[index - 1], items[index] = items[index], items[index - 1] + elif direction == 'down' and index < len(items) - 1: + items[index + 1], items[index] = items[index], items[index + 1] + return save_domains_document(doc) + + +def item_to_form_values(item: dict[str, Any] | None, domain: str = '') -> dict[str, Any]: + item = deepcopy(item) if item else {} + probe = item.get('probe', {}) if isinstance(item.get('probe'), dict) else {} + source = probe.get('source', {}) if isinstance(probe.get('source'), dict) else {} + metric = probe.get('metric', {}) if isinstance(probe.get('metric'), dict) else {} + thresholds = probe.get('thresholds', {}) if isinstance(probe.get('thresholds'), dict) else {} + policy = probe.get('policy', {}) if isinstance(probe.get('policy'), dict) else {} + ui = item.get('ui', {}) if isinstance(item.get('ui'), dict) else {} + + values = { + 'domain': domain, + 'name': item.get('name', ''), + 'date': item.get('date', ''), + 'title': item.get('title', ''), + 'summary': item.get('summary', ''), + 'notes': item.get('notes', ''), + 'instructions': item.get('instructions', ''), + 'notes_url': item.get('notes_url', ''), + 'instructions_url': item.get('instructions_url', ''), + 'action_url': item.get('action_url', ''), + 'probe_type': probe.get('type', ''), + 'probe_source_type': source.get('type', ''), + 'probe_inputs_file': source.get('inputs_file', ''), + 'probe_item_key': source.get('item_key', ''), + 'metric_unit': metric.get('unit', ''), + 'policy_on_error': policy.get('on_error', ''), + 'ui_form_mode': ui.get('form_mode', ''), + 'ui_allow_complete': bool(ui.get('allow_complete', False)), + 'ui_allow_manual_edit': bool(ui.get('allow_manual_edit', False)), + } + for field in THRESHOLD_FIELDS: + values[field] = thresholds.get(field, '') + return values diff --git a/scripts/generate_services.py b/scripts/generate_services.py index 308004d..72bb0f0 100644 --- a/scripts/generate_services.py +++ b/scripts/generate_services.py @@ -2,6 +2,7 @@ from pathlib import Path import re +import os import sys import yaml @@ -15,6 +16,19 @@ PROBE_TEMPLATE = "service_life_noc_probe" DEFAULT_MOCK_STATE = "OK" DEFAULT_MOCK_MESSAGE = "Sous contrôle" +LIFE_NOC_PUBLIC_BASE_URL = os.environ.get("LIFE_NOC_PUBLIC_BASE_URL", "").rstrip("/") + +def absolutize_url(url: str) -> str: + url = (url or "").strip() + if not url: + return url + if url.startswith("http://") or url.startswith("https://"): + return url + if LIFE_NOC_PUBLIC_BASE_URL: + if not url.startswith("/"): + url = "/" + url + return LIFE_NOC_PUBLIC_BASE_URL + url + return url def slugify(value: str) -> str: value = value.strip().lower() @@ -82,6 +96,7 @@ def render_mock_service(domain: str, group_name: str, item: dict) -> str: instructions_url = item.get("instructions_url", "").strip() if not instructions_url: instructions_url = f"/life-noc/item/{domain}/{name}" + instructions_url = absolutize_url(instructions_url) action_url = item.get("action_url", "").strip() mock_state = normalize_mock_state(item.get("mock_state", DEFAULT_MOCK_STATE)) mock_message = item.get("mock_message", DEFAULT_MOCK_MESSAGE).strip() or DEFAULT_MOCK_MESSAGE @@ -121,6 +136,7 @@ def render_probe_service(domain: str, group_name: str, item: dict) -> str: if not instructions_url: instructions_url = f"/life-noc/item/{domain}/{name}" action_url = item.get("action_url", "").strip() + instructions_url = absolutize_url(instructions_url) probe = item["probe"] probe_type = str(probe["type"]).strip() diff --git a/scripts/life_noc_input_api.py b/scripts/life_noc_input_api.py index fd665b9..552cb41 100644 --- a/scripts/life_noc_input_api.py +++ b/scripts/life_noc_input_api.py @@ -3,6 +3,8 @@ from __future__ import annotations from pathlib import Path +from urllib.parse import quote +import os import sys from fastapi import FastAPI, HTTPException, Form @@ -13,6 +15,24 @@ ROOT = Path(__file__).resolve().parents[1] if str(ROOT) not in sys.path: sys.path.insert(0, str(ROOT)) +from lib.life_noc_domains import ( # noqa: E402 + ALLOWED_FORM_MODES, + ALLOWED_METRIC_UNITS, + ALLOWED_ON_ERROR, + ALLOWED_PROBE_TYPES, + ALLOWED_SOURCE_TYPES, + THRESHOLD_FIELDS, + DomainsConflictError, + DomainsError, + delete_item, + get_domain_item, + item_to_form_values, + list_domain_items, + list_domains, + normalize_item_payload, + reorder_item, + upsert_item, +) from lib.life_noc_inputs import ( # noqa: E402 list_items, get_item, @@ -32,10 +52,198 @@ class CompleteInputRequest(BaseModel): origin: str = "manual" -app = FastAPI(title="Life-NOC Input API", version="1.0.0") +app = FastAPI(title="Life-NOC Input API", version="1.1.0") -def html_escape(value: str) -> str: +ADMIN_UI_ENABLED = os.environ.get("LIFE_NOC_ADMIN_UI_ENABLED", "0").strip().lower() in { + "1", + "true", + "yes", + "on", +} + + +BASE_CSS = """ + :root { + color-scheme: light; + --bg: #f5f7fb; + --card: #ffffff; + --border: #d9e0ea; + --text: #112033; + --muted: #5a697b; + --accent: #164c96; + --accent-soft: #eaf2ff; + --danger: #8b1e1e; + --ok: #0f6b3d; + } + * { box-sizing: border-box; } + body { + margin: 0; + background: var(--bg); + color: var(--text); + font-family: Arial, sans-serif; + line-height: 1.45; + } + main { + max-width: 920px; + margin: 0 auto; + padding: 1rem; + } + .stack { display: grid; gap: 1rem; } + .card { + background: var(--card); + border: 1px solid var(--border); + border-radius: 16px; + padding: 1rem; + box-shadow: 0 1px 2px rgba(0,0,0,0.03); + } + .hero { padding: 1rem; } + .muted { color: var(--muted); } + .state { font-size: 1.15rem; font-weight: bold; } + h1, h2, h3 { margin-top: 0; } + ul { padding-left: 1.2rem; } + code { + background: #eef2f7; + padding: 0.15rem 0.35rem; + border-radius: 6px; + } + a { color: var(--accent); text-decoration: none; } + a:hover { text-decoration: underline; } + .toolbar, .actions { + display: flex; + flex-wrap: wrap; + gap: 0.6rem; + align-items: center; + } + .actions form, .inline-form { display: inline-flex; margin: 0; } + .pill { + display: inline-block; + padding: 0.25rem 0.55rem; + border-radius: 999px; + background: var(--accent-soft); + color: var(--accent); + font-size: 0.9rem; + } + .button, button { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.35rem; + min-height: 44px; + padding: 0.75rem 1rem; + border-radius: 12px; + border: 1px solid #335b94; + background: #ffffff; + color: #163454; + font-size: 1rem; + cursor: pointer; + text-decoration: none; + } + .button.primary, button.primary { + background: var(--accent); + color: #fff; + border-color: var(--accent); + } + .button.danger, button.danger { + border-color: #b64b4b; + color: var(--danger); + } + .grid-cards { + display: grid; + gap: 0.9rem; + } + .row-between { + display: flex; + justify-content: space-between; + align-items: center; + gap: 1rem; + } + .item-title { + font-size: 1.05rem; + font-weight: bold; + margin: 0 0 0.35rem 0; + } + .form-grid { + display: grid; + gap: 0.85rem; + } + .form-grid.two { grid-template-columns: 1fr; } + label { + display: grid; + gap: 0.35rem; + font-size: 0.95rem; + font-weight: bold; + } + input[type="text"], input[type="date"], textarea, select { + width: 100%; + min-height: 44px; + padding: 0.75rem 0.8rem; + border-radius: 12px; + border: 1px solid #aebacc; + font: inherit; + background: #fff; + color: var(--text); + } + textarea { min-height: 100px; resize: vertical; } + .checks { + display: grid; + gap: 0.55rem; + } + .check { + display: flex; + align-items: center; + gap: 0.6rem; + font-weight: normal; + } + .check input { width: 20px; height: 20px; } + .section-title { + margin-bottom: 0.5rem; + font-size: 1.02rem; + } + details { + border: 1px solid var(--border); + border-radius: 14px; + background: #fcfdff; + padding: 0.15rem 0.85rem 0.85rem 0.85rem; + } + details + details { margin-top: 0.8rem; } + summary { + cursor: pointer; + font-weight: bold; + list-style: none; + padding: 0.9rem 0 0.6rem 0; + } + summary::-webkit-details-marker { display: none; } + .alert { + border: 1px solid #f2c5c5; + background: #fff4f4; + color: #7a1a1a; + border-radius: 12px; + padding: 0.85rem 1rem; + } + pre.yaml-preview { + white-space: pre-wrap; + word-break: break-word; + background: #0f1720; + color: #e8eef6; + padding: 1rem; + border-radius: 14px; + overflow-x: auto; + } + .mobile-sticky { + position: sticky; + bottom: 0; + background: rgba(245,247,251,0.96); + padding-top: 0.7rem; + } + @media (min-width: 760px) { + .form-grid.two { grid-template-columns: 1fr 1fr; } + .grid-cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } + } +""" + + +def html_escape(value: object) -> str: return ( str(value) .replace("&", "&") @@ -60,9 +268,244 @@ def resolve_instructions_url(domain: str, item_key: str, service: dict) -> str: return f"/life-noc/item/{domain}/{item_key}" +def page_shell(title: str, body: str) -> HTMLResponse: + html = f""" + + + + + {html_escape(title)} + + + +
{body}
+ +""" + return HTMLResponse(content=html) + + + +def require_admin_enabled() -> None: + if not ADMIN_UI_ENABLED: + raise HTTPException(status_code=404, detail="interface admin désactivée") + + + +def bool_attr(value: bool) -> str: + return " checked" if value else "" + + + +def option_tags(options: list[str], selected: str) -> str: + tags = [] + for value in options: + label = value if value else "—" + sel = " selected" if value == selected else "" + tags.append(f'') + return "".join(tags) + + + +def render_alert(message: str) -> str: + if not message: + return "" + return f'
{html_escape(message)}
' + + + +def render_domain_card(domain: str, items: list[dict]) -> str: + probed = sum(1 for item in items if isinstance(item, dict) and isinstance(item.get("probe"), dict)) + return f""" +
+
+
+

{html_escape(domain)}

+

{len(items)} item(s) · {probed} avec sonde réelle

+
+ Ouvrir +
+
+ """ + + + +def render_item_card(domain: str, item: dict, index: int, total: int) -> str: + name = str(item.get("name", "")).strip() + title = str(item.get("title") or name or "Item").strip() + summary = str(item.get("summary") or item.get("notes") or "").strip() + probe_type = str(item.get("probe", {}).get("type", "mock") if isinstance(item.get("probe"), dict) else "mock") + probe_badge = f'{html_escape(probe_type)}' + move_up = f""" +
+ + +
+ """ if total > 1 else "" + move_down = f""" +
+ + +
+ """ if total > 1 else "" + return f""" +
+
+
+

{html_escape(title)}

+

{html_escape(name)}

+

{html_escape(summary)}

+
+
{probe_badge}
+
+
+ Voir + Modifier + {move_up} + {move_down} +
+
+ """ + + + +def render_item_editor(domain: str, values: dict, action_url: str, heading: str, error_message: str = "") -> str: + thresholds_html = "".join( + f'''''' + for field in THRESHOLD_FIELDS + ) + yaml_preview = render_yaml_preview(values) + return f""" +
+
+ +

{html_escape(heading)}

+

Éditeur mobile-first optionnel de domains.yaml. Sauvegarde explicite, sans changer le flux runtime existant.

+
+ {render_alert(error_message)} +
+
+ Identité +
+ + + + +
+
+ +
+
+ +
+ Contexte et contenu +
+ + +
+
+ +
+ Liens +
+ + + +
+
+ +
+ Sonde +
+ + + + + + +
+
+ +
+ Seuils +
+ {thresholds_html} +
+
+ +
+ Comportement UI +
+ +
+
+ + +
+
+ +
+ Aperçu YAML +
{html_escape(yaml_preview)}
+
+ +
+
+
+ + Annuler +
+
+
+
+
+ """ + + + +def render_yaml_preview(values: dict) -> str: + try: + payload = normalize_item_payload(values) + except Exception: + payload = {k: v for k, v in values.items() if k not in {"domain"}} + import yaml + + return yaml.safe_dump(payload, sort_keys=False, allow_unicode=True, width=1000) + + @app.get("/health") def health() -> dict: - return {"status": "ok"} + return {"status": "ok", "admin_ui_enabled": ADMIN_UI_ENABLED} @app.get("/inputs/{domain}") @@ -118,138 +561,89 @@ def page_item(domain: str, item_key: str) -> HTMLResponse: allow_complete = bool(ui.get("allow_complete", probe_type == "elapsed_time")) allow_manual_edit = bool(ui.get("allow_manual_edit", True)) - links_html = "" - for fragment in [ - link_row("Notes", notes_url), - link_row("Instructions", instructions_url), - link_row("Action", action_url), - ]: - if fragment: - links_html += fragment - - summary_html = "" - if summary: - summary_html = f'

Résumé : {html_escape(summary)}

' + links_html = "".join( + fragment for fragment in [ + link_row("Notes", notes_url), + link_row("Instructions", instructions_url), + link_row("Action", action_url), + ] if fragment + ) or "
  • Aucun lien défini.
  • " + summary_html = f'

    Résumé : {html_escape(summary)}

    ' if summary else "" instructions_html = "" if instructions: instructions_html = f""" -
    -

    Instructions

    -
    {html_escape(instructions)}
    -
    -""" +
    +

    Instructions

    +
    {html_escape(instructions)}
    +
    + """ manual_form_html = "" if allow_manual_edit and form_mode == "complete_date": manual_form_html = f""" -
    -

    Mettre à jour la date

    -
    - - - -
    -
    -""" +
    +

    Mettre à jour la date

    +
    + + + +
    +
    + """ complete_form_html = "" if allow_complete: complete_form_html = f""" -
    -

    Action rapide

    -
    - -
    -
    -""" +
    +

    Action rapide

    +
    + +
    +
    + """ - html = f""" - - - - - Life-NOC — {html_escape(title)} - - - -
    -
    -

    {html_escape(title)}

    -

    État actuel : {html_escape(state)}

    -

    Type de sonde : {html_escape(probe_type)}

    - {summary_html} -
    + admin_link = "" + if ADMIN_UI_ENABLED: + admin_link = f'Admin' -
    -

    Dernier intrant

    -

    Valeur : {html_escape(current_input.get("value", ""))}

    -

    Capturé le : {html_escape(current_input.get("captured_at", ""))}

    -

    Origine : {html_escape(current_input.get("origin", ""))}

    -
    + body = f""" +
    +
    + Actualiser + {admin_link} +
    +

    {html_escape(title)}

    +

    État actuel : {html_escape(state)}

    +

    Type de sonde : {html_escape(probe_type)}

    + {summary_html} +
    -
    -

    Contexte

    -

    Domaine : {html_escape(domain)}

    -

    Item key : {html_escape(item_key)}

    -

    Notes : {html_escape(notes)}

    -
    +
    +

    Dernier intrant

    +

    Valeur : {html_escape(current_input.get('value', ''))}

    +

    Capturé le : {html_escape(current_input.get('captured_at', ''))}

    +

    Origine : {html_escape(current_input.get('origin', ''))}

    +
    - {instructions_html} +
    +

    Contexte

    +

    Domaine : {html_escape(domain)}

    +

    Item key : {html_escape(item_key)}

    +

    Notes : {html_escape(notes)}

    +
    -
    -

    Liens utiles

    -
      - {links_html} -
    -
    + {instructions_html} - {manual_form_html} - {complete_form_html} -
    - -""" - return HTMLResponse(content=html) +
    +

    Liens utiles

    +
      {links_html}
    +
    + + {manual_form_html} + {complete_form_html} + """ + return page_shell(f"Life-NOC — {title}", body) @app.post("/life-noc/item/{domain}/{item_key}/set") @@ -261,10 +655,7 @@ def page_set_item(domain: str, item_key: str, value: str = Form(...), origin: st except ValueError as exc: raise HTTPException(status_code=400, detail=str(exc)) - return RedirectResponse( - url=f"/life-noc/item/{domain}/{item_key}", - status_code=303, - ) + return RedirectResponse(url=f"/life-noc/item/{domain}/{item_key}", status_code=303) @app.post("/life-noc/item/{domain}/{item_key}/complete") @@ -276,7 +667,220 @@ def page_complete_item(domain: str, item_key: str, origin: str = Form(default="m except ValueError as exc: raise HTTPException(status_code=400, detail=str(exc)) - return RedirectResponse( - url=f"/life-noc/item/{domain}/{item_key}", - status_code=303, - ) + return RedirectResponse(url=f"/life-noc/item/{domain}/{item_key}", status_code=303) + + +@app.get("/life-noc/admin", response_class=HTMLResponse) +def admin_home() -> HTMLResponse: + require_admin_enabled() + domain_cards = [] + for domain in list_domains(): + items = list_domain_items(domain) + domain_cards.append(render_domain_card(domain, items)) + body = f""" +
    +

    Life-NOC Admin

    +

    Interface web optionnelle pour administrer domains.yaml sans casser le pipeline existant.

    +
    +
    {''.join(domain_cards)}
    + """ + return page_shell("Life-NOC Admin", body) + + +@app.get("/life-noc/admin/domain/{domain}", response_class=HTMLResponse) +def admin_domain(domain: str, error: str = "") -> HTMLResponse: + require_admin_enabled() + try: + items = list_domain_items(domain) + except KeyError: + raise HTTPException(status_code=404, detail="domaine introuvable") + cards = [render_item_card(domain, item, idx, len(items)) for idx, item in enumerate(items)] + body = f""" +
    + +

    Domaine : {html_escape(domain)}

    +

    {len(items)} item(s). Les boutons ↑ et ↓ réordonnent l’ordre des items dans domains.yaml.

    +
    + {render_alert(error)} +
    {''.join(cards)}
    + """ + return page_shell(f"Life-NOC Admin — {domain}", body) + + +@app.post("/life-noc/admin/domain/{domain}/{item_key}/move") +def admin_move_item(domain: str, item_key: str, direction: str = Form(...)) -> RedirectResponse: + require_admin_enabled() + try: + reorder_item(domain, item_key, direction) + except (DomainsError, KeyError) as exc: + target = f"/life-noc/admin/domain/{domain}?error={quote(str(exc))}" + return RedirectResponse(url=target, status_code=303) + return RedirectResponse(url=f"/life-noc/admin/domain/{domain}", status_code=303) + + +@app.get("/life-noc/admin/item/{domain}/{item_key}", response_class=HTMLResponse) +def admin_item(domain: str, item_key: str) -> HTMLResponse: + require_admin_enabled() + try: + item = get_domain_item(domain, item_key) + except KeyError: + raise HTTPException(status_code=404, detail="item introuvable") + values = item_to_form_values(item, domain) + yaml_preview = render_yaml_preview(values) + body = f""" +
    + +

    {html_escape(values.get('title') or item_key)}

    +

    {html_escape(item_key)}

    +
    +
    +

    Résumé

    +

    {html_escape(values.get('summary') or values.get('notes') or '')}

    +

    probe.type = {html_escape(values.get('probe_type') or 'mock')}

    +
    +
    +

    Aperçu YAML

    +
    {html_escape(yaml_preview)}
    +
    +
    +
    + +
    +
    + """ + return page_shell(f"Life-NOC Admin — {item_key}", body) + + +@app.get("/life-noc/admin/domain/{domain}/new", response_class=HTMLResponse) +def admin_new_item_form(domain: str, error: str = "") -> HTMLResponse: + require_admin_enabled() + try: + list_domain_items(domain) + except KeyError: + raise HTTPException(status_code=404, detail="domaine introuvable") + values = item_to_form_values(None, domain) + body = render_item_editor(domain, values, f"/life-noc/admin/domain/{domain}/new", f"Créer un item dans {domain}", error) + return page_shell(f"Life-NOC Admin — nouveau item {domain}", body) + + +@app.post("/life-noc/admin/domain/{domain}/new") +def admin_new_item_submit( + domain: str, + name: str = Form(...), + date: str = Form(default=""), + title: str = Form(default=""), + summary: str = Form(default=""), + notes: str = Form(default=""), + instructions: str = Form(default=""), + notes_url: str = Form(default=""), + instructions_url: str = Form(default=""), + action_url: str = Form(default=""), + probe_type: str = Form(default=""), + probe_source_type: str = Form(default=""), + probe_inputs_file: str = Form(default=""), + probe_item_key: str = Form(default=""), + metric_unit: str = Form(default=""), + policy_on_error: str = Form(default=""), + unknown_lt: str = Form(default=""), + ok_gte: str = Form(default=""), + warning_gte: str = Form(default=""), + critical_gte: str = Form(default=""), + unknown_gte: str = Form(default=""), + ok_lt: str = Form(default=""), + warning_lt: str = Form(default=""), + critical_lt: str = Form(default=""), + ui_form_mode: str = Form(default=""), + ui_allow_complete: str = Form(default=""), + ui_allow_manual_edit: str = Form(default=""), +) -> RedirectResponse: + require_admin_enabled() + form_values = { + key: value + for key, value in locals().items() + if key not in {"domain"} + } + try: + item = normalize_item_payload(form_values) + upsert_item(domain, item, original_item_key=None) + except (DomainsError, DomainsConflictError, KeyError) as exc: + return RedirectResponse(url=f"/life-noc/admin/domain/{domain}/new?error={quote(str(exc))}", status_code=303) + return RedirectResponse(url=f"/life-noc/admin/item/{domain}/{item['name']}", status_code=303) + + +@app.get("/life-noc/admin/item/{domain}/{item_key}/edit", response_class=HTMLResponse) +def admin_edit_item_form(domain: str, item_key: str, error: str = "") -> HTMLResponse: + require_admin_enabled() + try: + item = get_domain_item(domain, item_key) + except KeyError: + raise HTTPException(status_code=404, detail="item introuvable") + values = item_to_form_values(item, domain) + body = render_item_editor(domain, values, f"/life-noc/admin/item/{domain}/{item_key}/edit", f"Modifier {item_key}", error) + return page_shell(f"Life-NOC Admin — modifier {item_key}", body) + + +@app.post("/life-noc/admin/item/{domain}/{item_key}/edit") +def admin_edit_item_submit( + domain: str, + item_key: str, + name: str = Form(...), + date: str = Form(default=""), + title: str = Form(default=""), + summary: str = Form(default=""), + notes: str = Form(default=""), + instructions: str = Form(default=""), + notes_url: str = Form(default=""), + instructions_url: str = Form(default=""), + action_url: str = Form(default=""), + probe_type: str = Form(default=""), + probe_source_type: str = Form(default=""), + probe_inputs_file: str = Form(default=""), + probe_item_key: str = Form(default=""), + metric_unit: str = Form(default=""), + policy_on_error: str = Form(default=""), + unknown_lt: str = Form(default=""), + ok_gte: str = Form(default=""), + warning_gte: str = Form(default=""), + critical_gte: str = Form(default=""), + unknown_gte: str = Form(default=""), + ok_lt: str = Form(default=""), + warning_lt: str = Form(default=""), + critical_lt: str = Form(default=""), + ui_form_mode: str = Form(default=""), + ui_allow_complete: str = Form(default=""), + ui_allow_manual_edit: str = Form(default=""), +) -> RedirectResponse: + require_admin_enabled() + try: + existing = get_domain_item(domain, item_key) + except KeyError: + raise HTTPException(status_code=404, detail="item introuvable") + + form_values = { + key: value + for key, value in locals().items() + if key not in {"domain", "item_key", "existing"} + } + try: + item = normalize_item_payload(form_values, existing_item=existing) + upsert_item(domain, item, original_item_key=item_key) + except (DomainsError, DomainsConflictError, KeyError) as exc: + return RedirectResponse(url=f"/life-noc/admin/item/{domain}/{item_key}/edit?error={quote(str(exc))}", status_code=303) + return RedirectResponse(url=f"/life-noc/admin/item/{domain}/{item['name']}", status_code=303) + + +@app.post("/life-noc/admin/item/{domain}/{item_key}/delete") +def admin_delete_item(domain: str, item_key: str) -> RedirectResponse: + require_admin_enabled() + try: + delete_item(domain, item_key) + except (DomainsError, KeyError) as exc: + return RedirectResponse(url=f"/life-noc/admin/domain/{domain}?error={quote(str(exc))}", status_code=303) + return RedirectResponse(url=f"/life-noc/admin/domain/{domain}", status_code=303)