Les logs suivants permettent de suivre l'envoi et la réception de commande se faisant entre plusieurs processus.
Il existe deux types de communications par commande :
Dans le cas d'une réussite de l'envoi de la commande, jusqu'à sa réception, ce log s'affichera :
[YYYY-MM-DD HH:MM:SS] DEBUG : [ NOM_DU_BROKER ] [ NOM_DU_MODULE ] The command call NOM_DE_LA_COMMANDE was executed by the module NOM_DU_MODULE in TEMPS_D'EXECUTIONs
[2020-11-17 09:12:11] DEBUG : [ broker-master ] [ Livestatus ] The command call get_module_info was executed by the module Livestatus in 0.143s |
Dans le cas d'un premier timeout d'une commande, ce log s'affichera. La commande sera alors renvoyée une deuxième fois.
[YYYY-MM-DD HH:MM:SS] WARNING : [ NOM_DU_BROKER ] [ NOM_DU_MODULE ] The command call NOM_DE_LA_COMMANDE for module NOM_DU_MODULE did timeout (TEMPS_TIMEOUTs). We will retry one time.
[2020-11-17 09:12:11] WARNING : [ broker-master ] [ Livestatus ] The command call get_module_info for module Livestatus did timeout (1s). We will retry one time. |
Il peut arriver qu'à l'envoi d'une commande une autre réponse soit reçue, si la précédente commande n'a pas fonctionnée par exemple. Dans ce cas, ce log s'affichera. La commande sera alors renvoyée afin de récupérer la bonne réponse.
[YYYY-MM-DD HH:MM:SS] ERROR : [ NOM_DU_BROKER ] [ NOM_DU_MODULE ] The command call NOM_DE_LA_COMMANDE was called but another respond was present. Retrying.
[2020-11-17 09:12:11] ERROR : [ broker-master ] [ Livestatus ] The command call get_module_info was called but another respond was present. Retrying. |
Si l'envoi de la commande a connu un premier timeout, à son deuxième elle passera en erreur et ne sera pas renvoyée. Ce log sera affiché :
[YYYY-MM-DD HH:MM:SS] ERROR : [ NOM_DU_BROKER ] [ NOM_DU_MODULE ] Fail to send command call NOM_DE_LA_COMMANDE for module NOM_DU_MODULE because the module did timeout (TEMPS_TIMEOUTs).
[2020-11-17 09:12:11] ERROR : [ broker-master ] [ Livestatus ] Fail to send command call get_module_info for module Livestatus because the module did timeout (1s). |
Il peut arriver que la commande échoue à cause d'un problème du côté du module/worker. Dans ce cas ce log sera affiché après l'affichage de la stack.
[YYYY-MM-DD HH:MM:SS] ERROR : [ NOM_DU_BROKER ] [ NOM_DU_MODULE ] Fail to send command call NOM_DE_LA_COMMANDE for module NOM_DU_MODULE because of an unknown error MESSAGE_D'ERREUR
[2020-11-17 09:12:11] ERROR : [ broker-master ] [ Livestatus ] Fail to send command call get_module_info for module Livestatus because of an unknown error 'int' object is not iterable |
Au moment de la réception de la commande, si cette dernière est exécutable, ce log sera affiché :
[YYYY-MM-DD HH:MM:SS] DEBUG : [ NOM_DU_BROKER ] [ NOM_DU_MODULE ] [PID:PID_DU_PROCESSUS] Executing command NOM_DE_LA_COMMANDE with param LISTE_DES_PARAMETRES
[2020-11-17 09:12:11] DEBUG : [ broker-master ] [ Livestatus ] [PID:2564] Executing command get_module_info with param [] |
Si une commande inconnue est reçue, ce log sera affiché :
[YYYY-MM-DD HH:MM:SS] WARNING : [ NOM_DU_BROKER ] [ NOM_DU_MODULE ] [PID:PID_DU_PROCESSUS] Received unknown command NOM_DE_LA_COMMANDE from father process !
[2020-11-17 09:12:11] DEBUG : [ broker-master ] [ Livestatus ] [PID:2564] Received unknown command get_module_info from father process ! |
Si la commande crash, ce log sera affiché :
[YYYY-MM-DD HH:MM:SS] ERROR : [ NOM_DU_BROKER ] [ NOM_DU_MODULE ] Our father process did send us the command (NOM_DE_LA_COMMANDE) that did fail: TRACEBACK
[2020-11-17 09:12:11] DEBUG : [ broker-master ] [ Livestatus ] Our father process did send us the command (get_module_info) that did fail: Traceback (most recent call last):
File "C:\dev\workspace\shinken-enterprise\sources\framework\shinken\shinken\basesubprocess.py", line 117, in get_and_execute_command_from_master
result = f()
File "C:\dev\workspace\shinken-enterprise\testing\test_command_queue_handler.py", line 43, in fail_command
raise Exception
Exception |