Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Le module event-manager-reader est un module qui permet au module WebUI ( l'interface de visualisation ) du broker d'afficher le bac à événements.

  • Il récupère les événements en base de donnée des événements.
  • Il doit donc être listé dans la liste des modules du module WebUI ( cf Module WebUI, propriété "modules" )

Warning

Pour que la fonctionnalité bac à événement apparaisse dans l'interface, il faut absolument que ce module soit activé.


Info

Si vous avez plusieurs configurations de web-ui présente dans votre architecture, n'oubliez pas d'activer le module dans chaque configuration

  • Ex plusieurs WebUI sur le même broker
  • ou une sur différents Brokers qui n'utilise pas la même définition.


Configuration .cfg


Code Block
title/etc/shinken/modules/event-manager-reader.cfg
#===============================================================================
# event manager
#===============================================================================
# Modules that can load this module:
# - WebUI (to display events data to the users)
# This module read event from database to show you in the WebUI
#===============================================================================


define module {

    # ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ #
    # │ --------------------------------------    Module identity    -------------------------------------- │──────────────────────────────────────    MODULE IDENTITY    ────────────────────────────────────── │ #
    # └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ #

    # ---─── Module name [ Must be unique ]                                                      [ MANDATORY ] ---───
    module_name                                         event-manager-reader

    # ---─── Module type [ Do not edit ]                                                         [ MANDATORY ] ---───
    module_type                                         event_container

    # ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ #
    # │ ------------------------------------    Database connection    ------------------------------------ │ # ────────────────────────────────────    DATABASE CONNECTION    ──────────────────────────────────── │ #
    # └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ #

    # ─────────────────  MongoDB parameters  ────────────────────────────────────────────────────────────────── 

    # └─────────────────────────────────────────────────────────────────────────────────────────────────────┘─── #

MongoDB uri definition . # =================  MongoDB parameters  ================= 
    # --- MongoDB uri definition . You can find the mongodb uri syntax atYou can find the mongodb uri syntax at                                                   ---───
    # ---─── https://docs.mongodb.com/manual/reference/connection-string/                                      ---───
    # >>> Default : mongodb://localhost/?w=1&fsync=false                                                    ---───
    # uri                                               mongodb://localhost/?w=1&fsync=false

    # ---─── Which database contains events data                                                               ---───
    # >>> Default : shinkenevent_container                                                                                 ---───
    # database                                          event_container

    # ---─── SSH tunnel activation to securizesecure your mongodb connection                                           ---───
    # ---─── That will allow all mongodb to be encrypted & authentificatedauthenticated with SSH                              ---───
    # ---─── Enable  : 1 ( enable ssh tunnel )                                                                 ---───
    # >>> Disable : 0 ( disable ssh tunnel ) ( Default )                                                    ---───
    # use_ssh_tunnel                                    0

    # ---─── If the SSH connection goes wrong, then retry use_ssh_retry_failure time before_shinken_inactive   ---───
    # >>> Enable  : 1 ( with ssh tunnel ) ( Default )                                                       ---───
    # ---─── Disable : 0 ( direct connection )                                                                 ---───
    # use_ssh_retry_failure                             1

    # ---─── SSH user to connect to the mongodb server.                                                        ---───
    # >>> Default : shinken                                                                                 ---───
    # ssh_user                                          shinken

    # ---─── SSH keyfile to connect to the mongodb server.                                                     ---───
    # >>> Default : ~shinken/.ssh/id_rsa                                                                    ---───

    # ---─── SSH Timeout used to test if the SSH tunnel is viable or not, in seconds.                          ---───
    # >>> Default : 10 ( seconds )                                                                          ---───
    # ssh_tunnel_timeout                                10

    # ==============──────────────  AutoReconnect Management   ============== ─────────────────────────────────────────────────────────────── 

    # ---─── When MongoDB require you to reconnect ( For example, It can occur when a new PRIMARY is elected   ---───
    # ---─── in a MongoDB cluster ), it will raised the MongoDB AutoReconnect exception.                       ---───
    # ---───                                                                                                   ---───
    # ---─── How many try to reconnect before module go in error                                               ---───
    # >>> Default : 4 ( try )                                                                               ---───
    # auto_reconnect_max_try                            4

    # ---─── Time between each try                                                                             ---───
    # >>> Default : 3 ( seconds )                                                                           ---───
    # auto_reconnect_sleep_between_try                  3

    # ---─── NOTE: Change these values only if you have a MongoDB cluster and you change the                   ---───
    # ---───       heartbeatTimeoutSecs of your MongoDB replica set                                            ---───
    # ---───       The value of auto_reconnect_max_try * auto_reconnect_sleep_between_try must be higher than  ---───
    # ---───       heartbeatTimeoutSecs in the rs.conf(); of your MongoDB replica set.                         ---───

    # ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ #
    # │ -------------------------------------─────────────────────────────────────    VisualisationVISUALISATION UI    --------------------------------------────────────────────────────────────── │ #
    # ---└─────────────────────────────────────────────────────────────────────────────────────────────────────┘ #

    # ─── Specify the max retries when the Visualisation UI can't communicate with the event_manager_reader ───
    # ─── during the Excel export.              ---
    # --- the event_manager_reader during export.                                                   ───
    # ─── Increase this ---
parameter when users encounter #difficulties ---when Thegenerating valuethe cannotExcel beexport 0.       ───
    # ─── of events. This will make the export more tolerant to network loss or database slowness,          ───
    # ─── or restart of the broker.                             ---
    # >>> Default : 2 ( try )                                 ───
    # ─── The value cannot be 0.                                    ---
    # broker__module_webui__module_event_manager_reader__events_export__max_retry 2

    # ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ #
                 #  -------------------------------------    INTERNAL options    -------------------------------------- │ #      ───
    # >>> Default : 2 ( try )                                                                               ───
    # broker__module_webui__module_event_manager_reader__events_export__max_retry 2

    # ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ #
    # │ ─────────────────────────────────────    INTERNAL OPTIONS    ────────────────────────────────────── │ #
    # └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ #

    # ─── INTERNAL : DO NOT EDIT FOLLOWING PARAMETER WITHOUT YOUR DEDICATED SUPPORT                         ───

    # ─── Broker idle time before considering that Shinken is inactive.                                     ───
    # ─── Use this if you have Broker loop time that exceeds 30 seconds                                     ───
    # --->>> INTERNALDefault : DO NOT EDIT FOLLOWING PARAMETER WITHOUT YOUR DEDICATED SUPPORT 30 ( seconds )                                            ---
    # --- time of inactivation of the broker before considering that shinken is inactive (in sec)           ---───
    # time_before_shinken_inactive                      30

}