83 lines
1.8 KiB
Markdown
83 lines
1.8 KiB
Markdown
# Exploitation et dépannage Life-NOC
|
||
|
||
## 1. Vérifications utiles
|
||
|
||
### Vérifier l’API
|
||
|
||
```bash
|
||
curl http://127.0.0.1:8787/health
|
||
```
|
||
|
||
### Vérifier un intrant
|
||
|
||
```bash
|
||
curl http://127.0.0.1:8787/inputs/revue/revue-hebdomadaire-priorites
|
||
```
|
||
|
||
### Vérifier une page item
|
||
|
||
```bash
|
||
curl http://127.0.0.1:8787/life-noc/item/revue/revue-hebdomadaire-priorites
|
||
```
|
||
|
||
## 2. Cas fréquent : l’intrant change mais pas l’état dans Icinga
|
||
|
||
Cela signifie souvent qu’Icinga n’a pas encore refait le check.
|
||
|
||
Il faut alors :
|
||
|
||
- lancer un `Check Now` ;
|
||
- ou attendre le prochain check ;
|
||
- ou tester directement le plugin à la main.
|
||
|
||
## 3. Cas fréquent : route HTML absente après déploiement
|
||
|
||
Vérifier :
|
||
|
||
- que le service API tourne ;
|
||
- que le fichier déployé contient bien les routes HTML ;
|
||
- que les dépendances FastAPI sont installées, notamment `python3-multipart`.
|
||
|
||
## 4. Vérifier le service API
|
||
|
||
```bash
|
||
sudo systemctl status life-noc-input-api --no-pager
|
||
sudo journalctl -u life-noc-input-api -n 80 --no-pager
|
||
```
|
||
|
||
## 5. Vérifier directement un plugin
|
||
|
||
Exemple pour `elapsed_time` :
|
||
|
||
```bash
|
||
/usr/lib/nagios/plugins/check_life_noc_probe.py --probe-type elapsed_time --source-type manual_date --inputs-file /opt/life-noc/data/inputs/revue.yaml --item-key revue-hebdomadaire-priorites --unit days --unknown-lt 5 --ok-gte 5 --warning-gte 7 --critical-gte 10 --on-error critical --label revue-hebdomadaire-priorites
|
||
```
|
||
|
||
## 6. Déploiement
|
||
|
||
```bash
|
||
make check
|
||
make deploy-with-bpm
|
||
```
|
||
|
||
## 7. Dépendances API importantes
|
||
|
||
Le service API nécessite :
|
||
|
||
- `python3-fastapi`
|
||
- `python3-uvicorn`
|
||
- `python3-multipart`
|
||
|
||
## 8. État actuel validé
|
||
|
||
Éléments validés en pratique :
|
||
|
||
- Icinga Web 2 ;
|
||
- BPM natif ;
|
||
- servicegroups ;
|
||
- `Check Now` ;
|
||
- store d’intrants ;
|
||
- CLI ;
|
||
- API locale ;
|
||
- pages HTML d’item ;
|
||
- méthodes `elapsed_time` et `days_until_due`.
|