Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scroll Ignore
scroll-pdftrue
scroll-officetrue
scroll-chmtrue
scroll-docbooktrue
scroll-eclipsehelptrue
scroll-epubtrue
scroll-htmltrue
Panel
titleSommaire

Table of Contents
stylenone

Concept

Description

Le module de type event-manager-reader est un module qui permet au module WebUI ( l'interface Interface de visualisation Visualisation ) du broker Broker d'afficher le bac ร  รฉvรฉnementsรฉvรฉnement ( voir la page Vue - Les ร‰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 de type WebUI ( cfย  voir la page Module WebUI, propriรฉtรฉ "modules" ).

Warning

Pour que la fonctionnalitรฉ le menu "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 du module WebUI prรฉsentes dans votre architecture, n'oubliez pas d'activer le module "event-manager-reader" dans chaque configuration.

Exemple :ย 

  • Plusieurs modules Ex plusieurs WebUI sur le mรชme brokerBroker.
  • Un module WebUI diffรฉrent ou une sur diffรฉrents Brokers qui n'utilise pas la mรชme dรฉfinitionconfiguration.

Configuration .cfg

Activation du module

Code Blocktitle/etc/shinken/modules/

Le module

event-manager-readerย est un module qui peut รชtre activรฉ seulement sur le module WebUI.

  • L'activation du module s'effectue en ajoutant le nom de ce module dans le fichier de configuration du module WebUI.
  • Pour ce faire, il faut ouvrir le fichier de configuration du module WebUI du Broker ร  l'emplacement /etc/shinken/module/ma_webui.cfg, et ajouter le nom du module "event-manager-reader".


Exemple : par dรฉfaut, est livrรฉ un module dont le nom est "event-manager-reader":

Code Block
languagejs
themeConfluence
define module {
    [...]
    modules ย  ย  ย  ย  ย  ย  ย  ย  ย  Module 1, Module 2, Module 3, event-manager-reader
  ย  [...]
}


Pour prendre en compte le changement de configuration, redรฉmarrer l'Arbiter:

Code Block
languagetext
themeEmacs
service shinken-arbiter restart

Configuration

La configuration du module livrรฉ par dรฉfaut se trouve dans le fichier/etc/shinken/modules/event_manager_reader.cfg

  • Un fichier d'exemple est disponible ici : /etc/shinken-user-example/configuration/daemons/brokers/modules/event_manager_reader/event_manager_reader-example.cfg

Exemple de fichier de configuration

Code Block
languagejs
themeConfluence
# CFG_FORMAT_VERSION 1 ( SHINKEN : DON'T TOUCH THIS LINE )

#================================================================================
# 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 name [ Must be unique ]                                                      [ MANDATORY ] โ”€โ”€โ”€
    # โ”€โ”€โ”€                                                                                                   โ”€โ”€โ”€
    module_name                                         event-manager-reader

    # โ”€โ”€โ”€ Module type [ Do not edit ]                                                         [ MANDATORY ] โ”€โ”€โ”€
    # โ”€โ”€โ”€                                                                                                   โ”€โ”€โ”€
    module_type                                         event_container

    # โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” #
    # โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€    DATABASE CONNECTION    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚ #
    # โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ #

    # โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  MongoDB parameters  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ #

    # โ”€โ”€โ”€ MongoDB uri definition . You 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 : event_container                                                                   โ”€โ”€โ”€
    # โ”€โ”€โ”€                                                                                                   โ”€โ”€โ”€
    # database                                            event_container

    # โ”€โ”€โ”€ username/password to authenticate to MongoDB.                                                     โ”€โ”€โ”€
    # โ”€โ”€โ”€ Both parameters must be provided for authentication to function correctly.                        โ”€โ”€โ”€
    # โ”€โ”€โ”€                                                                                                   โ”€โ”€โ”€
    # broker__module_webui__module_event_manager_reader__database__username 

    # โ”€โ”€โ”€                                                                                                   โ”€โ”€โ”€
    # broker__module_webui__module_event_manager_reader__database__password 

    # โ”€โ”€โ”€ SSH tunnel activation to secure your mongodb connection                                           โ”€โ”€โ”€
    # โ”€โ”€โ”€ That will allow all mongodb to be encrypted & authenticated with SSH                              โ”€โ”€โ”€
    #                                                                                                       โ”€โ”€โ”€
    #           ...     : Enable  => 1 ( enable ssh tunnel )                                                โ”€โ”€โ”€
    #           Default : Disable => 0 ( disable ssh tunnel )                                               โ”€โ”€โ”€
    # โ”€โ”€โ”€                                                                                                   โ”€โ”€โ”€
    # use_ssh_tunnel                                      0

    # โ”€โ”€โ”€ If the SSH connection goes wrong, then retry use_ssh_retry_failure time before_shinken_inactive   โ”€โ”€โ”€
    #                                                                                                       โ”€โ”€โ”€
    #           Default : 1 ( try )                                                                         โ”€โ”€โ”€
    # โ”€โ”€โ”€                                                                                                   โ”€โ”€โ”€
    # 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_keyfile                                         ~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.                         โ”€โ”€โ”€

    # โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” #
    # โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€    VISUALISATION UI    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚ #
    # โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ #

    # โ”€โ”€โ”€ Specify the max retries when the Visualisation UI can't communicate with the event_manager_reader โ”€โ”€โ”€
    # โ”€โ”€โ”€ during the Excel export.                                                                          โ”€โ”€โ”€
    # โ”€โ”€โ”€ Increase this parameter when users encounter difficulties when generating the Excel export        โ”€โ”€โ”€
    # โ”€โ”€โ”€ of events. This will make the export more tolerant to network loss or database slowness,          โ”€โ”€โ”€
    # โ”€โ”€โ”€ or restart of the broker.                                                                         โ”€โ”€โ”€
    # โ”€โ”€โ”€ The value cannot be 0.                                                                            โ”€โ”€โ”€
    #                                                                                                       โ”€โ”€โ”€
    #           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                                     โ”€โ”€โ”€
    #                                                                                                       โ”€โ”€โ”€
    #           Default : 30 ( seconds )                                                                    โ”€โ”€โ”€
    # โ”€โ”€โ”€                                                                                                   โ”€โ”€โ”€
    # time_before_shinken_inactive                        30

} 

Dรฉtails des sections composant le fichier de configuration

Identification du module

Il est possible de dรฉfinir plusieurs instances de module de type "event-manager-reader" dans l'architecture Shinken.

  • Chaque instance devra avoir un nom unique.
Scroll Title
anchorparameter_cfg
titleโ€‹
NomTypeUnitรฉDรฉfautDescription
No Format
module_name 
Texte---event-manager-reader

Il est conseillรฉ de choisir un nom en fonction de l'utilisation du module pour que la configuration soit simple ร  maintenir.

Doit รชtre unique.

No Format
module_typeย 
Texte---event_containerNe peut รชtre modifiรฉ.



Accรจs ร  la base MongoDB

Cette configuration s'effectue dans le fichier de configuration du module.ย 

Pour se connecter ร  la base MongoDB utilisรฉ pour le stockage des donnรฉes, deux mรฉthodes sont disponibles :

  • Connexion directe :ย Par dรฉfaut, mais non sรฉcurisรฉe.
  • Tunnel SSH :ย Shinken se connecte ร  la base MongoDB au travers d'un module SSH pour plus de sรฉcuritรฉ.
Configuration de l'URI de connexion et de l'authentification par mot de passe
Code Block
languagejs
themeConfluence
    # โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” #
    # โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€    DATABASE CONNECTION    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚ #
    # โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ #

    # โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  MongoDB parameters  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ #

    # โ”€โ”€โ”€ MongoDB uri definition . You 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 : event_container                                                                   โ”€โ”€โ”€
    # โ”€โ”€โ”€                                                                                                   โ”€โ”€โ”€
    # database                                            event_container

    # โ”€โ”€โ”€ username/password to authenticate to MongoDB.                                                     โ”€โ”€โ”€
    # โ”€โ”€โ”€ Both parameters must be provided for authentication to function correctly.                        โ”€โ”€โ”€
    # โ”€โ”€โ”€                                                                                                   โ”€โ”€โ”€
    # broker__module_webui__module_event_manager_reader__database__username 

    # โ”€โ”€โ”€                                                                                                   โ”€โ”€โ”€
    # broker__module_webui__module_event_manager_reader__database__password 
Scroll Title
anchorparameter_cfg
titleโ€‹
NomTypeUnitรฉDรฉfautDescription
No Format
 uri 
TexteURLmongodb://localhost/?safe=true

La page suivante decrit la syntaxe de l'uri de MongoDB : https://docs.mongodb.com/manual/reference/connection-string/.

No Format
 database 
Texte---shinken

Nom de la base de donnรฉes oรน sont stockรฉes les donnรฉes รฉvรฉnements.

No Format
broker__module_webui__module_event_manager_reader__database__username
Texte---

Utilisateur pour l'authentification avec mot de passe ร  la base MongoDB.

Utile uniquement si l'activation par mot de passe a รฉtรฉ activรฉ (ย  voir la page MongoDB - activation de l'authentification par mot de passe ย ).

No Format
broker__module_webui__module_event_manager_reader__database__password 
Texte---

Mot de passe de l'utilisateur utilisรฉ pour l'authentification avec mot de passe ร  la base MongoDB.

Utile uniquement si l'activation par mot de passe a รฉtรฉ activรฉ (ย  voir la page MongoDB - activation de l'authentification par mot de passeย ).


Connexion directe au serveur MongoDB

Par dรฉfaut, le module se connecte de maniรจre directe ร  la base MongoDB pour y lire et รฉcrire les donnรฉes.
Dans la configuration du module, ceci correspond au paramรจtre "use_ssh_tunnel" ร  0.
C'est la mรฉthode de connexion par dรฉfaut lorsque la base est sur la mรชme machine que le dรฉmon ( quand l'URL de la base est localhost ).

Si la base est sur une autre machine, il faudra alors se connecter ร  la base via un tunnel SSH. Cela permet ร  la base distance de rester en รฉcoute rรฉseau sur l'interface rรฉseau local, ce qui la sรฉcurise des accรจs extรฉrieurs ( voir la pageSรฉcurisation des connexions aux bases MongoDB ).

Connexion par SSH au serveur MongoDB
Code Block
languagejs
themeConfluence
 ย  ย # โ”€โ”€โ”€ SSH tunnel activation to secure your mongodb connection                                           โ”€โ”€โ”€
    # โ”€โ”€โ”€ That will allow all mongodb to be encrypted & authenticated with SSH                              โ”€โ”€โ”€
    #                                                                                                       โ”€โ”€โ”€
    #          ...     : Enable  => 1 ( enable ssh tunnel )                                                 โ”€โ”€โ”€
    #          Default : Disable => 0 ( disable ssh tunnel )                                                โ”€โ”€โ”€
    #                                                                                                       โ”€โ”€โ”€
    # use_ssh_tunnel                                      0
 
    # โ”€โ”€โ”€ If the SSH connection goes wrong, then retry use_ssh_retry_failure time before_shinken_inactive   โ”€โ”€โ”€
    #                                                                                                       โ”€โ”€โ”€
    #          Default : 1 ( try )                                                                          โ”€โ”€โ”€
    #                                                                                                       โ”€โ”€โ”€
    # 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_keyfile                                         ~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
Scroll Title
anchorparameter_cfg
titleโ€‹
NomTypeUnitรฉDรฉfautDescription
No Format
use_ssh_tunnel
Boolรฉen---0
  • 1 : Connexion par tunnel SSH
  • 0 : Connexion directe
No Format
use_ssh_retry_failure
Entierย Nombre d'essais1

Spรฉcifie le nombre supplรฉmentaire de tentatives lors de l'รฉtablissement du tunnel SSH si ce dernier n'arrive pas ร  รชtre รฉtabli

No Format
ssh_user
TexteUtilisateur unixshinkenL'utilisateur avec lequel le tunnel sera รฉtabli
No Format
ssh_keyfile
TexteChemin de fichier~shinken/.ssh/id_rsaย La clรฉ ssh privรฉe prรฉsente sur le serveur Shinken qui sera utilisรฉ pour รฉtablir le tunnel.
No Format
ssh_tunnel_timeout
EntierSsecondes10Spรฉcifie le timeout en secondes de la vรฉrification du tunnel SSH avant que la connexion vers MongoDB soit effectuรฉe

Gestion de l'auto reconnexion avec un cluster MongoDB

Code Block
languagejs
themeConfluence
 ย  ย # โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  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.
Info
titleDรฉfinitions
  • Primaire: nom de MongoDB pour dรฉsigner un serveur maรฎtre, le serveur sur lequel il est possible de faire des requรชtes d'รฉcriture dans la base.ย 
  • Election : processus de MongoDB pour choisir un nouveau membre Primaire si le membre Primaire devient inaccessibleย 

( voir la page Haute disponibilitรฉ de la base MongoDB (mise en place d'un cluster) )


Dans le cas de l'utilisation d'un cluster MongoDB, lorsque le membre Primaire devient inaccessible, une nouvelle รฉlection est dรฉclenchรฉe, ce qui provoque une coupure temporaire de l'accรจs ร  la base.

Dans le but de ne pas interrompre le service, le module "event-manager-reader" va se reconnecter automatiquement au cluster MongoDB.
Pour ce faire, il va faire un nombre d'essais รฉgaux au paramรจtreย "auto_reconnect_max_try " avec une pause de X secondes entre chaque essai ( correspondant au paramรจtre "auto_reconnect_sleep_between_try" ).

Par dรฉfaut pour MongoDB le temps maximum avant qu'un membre Primaire soit considรฉrรฉ comme indisponible et qu'une nouvelle รฉlection ait lieu est de 10 secondes.
Voir : "heartbeatTimeoutSecs" donnรฉ par la commande rs.conf(); dans un shell de MongoDB.


Scroll Title
anchorparameter_cfg
titleโ€‹
NomTypeUnitรฉDรฉfautDescription
No Format
auto_reconnect_max_try
EntierNombre d'essais4Nombre d'essais de reconnexion ร  la base
No Format
auto_reconnect_sleep_between_try
Entierย Secondes3

Temps entre chaque essai en seconde


Les valeurs par dรฉfauts du fichier laissent 12 secondes, ce qui est amplement suffisant avec la configuration par dรฉfaut de MongoDB.


Warning

Il est conseillรฉ de ne pas modifier ces valeurs.

Configuration pour l'interface de visualisation

Code Block
languagejs
themeConfluence
 ย   # โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” #
    # โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€    VISUALISATION UI    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚ #
    # โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ #
 
    # โ”€โ”€โ”€ Specify the max retries when the Visualisation UI can't communicate with the event_manager_reader โ”€โ”€โ”€
    # โ”€โ”€โ”€ during the Excel export.                                                                          โ”€โ”€โ”€
    # โ”€โ”€โ”€ Increase this parameter when users encounter difficulties when generating the Excel export        โ”€โ”€โ”€
    # โ”€โ”€โ”€ of events. This will make the export more tolerant to network loss or database slowness,          โ”€โ”€โ”€
    # โ”€โ”€โ”€ or restart of the broker.                                                                         โ”€โ”€โ”€
    # โ”€โ”€โ”€ The value cannot be 0.                                                                            โ”€โ”€โ”€
    #                                                                                                       โ”€โ”€โ”€
    #          Default : 2 ( try )                                                                          โ”€โ”€โ”€
    #                                                                                                       โ”€โ”€โ”€
    # broker__module_webui__module_event_manager_reader__events_export__max_retry 2

Le paramรจtre "broker__module_webui__module_event_manager_reader__events_export__max_retry" permet de configurer le nombre maximal de tentatives lorsque l'interface de visualisation ne peut pas communiquer avec le module event_manager_reader pendant l'export des donnรฉes vers Excel.

Cela rendra les exports plus tolรฉrants aux pertes de rรฉseau ou aux lenteurs de la base de donnรฉes, ou aux redรฉmarrages du Broker.

Scroll Title
anchorparameter_cfg
titleโ€‹
NomTypeUnitรฉDรฉfautDescription
No Format
broker__module_webui__module_event_manager_reader__events_export__max_retry
EntierNombre d'essais2

Nombre d'essais d'appel pour l'export des donnรฉes vers Excel.

Ne peut pas valoir 0.

Options Internes

.cfg
Code Block
languagejs
themeConfluence
 ย  ย # โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” #
    # โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€    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                                     โ”€โ”€โ”€
    #                                                                                                       โ”€โ”€โ”€
    #          Default : 30 ( seconds )                                                                     โ”€โ”€โ”€
    #                                            
#===============================================================================
# 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 name. Must be unique
    module_name          event-manager-reader

    # Module type (to load module code). Do not edit.
    module_type          event_container

    #======== Database connection =========
    # mongodb uri definition for connecting to the mongodb database. You can find the mongodb uri
    # syntax at https://docs.mongodb.com/manual/reference/connection-string/
    uri                  mongodb://localhost/?w=1&fsync=false

    # If you want to securize your mongodb connection you can enable the ssh use_ssh_tunnel that will
    # allow all mongodb to be encrypted & authentificated with SSH
    # Should use a SSH tunnel (Default 0=False)
    # use_ssh_tunnel          0

    # If the SSH connection goes wrong, then retry use_ssh_retry_failure time before_shinken_inactive
    # Default: 1
    # use_ssh_retry_failure   1

    # SSH user/keyfile in order to connect to the mongodb server.
    # Default: shinken
    # ssh_user                shinken

    # Default: ~shinken/.ssh/id_rsa
    # ssh_keyfile             ~shinken/.ssh/id_rsa

    # Which database is used to store events data
    database   โ”€โ”€โ”€
    # time_before_shinken_inactive     event_container

    #======== INTERNAL options =========
    #INTERNAL : DO NOT EDIT FOLLOWING PARAMETER WITHOUT YOUR DEDICATED SUPPORT
    # == time of inactivation of the broker before considering that shinken is inactive (in sec) ==
    #time_before_shinken_inactive	30
}

 30
Warning

Ces paramรจtres sont dรฉdiรฉs au fonctionnement interne au module, il est fortement recommandรฉ de ne pas les modifier sans votre support dรฉdiรฉ.

Scroll Title
anchorparameter_cfg
titleโ€‹
NomTypeUnitรฉDรฉfautDescription
No Format
 time_before_shinken_inactive 
Entierย Secondes30

Temps d'inactivitรฉ du Broker avant de considรฉrer que Shinken est inactif.

Utilisez cette option si le temps de boucle du Broker dรฉpasse 30 secondes.