[MODULE-CODE-LOADING - Import du code des modules depuis /var/lib/shinken/modules
Les démons vont lister les répertoires dans /var/lib/shinken/modules et vont tenter de charger chaque module.
Ceci va créer une entrée DEBUG:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:36] DEBUG : [broker-master ] [modules-manager ] [MODULE-CODE-LOADING] [directory=architecture-export ] Starting to load the module code directory /var/lib/shinken/modules/architecture-export. |
Quand l'import est effectué, on aura une ligne en DEBUG:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:36] DEBUG : [broker-master ] [modules-manager ] [MODULE-CODE-LOADING] [directory=architecture-export ] [0.021s] Module code was loaded. Did import 10 python new librairies (PIL,PIL.Image,PIL.ImageMode,PIL._binary,_imaging,architecture-export,architecture-export.mapper,shinken.webui.bottlewebui,shinken.webui.bottlewebui.ext,shinken.webui.cherrypybackend). |
Ceci donne le temps de chargement, mais également les nouvelles librairies importées.
Log INFO:
Une fois les modules chargé À la fin des chargements, il y a un résumé en INFO qui est affiché avec les modules éligibles à ce démon/module:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] INFO : [broker-master ] [ modules-manager ] [MODULE-CODE-LOADING] A total of 9 Shinken Enterprise modules are available for this daemon/module (broker): broker-module-livedata, event-container, graphite-perfdata, livestatus, simple-log, sla, trending, webui, MODULE-CODE-NAME (on a total of 40, loaded in 1.844s) |
Log WARNING:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] WARNING : [ broker-master ] [ modules-manager ] [MODULE-CODE-LOADING] [directory=architecture-export] - 'import architecture-export.my_file' will not work in your module.py file. |
Log ERROR:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] WARNINGERROR : [broker-master ] [ modules-manager ] [MODULE-CODE-LOADING] [directory=architecture-export] Failed to load the directory [architecture-export] as a python module. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] WARNINGERROR : [broker-master ] [ modules-manager ] [MODULE-CODE-LOADING] [directory=architecture-export] - because of missing file :[PATH_DU_FICHIER]. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] WARNINGERROR : [broker-master ] [ modules-manager ] [MODULE-CODE-LOADING] [directory=architecture-export] -Bad 'import architecture-export.my_file' will not work in your module.py file.module file for FILE_NAME : missing properties dict. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] WARNINGERROR : [broker-master ] [ modules-manager ] [MODULE-CODE-LOADING] [directory=architecture-export] BadImporting module file for FILE_NAME : missing properties dictarchitecture-export: EXCEPTION. |
Log DEBUG:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:36] DEBUG : [broker-master ] [ modules-manager ] [MODULE-CODE-LOADING] [directory=architecture-export ] Starting to load the module code directory /var/lib/shinken/modules/architecture-export. |
Ceci donne le temps de chargement, mais également les nouvelles librairies importées.
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:3836] ERRORDEBUG : [broker-master ] [ modules-manager ] [MODULE-CODE-LOADING] [directory=architecture-export ] Importing module architecture-export: EXCEPTION[0.021s] Module code was loaded. Did import 10 python new librairies (PIL,PIL.Image,PIL.ImageMode,PIL._binary,_imaging,architecture-export,architecture-export.mapper,shinken.webui.bottlewebui,shinken.webui.bottlewebui.ext,shinken.webui.cherrypybackend). |
Création des instances de modules
Log INFO:
Une fois le code python chargé, on lui demande de créer des instances pour les modules ( les vrais objets ):
Une fois créé, on a un log en INFO concernant le temps que ça a pris.
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] DEBUGINFO : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] Start to create the module instance |
[0.046s] SUCCESS The module instance is created. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] INFO : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] [0.046s] SUCCESS The module instance is createdTrying to init module. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] DEBUGINFO : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] [0.046s]SUCCESS The module is not ready to startstarted. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] INFO : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] TryingStarting toa init moduleworker. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] ERRORINFO : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] SUCCESS The moduleworker failed to init and he raised an exception: EXCEPTION.is created. |
Log WARNING:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] WARNING : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] The module tried to start: 5 times. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] WARNING : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] The module will try to restart at 16:32:18. |
Log ERROR:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] INFOERROR : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] SUCCESS The module is started failed to init and he raised an exception: EXCEPTION. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] ERROR : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] FAIL The module get_instance() call did not return any instanceworker failed to init. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] ERROR : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] [0.046s] FAIL The module creation did fail withThe worker failed to init and he raised an exception: EXCEPTION. Remove this module currently, will try to recreate it in the future. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] DEBUGERROR : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] Creation module instance was skipped[0.046s] FAIL The module creation did fail with an exception: EXCEPTION. Remove this module currently, will try to recreate it in the future. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] INFOERROR : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] Starting a worker. FAIL The module get_instance() call did not return any instance. |
Log DEBUG:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] ERRORDEBUG : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] Start Theto workercreate failedthe tomodule init.instance |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] INFODEBUG : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] SUCCESS[0.046s] The workermodule is creatednot ready to start. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:38] ERRORDEBUG : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI ] TheCreation workermodule failedinstance to init and he raised an exception: EXCEPTIONwas skipped. |
Initialisation des instances de modules
Log INFO:
Une fois les instances créées, on leur demande de se préparer ( ouvrir leurs connexions, lancer les processus pour les modules externes ou avec des workers, etc ).
Ceci sera de l'ordre de la seconde pour le cas des modules avec workers ( il faut créer les queues de connexions, lancer les processus et le manager de queue, etc ).
| theme | Emacs |
|---|
.
Quand l'initialisation est finie, un log INFO est affiché.
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:39] INFO : [broker-master ] [ modules-manager ] [ MODULE-INSTANCE-CREATIONCHANGE ] [name=WebUI ] [0.801s] SUCCESS TheConfiguration of the module was initialized successfully. |
Rajout d'un nouveau module dans un démon
did change so we restart it. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:39] ERRORINFO : [broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATIONCHANGE ] [name=WebUI] CannotRemoving findthe previousmodule orbecause newit moduleis definitionremove forfrom the module name WebUI, so cannot update itconfiguration. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:39] INFO : [broker-master ] [ modules-manager ] [ MODULE-INSTANCE-CREATIONCHANGE ] [name=WebUI] ConfigurationLaunching ofa thenew module as it didwas changeadded soin wethe restartdaemon itconfiguration. |
Log WARNING:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:39] INFOWARNING : [broker-master ] [ modules-manager ] [ MODULE-INSTANCE-CREATIONCHANGE ] [name=WebUI] RemovingTrying to remove the module because%s but it is not removefound fromin the configuration.current instances: INSTANCES |
Log ERROR:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:39] INFOERROR : [broker-master ] [ modules-manager ] [ MODULE-INSTANCE-CREATIONCHANGE ] [name=WebUI] Cannot find Launchingprevious aor new module definition for asthe itmodule wasname addedWebUI, inso thecannot daemonupdate configurationit. |
Log DEBUG:
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:39] DEBUG : [ broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [name=WebUI] The module did change its configuration. We restart it to take the new configuration. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:39] WARNINGDEBUG : [ broker-master ] [modules-manager ] [MODULE-INSTANCE-CREATION] [name=WebUI] Trying to remove the module %s but it is not found in the current instances: INSTANCES | ||
| Code Block | ||
| ||
[2020-07-08 16:31:39] DEBUG : [broker-master ] [modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI] Ask stop process. |
| Code Block | ||
|---|---|---|
| ||
[2020-07-08 16:31:39] DEBUG : [ broker-master ] [ modules-manager ] [MODULE-INSTANCE-CREATION] [module type=webui ] [name=WebUI] Stop process done. |
Rajout d'un nouveau module dans un démon
Suppression d'un module dans un démon
Quand un module est enlevé de la configuration d'un démon, celui-ci l'affichera avec une entrée MODULES-CHANGE en INFO comme quoi le module est stopped:
Changement de configuration d'un module (et sa relance)
Quand la configuration d'un module change (ou la configuration d'un de ses sous-modules) alors le module est redémarré (et ses processus redémarrés si besoin). Ceci est loggué avec une entrée MODULES-CHANGE en INFO comme quoi le module est restarted: