Introduction
Le module architecture-export permet de recevoir et envoyer la description de l'architecture d'installations Shinken, et d'en générer des cartes NagVis et hôtes Shinken associés envoyés aux Synchronizers pour la supervision.
Une description détaillée de ce module, son utilité et son utilisation sont présentes dans les pages de documentations associées: Visualiser l'architecture de son installation Shinken
Ci-dessous sont présentées de manière synthétique les différentes options de configuration de ce module, leur rôle ainsi que leurs valeurs par défaut.
Configuration du module
Le module architecture-export est configurable via le fichier de configuration suivant: /etc/shinken/modules/architecture-export.cfg
Les paramètres modifiables dans le fichier sont les suivants:
| Code Block | ||
|---|---|---|
| ||
#=============================================================================== # Architecture-Export #=============================================================================== # ModuleDaemons that can load this module: # - arbiter # This module exports Shinken architecture export daemon map from arbiter:to others architecture-export modules # It also creates NagVis Maps for received architecture #=============================================================================== define module { #======== Module identity ========= # Module name. Must be unique module_name ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ # # │ ────────────────────────────────────── MODULE IDENTITY ────────────────────────────────────── │ # # └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ architecture-export# # ─── Module type (to load module code). Do not edit. name [ Must be unique ] module_type architecture_export #======== File path ========= # path: Path of NagVis installation to save the maps configuration files in. Default value is defined[ byMANDATORY Shinken] installation.─── pathmodule_name /etc/shinken/external/nagvis #======== Architecture description communication ========= # This module opens a listeningarchitecture-export socket on which other# shinken─── installationsModule willtype send[ theirDo architecturenot description. edit ] # When an architecture description is received by the module, it creates corresponding hosts and NagVis maps. # host: interface used for the listening socket (0.0.0.0 = all interfaces) host [ MANDATORY 0.0.0.0 ] ─── #module_type Port to use for the listening socket port 7780 # 0 = Use HTTP, 1 = Use HTTPS architecture-export # ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ # use_ssl# │ ───────────────────────────────────── NAGVIS FILE PATH ────────────────────────────────────── │ # 0 # └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ # ssl_cert # ─── Path of NagVis installation /etc/shinken/certs/server.cert ssl_key /etc/shinken/certs/server.key # Name with which this Shinken installation will be identified in the NagVis maps # The following characters are forbidden in the architecture name: ~!$%^&*"'|<>?,()=/+ architecture_name Shinken─── # Base─── ofUsed URLto usedstore toconfiguration displaymaps linksfiles inand theto Visualizationupdate UI NagVis settings # Defaults to Arbiter URL if empty # map_base_url http://example.com/ # Architecture description recipients # ─── When the architecture of# this>>> ShinkenDefault installation changes (realms and daemons configuration), : /etc/shinken/external/nagvis # and the arbiter is restarted the architecture description will be sent to the following hosts. send_my_architecture_to_recipients http://127.0.0.1:7780 # Connection to the shinken-listener # if the connexion parameter to the shinken-listener has been changed, set the new value here.─── #listener_use_sslpath 0 #listener_login login /etc/shinken/external/nagvis #listener_password# ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ # # │ ────────────────────────────────────── MODULE OPTIONS ─────────────────────────────────────── │ pass# # =================================== └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ # Broker connection# parameters─── Base of ============================================== # #URL used to display links in the Visualization UI ─── # >>> Default : Use Arbiter URL ─── # map_base_url http://example.com/ # ─── Architecture description recipients ─── # ─── When the architecture of this Shinken installation changes (realms and daemons configuration), ─── # ─── and the arbiter is restarted the architecture description will be sent to the following hosts. ─── # >>> Default : http://127.0.0.1:7780 (locally) ─── send_my_architecture_to_recipients http://127.0.0.1:7780 # ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ # # │ ─────────────────────────────────── MODULE COMMUNICATION ──────────────────────────────────── │ # # └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ # # ─────────── Listening socket configuration ──────────────────────────────────────────────────────────── # ─── This module opens a listening socket on which other Shinken installations ─── # ─── will send their architecture description. ─── # ─── Network interface used for the listening socket (0.0.0.0 = all interfaces) ─── # >>> Default : 0.0.0.0 ─── host 0.0.0.0 # ─── Port to use for the listening socket ─── # >>> Default : 7780 ─── port 7780 # ─── Protocol to use for the listening socket ─── # ─── Enable : 1 ( Use HTTPS ) ─── # >>> Disable : 0 ( Use HTTP ) ( Default ) ─── use_ssl 0 # ─── SSL Certificate to use for the listening socket (if HTTPS) ─── # >>> Default : /etc/shinken/certs/server.cert ─── ssl_cert /etc/shinken/certs/server.cert # ─── SSL Key to use for the listening socket (if HTTPS) ─── # >>> Default : /etc/shinken/certs/server.key ─── ssl_key /etc/shinken/certs/server.key # ───────── Connection with the listener-shinken ──────────────────────────────────────────────────────── # ─── Connection parameters for the module to communicate with the listener-shinken ─── # ─── (used to create hosts for maps) ─── # ─── Protocol used by listener-shinken ─── # ─── Enable : 1 ( Use HTTPS ) ─── # >>> Disable : 0 ( Use HTTP ) ( Default ) ─── # listener_use_ssl 0 # ─── Listener-shinken configured login ─── # >>> Default : Shinken ─── # listener_login login # ─── Listener-shinken configured password ─── # >>> Default : Default password generated for listener-shinken ─── # listener_password pass # ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ # # │ ───────────────────────────────── MAPS CREATION PARAMETERS ───────────────────────────────── │ # # └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ # # ─── When an architecture description is received by the module, ─── # ─── it creates corresponding hosts and NagVis maps. ─── # ─── Name with which this Shinken installation will be identified in the NagVis maps ─── # ─── The following characters are forbidden in the architecture name: ~!$%^&*"'|<>?,()=/+ ─── # >>> Default : Shinken # # --- These parameters are used to allow nagvis to communicate with the Broker and modules you want --- # --- Name of the Broker holding the modules you want nagvis to communicate with─── architecture_name ---Shinken # >>>┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ # DEFAULT : broker-master # │ ─────────────────────────────── BROKER CONNECTION PARAMETERS ──────────────────────────────── │ # # └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ # # ─── These parameters are used to allow nagvis to communicate with the Broker and modules you want ─── # ─── Name of the Broker holding the modules you want nagvis to communicate with ---─── # architecture_export__broker_connection__broker_name>>> Default : broker-master broker-master # --- Name of the Livestatus module you want nagvis to communicate with to retrieve objects information ─── ---# architecture_export__broker_connection__broker_name broker-master # >>> DEFAULT : Livestatus ─── Name of the Livestatus module you want nagvis to communicate with to retrieve objects information ─── # >>> Default : Livestatus ---─── # architecture_export__broker_connection__broker_livestatus Livestatus # ─── Type of the target WebUI you want to communicate with Livestatus # --- Name of the─── WebUI module you want# nagvis─── toThis redirectallow youredirection when clicking on object on the mapmaps --- # --- This parameter cannot be used with the parameter architecture_export__broker_connection__broker_webui_redirect ---─── # >>> DEFAULTmodule : WebUI Use a WebUI module configuration for the communication ( Default ) ─── # ─── url : Use an url for the communication ---─── # architecture_export__broker_connection__broker_webui_communication_type module # ─── Targetted WebUI to communicate with WebUI # --- Custom WebUI redirection. It allows you to specify─── a custom address to# your─── WebUIIf previous parameter is set to "module", this must be a WebUI name --- # --- This parameter cannot be used with the─── parameter architecture_export__broker_connection__broker_webui # ─── If previous parameter is set to --- # >>> DEFAULT : None"url", this must be an url ─── # >>> Default : WebUI --- # architecture_export__broker_connection__broker_webui_redirect ─── # 127.0.0.1:7767 } architecture_export_broker_connection_broker_webui_target WebUI } |
Le rôle de chaque paramètre et les valeurs possibles sont décrits dans le tableau suivant:
Nom du paramètre | Description | Valeur par défaut | ||
|---|---|---|---|---|
host | Adresse de l'interface utilisée pour l'écoute sur le port 7780. Pour écouter sur toutes les interfaces, utiliser l'adresse 0.0.0.0 | 0.0.0.0 | ||
port | Port utilisé pour communiquer avec le module architecture-export | 7780 | ||
use_ssl | Booléen (0 ou 1) qui indique si le module architecture-export doit communiquer via SSL (utiliser la valeur 1 pour forcer la communication via SSL) | 0 | ||
ssl_cert | Chemin vers le fichier de certificat SSL | /etc/shinken/certs/server.cert | ||
ssl_key | Chemin vers le fichier de clé SSL | /etc/shinken/certs/server.key | ||
architecture_name | Nom de l'architecture affichée dans l'interface de Visualisation | Shinken | ||
map_base_url | Domaine à utiliser pour la construction des liens vers les cartes dans l'interface de Visualisation. Par défaut, l'adresse de l'Arbiter est utilisée. Pour que les liens vers NagVis dans le menu Architecture de l'interface de Visualisation pointent vers https://mon-domaine.fr/adresse-de-nagvis..., il faut utiliser la valeur "https://mon-domaine.fr/" pour ce paramètre. | adresse de l'Arbiter | ||
send_my_architecture_to_recipients | Liste des modules architecture-export distants auxquels il faut envoyer les informations d'architecture, séparés par des virgules. Ces modules distants vont générer les hôtes et cartes NagVis dans leur installations Shinken respectives. | http://127.0.0.1:7780 | ||
listener_use_ssl | Lors de la réception d'une description d'architecture, indique si la communication avec le listener Shinken pour la création des hôtes Shinken associés à cette architecture doit se faire via SSL. Pour que cela fonctionne, il faut également que la communication via SSL soit activée dans les réglages du listener-shinken (faisable depuis l'interface de Configuration) | 0 | ||
listener_login | Lors de la réception d'une description d'architecture, indique le nom d'utilisateur à utiliser pour la connexion avec le listener-shinken pour la création des hôtes Shinken associés à cette architecture | Shinken | ||
listener_password | Lors de la réception d'une description d'architecture, indique le mot de passe à utiliser pour la connexion avec le listener-shinken pour la création des hôtes Shinken associés à cette architecture | mot de passe par défaut du listener | ||
| architecture_export__broker_connection__broker_name | Nom du Broker sur lequel sont les modules WebUI et Livestatus avec lesquels NagVis communiquera | broker-master | ||
| architecture_export__broker_connection__broker_livestatus | Nom du module de type Livestatus sur lequel NagVis récupérera les informations des éléments Shinken afin d'afficher leurs statuts sur les cartes | Livestatus | ||
| architecture_export__broker_connection__broker_webui | Nom du module de type WebUI vers lequel NagVis redirigera l'utilisateur lorsqu'il clique sur un élément Shinken d'une carte | WebUI | ||
| architecture_export__broker_connection__broker_webui_redirect | Permet de définir une adresse personnalisée pour la redirection vers la WebUI.
| Aucun |
Plus de détails sur le fonctionnement du module architecture-export et sur ces paramètres sont disponibles dans la page de documentation dédiée: Activation et configuration de la fonctionnalité
Envoi de la description de l'architecture
L'envoi de la description de l'architecture aux destinataires choisis (paramètre send_my_architecture_to_recipients) est déclenché au démarrage du module architecture-export, c'est-à-dire au démarrage du démon Arbiter.
Il est également possible de déclencher cet envoi manuellement, sans avoir à redémarrer le démon Arbiter, en envoyant une requête HTTP POST à l'URL suivante:
| Code Block |
|---|
adresse_arbiter:7780/v1/architecture/send |
Par exemple avec cURL:
| Code Block |
|---|
curl -v -X POST adresse_arbiter:7780/v1/architecture/send |