| Panel | ||||||
|---|---|---|---|---|---|---|
| ||||||
|
Présentation
Le module architecture-export effectue trois étapes types d'actions distinctes :
- Modification de la configuration de NagVis afin de permettre la communication entre NagVis et Shinken
- Envoi de l'architecture aux différents recepteurs récepteurs ( autres installation de Shinken )
- Création des cartes d'une architecture Shinken pour NagVis
Chaque action est retranscrite dans les logs de l'arbiterArbiter.
Les logs de modification de la configuration de NagVis
Re-écrire sous forme d'une indication
| Note |
|---|
La modification/lecture de la configuration de NagVis est visible 2 fois. Ceci est dû au fait que nous fournissons deux installations NagVis distincts : nagvis-shinken-architecture, qui est celui sur lequel nous mettons à disposition des cartes générées automatiquement nagvis, qui lui ne contient aucune carte générée par Shinken |
Lecture de la configuration du module
Au démarrage du module, celui-ci va commencer par lire sa propre configuration afin de vérifier que les informations sont bonnes (voir HIDDEN - 001 - Module architecture-export)
En INFO seront affichés les étapes de lecture de la configuration. En DEBUG seront affichés les détails de lecture de la configuration, tels que les paramètres récupérés.
Exemple
Voici un exemple d'une lecture de configuration du module ayant réussie
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ READING CONFIGURATION ] Broker found from parameter [ architecture_export__broker_connection__broker_name ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ READING CONFIGURATION ] Broker [ broker ] found [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ READING CONFIGURATION ] WebUI module found from parameter [ architecture_export__broker_connection__broker_webui ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ READING CONFIGURATION ] The WebUI address is [ localhost ], we will use its public address [ http://192.168.1.119:7767 ] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ READING CONFIGURATION ] Livestatus module found from parameter [ architecture_export__broker_connection__broker_livestatus ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ READING CONFIGURATION ] The Livestatus address is [ localhost ], we will use its public address [ 192.168.1.119:50000 ] for WebUI redirection |
Cas d'erreurs
Si le Broker renseigné dans le paramètre architecture_export__broker_connection__broker_name est introuvable, l'édition du fichier de configuration de NagVis sera annulée et ce message apparaîtra
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] ERROR : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ READING CONFIGURATION ] The broker [ broker ] set with parameter [ architecture_export__broker_connection__broker_name ] do not exists. Abort edition of the nagvis config file |
Si le paramètre architecture_export__broker_connection__broker_webui_communication_type ( reférence vers la page de configuration ) est à "module" et que le module WebUI renseigné dans le paramètre architecture_export__broker_connection__broker_webui_target est introuvable, l'édition de la configuration de la communication entre NagVis et le module WebUI sera annulée et ce message apparaîtra
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] ERROR : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ READING CONFIGURATION ] The WebUI module [ WebUI ] set with parameter [ architecture_export__broker_connection__broker_webui_target ] do not exists on the Broker [ broker-master ], we will not change the configuration of the communication between NagVis and the WebUI |
Si le module Livestatus renseigné dans le paramètre architecture_export__broker_connection__broker_livestatus est introuvable, l'édition de la configuration de la communication entre NagVis et le module Livestatus sera annulée et ce message apparaîtra
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] ERROR : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ READING CONFIGURATION ] The Livestatus module [ Livestatus ] set with parameter [ architecture_export__broker_connection__broker_livestatus ] do not exists on the Broker [ broker-master ], we will not change the configuration of the communication between NagVis and the Livestatus |
Edition/Lecture de la configuration de NagVis
Après la lecture de la configuration du module, celui-ci va être face à deux options :
- Si la configuration est bonne, la configuration de NagVis sera systématiquement mise à jour.
- Sinon, il va simplement lire la configuration de NagVis afin de connaître son état actuel
En INFO seront affichés les différentes étapes. En DEBUG seront affichés les détails, tels que les paramètres récupérés.
Exemples
Voici un exemple d'une modification de la configuration de NagVis ayant réussie
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] UPDATING connection between NagVis and Shinken modules [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] Editing /etc/shinken/external/nagvis/etc/nagvis.ini.php file [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] - Setting WebUI connection to allow redirection on NagVis maps [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "shinken_auth_protocol" parameter set to [ http ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "shinken_auth_port" parameter set to [ 7767 ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "shinken_auth_address" parameter set to [ 192.168.1.119 ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "hosturl" parameter set to [ http://192.168.1.119:7767/detail-by-name/[host_name] ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "serviceurl" parameter set to [ http://192.168.1.119:7767/detail-by-name/[host_name]/checks/[service_description] ] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] - Setting Livestatus connection to get Shinken objects status [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "socket" parameter set to [ socket="tcp:192.168.1.119:50000" ] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] File /etc/shinken/external/nagvis/etc/nagvis.ini.php edited [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] UPDATING connection between NagVis and Shinken modules [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] Edit /opt/nagvis/etc/nagvis.ini.php file [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] - Setting WebUI connection to allow redirection on NagVis maps [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "shinken_auth_protocol" parameter set to [ http ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "shinken_auth_port" parameter set to [ 7767 ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "shinken_auth_address" parameter set to [ 192.168.1.119 ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "hosturl" parameter set to [ http://192.168.1.119:7767/detail-by-name/[host_name] ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "serviceurl" parameter set to [ http://192.168.1.119:7767/detail-by-name/[host_name]/checks/[service_description] ] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] - Setting Livestatus connection to get Shinken objects status [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "socket" parameter set to [ socket="tcp:192.168.1.119:50000" ] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] File /opt/nagvis/etc/nagvis.ini.php edited |
Si une erreur de configuration est présente, l'architecture-export lira simplement la configuration de NagVis afin d'afficher son état actuel
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] ================================================================= [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] DUE TO CONFIGURATION ERROR, The connection between NagVis and Shinken modules will NOT be updated [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] ================================================================= [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] Reading /etc/shinken/external/nagvis/etc/nagvis.ini.php file [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] - No WebUI module found, we will keep previous NagVis configuration. Redirection to WebUI on NagVis maps may not work properly [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "shinken_auth_protocol" parameter not changed. It is still [ http ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "shinken_auth_port" parameter not changed. It is still [ 7767 ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "shinken_auth_address" parameter not changed. It is still [ 192.168.1.119 ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "hosturl" parameter not changed. It is still [ http://192.168.1.119:7767/detail-by-name/[host_name] ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "serviceurl" parameter not changed. It is still [ http://192.168.1.119:7767/detail-by-name/[host_name]/checks/[service_description] ] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] - No Livestatus module found, we will keep previous NagVis configuration. Status of Shinken elements on NagVis maps may not work properly [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] => "socket" parameter not changed. It is still [ socket="tcp:192.168.1.119:50000" ] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] The connection between NagVis and Shinken modules will not be changed [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] Read /opt/nagvis/etc/nagvis.ini.php file [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] - No WebUI module found, we will keep previous NagVis configuration. Redirection to WebUI on NagVis maps may not work properly [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "shinken_auth_protocol" parameter not changed. It is still [ http ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "shinken_auth_port" parameter not changed. It is still [ 7767 ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "shinken_auth_address" parameter not changed. It is still [ 192.168.1.119 ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "hosturl" parameter not changed. It is still [ http://192.168.1.119:7767/detail-by-name/[host_name] ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "serviceurl" parameter not changed. It is still [ http://192.168.1.119:7767/detail-by-name/[host_name]/checks/[service_description] ] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] - No Livestatus module found, we will keep previous NagVis configuration. Status of Shinken elements on NagVis maps may not work properly [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis ] [ CONFIGURATION ] => "socket" parameter not changed. It is still [ socket="tcp:192.168.1.119:50000" ] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter ] [ ARCHITECTURE-EXPORT ] [ nagvis-shinken-architecture ] [ CONFIGURATION ] ================================================================= |
Les logs d'envoi/réception d'architecture
Un module architecture-export peut envoyer et recevoir une architecture.
Chaque architecture reçue sera cartographiée sur le module l'ayant reçu.
Envoi de son architecture
Au démarrage, l'architecture-export va envoyer son architecture à tous les "recipients" configurés dans le module.
Nous affichons alors des logs :
- En INFO il est possible de voir le nombre d'envoi à effectuer
- En DEBUG il est possible de voir chaque envoi un à un
Exemple
Mettre 2 récipients
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ NOM_DE_L'ARCHITECTURE ] Sending architecture to 2 recipients [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ NOM_DE_L'ARCHITECTURE ] Sending architecture to [http://127.0.0.1:7780] |
Cas d'erreurs
Si une adresse ne commence pas par 'http' ou 'https' cette erreur apparaîtra :
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] ERROR : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] External export module address '127.0.0.1' has an incorrect format (does not start with 'http://' or 'https://'). Skipping sending info to this address. |
Si le port d'une addresse n'a pas été spécifié, cette erreur apparaîtra :
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] ERROR : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] No port specified in the external export module address '127.0.0.1'. Skipping sending info to this address. |
Réception d'une architecture
Lors de la réception d'une architecture, nous la sauvegardons temporairement dans un fichier json afin de préserver son état. Ceci permet au redémarrage de l'Arbiter de connaître les architectures présentes sur son module.
Nous affichons les logs suivants :
- En INFO un log s'affiche dès la réception d'une architecture
- En DEBUG il est possible de voir l'adresse de l'envoi et le chemin d'accès au fichier
Exemple
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ NOM_DE_L'ARCHITECTURE ] 127.0.0.1 ask me to map its architecture [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ NOM_DE_L'ARCHITECTURE ] The Architecture have been received, we will make its maps [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ NOM_DE_L'ARCHITECTURE ] Save broks contents /var/lib/shinken/architecture_export_received.json |
Les logs de création de carte NagVis
La création des cartes NagVis liées à une architecture se fait en plusieurs étapes. Chaque log commencera par :
| Code Block | ||||
|---|---|---|---|---|
| ||||
[ ARCHITECTURE-EXPORT ] [ NOM_DE_L'ARCHITECTURE_RECUE ] [ MAP GENERATOR ] |
Récupération des hôtes existants sur le listener-shinken
Avant tout, il nous faut récupérer les hôtes existant sur le listener-shinken étant lié à l'architecture que nous allons cartographier.
Nous affichons alors des logs expliquant ce qui a été trouvé :
- En INFO il est possible de voir le nombre d'hôtes trouvés
- En DEBUG il est possible de voir l'id de chaque hôte
Exemple
Voici un exemple de récupération d'hôtes auprès du listener-shinken
Voir si on peut mettre les noms à la place?
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Retrieving hosts corresponding to this architecture from the Synchronizer (listener-shinken) [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Found [ core-hosts-e5b9fbe9a5524699a0555b22b1f7ac46 ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Found [ core-hosts-2230fc02fd434f24994b4bc707e755f3 ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Found [ core-hosts-39634f95d5d442acbdbfa1ea8b3ea35b ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Found [ core-hosts-29152912969c436898b717476149e509 ] [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Found [ core-hosts-a3736b15911e4ba0b4c176cee1a8e599 ] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Found 5 hosts |
Cas d'erreurs
Si l'architecture-export essaye de communiquer avec le listener-shinken en HTTPS alors qu'il ne l'est pas, une erreur apparaîtra et la création de la map sera abandonnée. Pour régler ce problème, il faut modifier la configuration du module (voir HIDDEN - 001 - Module architecture-export)
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Retrieving hosts corresponding to this architecture from the Synchronizer (listener-shinken) [AAAA-MM-DD HH:MM:SS] ERROR : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Try to request the listener with HTTPS, but it failed. Verify if your listener-shinken is on HTTPS |
Si les identifiants de connexion au listener-shinken sont incorrectincorrects, une erreur apparaîtra et la création de la map sera abandonnée. Pour régler ce problème, il faut modifier la configuration du module (voir voir HIDDEN - 001 - Module architecture-export)
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Retrieving hosts corresponding to this architecture from the Synchronizer (listener-shinken) [AAAA-MM-DD HH:MM:SS] ERROR : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Bad login and password for the listener |
Création de la liste des hôtes à partir de l'architecture reçue
Une fois les hôtes déjà disponible sur le listener-shinken récupérés, nous devons en modifier/créer pour être en accord avec l'architecture reçue
- En INFO, le nombre d'hôtes générés
- En DEBUG, chaque hôte généré est affiché
Exemple
Voici l'exemple d'une génération d'un hôte de l'architecture reçue
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Building host list from architecture description received [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Host [ Shinken - ALL - localhost ] generated [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => 1 host generated |
Envoi des hôtes au listener-shinken
Lorsque tous les hôtes liés à l'architecture sont générés, nous les envoyons au listener-shinken
- En INFO, le nombre d'hôtes envoyés
- En DEBUG, chaque hôté envoyé est affiché
Exemple
Voici un exemple de l'envoi d'un hôte vers le listener-shinken
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Sending hosts to Synchronizer (via listener-shinken) [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Sending [ Shinken - ALL - localhost ] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => 1 host sent |
Cas d'erreurs
Si l'architecture-export essaye de communiquer avec le listener-shinken en HTTPS alors qu'il ne l'est pas, une erreur apparaîtra et la création de la map sera abandonnée. Pour régler ce problème, il faut modifier la configuration du module (voir HIDDEN - 001 - Module architecture-export)
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Sending hosts to Synchronizer (via listener-shinken) [AAAA-MM-DD HH:MM:SS] ERROR : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Try to request the listener with HTTPS, but it failed. Verify if your listener-shinken is on HTTPS |
Si les identifiants de connexion au listener-shinken sont incorrect, une erreur apparaîtra et la création de la map sera abandonnée. Pour régler ce problème, il faut modifier la configuration du module (voir HIDDEN - 001 - Module architecture-export)
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Sending hosts to Synchronizer (via listener-shinken) [AAAA-MM-DD HH:MM:SS] ERROR : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Bad login and password for the listener |
Désactivation des hôtes obsolètes
Des hôtes, trouvés dans le listener-shinken, liés à l'architecture reçue peuvent être obsolètes suite à une modification de l'architecture. Nous les désactivons alors du listener-shinken.
- En INFO, le nombre d'hôtes désactivés
- En DEBUG, l'id de chaque hôte désactivé est affiché
Exemple
Voici un exemple d'une désactivation d'hôtes obsolètes
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Disabling old hosts to Synchronizer (via listener-shinken) [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Old host found, we disable it [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Old host [core-hosts-2230fc02fd434f24994b4bc707e755f3] disabled on synchronizer [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Old host found, we disable it [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Old host [core-hosts-39634f95d5d442acbdbfa1ea8b3ea35b] disabled on synchronizer [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Old host found, we disable it [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Old host [core-hosts-e5b9fbe9a5524699a0555b22b1f7ac46] disabled on synchronizer [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Old host found, we disable it [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Old host [core-hosts-0ca171601a184deba6309f98b2dfdc76] disabled on synchronizer [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Old host found, we disable it [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Old host [core-hosts-29152912969c436898b717476149e509] disabled on synchronizer [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => 5 hosts disabled |
Suppression des images des cartes NagVis obsolètes
Avant de créer les nouvelles cartes, il faut supprimer les anciennes afin de ne pas avoir de doublons et de ne pas charger le disque. Les cartes sont découpées en deux parties :
- Le fond, qui est une image générée par l'architecture-export
- Le fichier de configuration, qui est généré par l'architecture-export et équivaut aux positions des éléments Shinken dans la carte
Nous commençons par supprimer les fonds.
- En DEBUG, le chemin de chaque fichier supprimé est affiché
Exemple
Voici un exemple d'une suppression de fonds de cartes NagVis
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Removing obsolete NagVis maps backgrounds [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => [ /etc/shinken/external/nagvis/share/userfiles/images/maps/background_[Shinken] _Royaume:_All2021519148-e1bca43a-cdac-4411-9691-870a625b911b.png ] removed [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => [ /etc/shinken/external/nagvis/share/userfiles/images/maps/background_[Shinken] _Architecture_Shinken2021519148-e1bca43a-cdac-4411-9691-870a625b911b.png ] removed |
Suppression des fichiers de configuration des cartes NagVis obsolètes
Après avoir supprimé les fonds des cartes, il faut supprimer les fichiers de configuration.
- En DEBUG, le chemin de chaque fichier supprimé est affiché
Exemple
Voici un exemple d'une suppression de fichiers de configuration NagVis
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Removing obsolete NagVis maps configuration [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => [ /etc/shinken/external/nagvis/etc/maps/shinken_global-e1bca43a-cdac-4411-9691-870a625b911b.cfg ] removed [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => [ /etc/shinken/external/nagvis/etc/maps/shinken_architecture-e1bca43a-cdac-4411-9691-870a625b911b.cfg ] removed [AAAA-MM-DD HH:MM:SS] DEBUG : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => [ /etc/shinken/external/nagvis/etc/maps/All-e1bca43a-cdac-4411-9691-870a625b911b.cfg ] removed |
Calcul de la taille des royaumes pour les cartes NagVis
Les cartes NagVis sont sous forme de blocs imbriqués. Pour pouvoir les créer il faut alors assigner une taille de bloc à chaque royaume. Pour se faire, nous calculons leur taille selon leur contenu :
- Taille initiale du royaume
- Taille des sous-royaumes
- Taille des hôtes
- Nombre de checks
Exemple
Voici un exemple d'un calcul de la taille réussi
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Computing architecture objects size |
Tri des royaumes par taille
Nous trions les royaumes par taille afin d'avoir un rendu agréable à l'œil
Exemple
Voici un exemple d'un tri réussi
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Sorting realms |
Génération des cartes NagVis
C'est à cette étape que les cartes NagVis sont générées. Il y a au total 4 types de fichiers :
- Un arbre représentant tous les royaumes
- Une carte détaillée de tous les royaumes
- Une carte détaillée par royaume
- Un fichier de configuration de rotation, permettant de faire défiler les cartes NagVis d'une même architecture
Chaque création de fichier est affiché dans les logs
Exemple
Voici un exemple de génération ayant réussie
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Generating Nagvis maps [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Generating realms tree NagVis map [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Generating detailed architecture NagVis map [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Generating NagVis map for realm [All] [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Generating rotation configuration for NagVis maps |
Sauvegarde des hôtes listener-shinken dans un fichier de rétention
Afin d'éviter de renvoyer des requêtes au listener-shinken à chaque réception d'architecture, nous sauvegardons l'état des hôtes du listener-shinken dans un fichier.
- En DEBUG, le chemin du fichier de rétention est affiché
Exemple
Voici un exemple de sauvegarde de rétention ayant réussie
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Saving hosts sent to listener in retention file [AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => listener hosts mapping saved in /var/lib/shinken/architecture_export_hosts_mapping.json |
Cas d'erreurs
Si l'architecture-export n'a pas les droits d'écriture sur le fichier de rétention, cette erreur apparaîtra et la sauvegarde sera abandonnée
| Code Block | ||||
|---|---|---|---|---|
| ||||
[AAAA-MM-DD HH:MM:SS] INFO : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] - Saving hosts sent to listener in retention file [AAAA-MM-DD HH:MM:SS] ERROR : [ arbiter-master ] [ ARCHITECTURE-EXPORT ] [ Shinken ] [ MAP GENERATOR ] => Permission denied on /var/lib/shinken/architecture_export_hosts_mapping.json |