Le module broker-module-livedata permet la récupération via une api de certaines informations des éléments supervisé par Shinken. L'accès à cette API est restreinte aux détenteurs d'un token généré dans la configuration (modifiable par l'utilisateur) du module. Il se présente par défaut sous la forme d'une suite aléatoire de X chiffres/lettres. Le fonctionnement de l'api est tel que :
URL/V1/cluster/UUID?token=TOKEN
- Retourne
- cluster_uuid : text
- cluster_name : text
- cluster_display_name : text
- status : text
- OK
- WARNING
- CRITICAL
- UNKNOWN
- MISSING-DATA
- SHINKEN-INACTIVE
- status_since : epoch (en secondes)
- context : text
- NOTHING
- ACKNOWLEDGED
- PARTIAL-ACKNOWLEDGED
- INHERITED-ACKNOWLEDGED
- DOWNTIME
- PARTIAL-DOWNTIME
- INHERITED-DOWNTIME
- FLAPPING
- PARTIAL-FLAPPING
- DISABLED
- business_impact : 0, 1, 2, 3, 4, 5
- output : text
- long_output : text
- URL/V1/check-on-cluster/UUID?token=TOKEN
- Retourne
- check_uuid : text
- check_name : text
- check_display_name : text
- status : text
- OK
- WARNING
- CRITICAL
- UNKNOWN
- MISSING-DATA
- SHINKEN-INACTIVE
- status_since : epoch (en secondes)
- context : text
- NOTHING
- ACKNOWLEDGED
- PARTIAL-ACKNOWLEDGED
- INHERITED-ACKNOWLEDGED
- DOWNTIME
- PARTIAL-DOWNTIME
- INHERITED-DOWNTIME
- FLAPPING
- PARTIAL-FLAPPING
- DISABLED
- output : text
- business_impact : 0, 1, 2, 3, 4, 5
- long_output : text
- host_uuid : text
- host_name : text
- host_display_name : text
- business_impact : 0, 1, 2, 3, 4, 5
- status_since : epoch (en secondes)
- URL/V1/host/UUID?token=TOKEN
- Retourne
- host_uuid : text
- host_name : text
- host_display_name : text
- status : text
- OK
- WARNING
- CRITICAL
- UNKNOWN
- MISSING-DATA
- SHINKEN-INACTIVE
- status_since : epoch (en secondes)
- context : text
- NOTHING
- ACKNOWLEDGED
- PARTIAL-ACKNOWLEDGED
- INHERITED-ACKNOWLEDGED
- DOWNTIME
- PARTIAL-DOWNTIME
- INHERITED-DOWNTIME
- FLAPPING
- PARTIAL-FLAPPING
- DISABLED
- business_impact : 0, 1, 2, 3, 4, 5
- output : text
- long_output : text
- URL/V1/check-on-host/UUID?token=TOKEN
- Retourne
- check_uuid : text
- check_name : text
- check_display_name : text
- status : text
- OK
- WARNING
- CRITICAL
- UNKNOWN
- MISSING-DATA
- SHINKEN-INACTIVE
- status_since : epoch (en secondes)
- context : text
- NOTHING
- ACKNOWLEDGED
- PARTIAL-ACKNOWLEDGED
- INHERITED-ACKNOWLEDGED
- DOWNTIME
- PARTIAL-DOWNTIME
- INHERITED-DOWNTIME
- FLAPPING
- PARTIAL-FLAPPING
- DISABLED
- output : text
- business_impact : 0, 1, 2, 3, 4, 5
- long_output : text
- cluster_uuid : text
- cluster_name : text
- cluster_display_name : text
- business_impact : 0, 1, 2, 3, 4, 5
- status_since : epoch (en secondes)
URL étant l'adresse shinken sur le port 8000 (modifiable).
Essayer d'accéder à une API sans le token renverra une erreur.
Accéder à un hôte ou à un cluster inconnu renverra un champ unique (en plus de l'UUID) vous confirmant que l'hôte/cluster est introuvable.
Accéder à un check inexistant renverra une erreur. De même si vous essayez d'accéder à un check qui n'est pas rattaché à un hôte (dans le cas d'un check-on-host) ou à un cluster (dans le cas d'un check-on-cluster).