Versions Compared

Key

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

Le module event-manger-writer est un module de la fonctionnalité bac à événements qui permet l'écriture des événements en base de donnée . 

Warning

Pour que la fonctionnalité bac à événement fonctionne il faut absolument que ce module soit activé.


Info

(warning) Il ne peut y avoir qu'un event-manager-writer par base Mongo. Donc par exemple avec 2 broker sur la même machine soit vous n'activez le module que sur un broker soit vous configurez le module pour écrire dans une autre base.

Code Block
title/etc/shinken/modules/event_manager_writer.cfg



#===============================================================================


#

event

manager


#===============================================================================


#

Daemons

that

can

load

this

module:


#

-

broker

(to

save

events

information

into

a

mongodb

database)


#

This

module

compute

and

save

event

for

event

manager


#===============================================================================


define

module

{ #======== Module identity ========= # Module name. Must be unique module_name event-manager-writer # Module type (to load module code). Do not edit. module_type event_container

{

    # ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ #
    # ┃ ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈    Module identity    ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ ┃ #

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

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

    # ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ #
    # ┃ ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈    Database connection    ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ ┃ #
    # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ #

    # ========

Database connection

=========  MongoDB parameters  =================

# mongodb uri definition for connecting to the mongodb database. You can find the mongodb uri # syntax at

 
    # --- MongoDB uri definition . You can find the mongodb uri syntax at                                   ---
    # --- https://docs.mongodb.com/manual/reference/connection-string

/ uri

/                                      ---
    # >>> Default : mongodb://localhost/?w=1&fsync=false                                                    ---
    # 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

    # --- Which database contains events data                                                               ---
    # >>> Default : shinken                                                                                 ---
    # database                                          event_container

    # --- SSH tunnel activation to securize your mongodb connection                                         ---
    # --- That will allow all mongodb to be encrypted & authentificated 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

# Default: 1 #

  ---
    # >>> Enable  : 1 ( with ssh tunnel ) ( Default )                                                       ---
    # --- Disable : 0 ( direct connection )                                                                 ---
    # use_ssh_retry_failure

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

                            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 # Which database is used to store events data database event_container

                                                                   ---

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

    # ========

Workers in the broker

======  AutoReconnect Management  ==============

# This module will use workers in the broker, each worker will manage a shard of all hosts/checks. # This parameter is used by the broker to set the number of workers. Each worker will use one CPU, which will balance the metrology processing load among CPUs. # default: 1 #broker_module_nb_workers 1 #======== Module options ========= # Number of day the events are keep in database # Default: 30 day_keep_data 30 #======== 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 }

 
    # --- 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.                         ---

    # ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ #
    # ┃ ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈    Workers in the broker    ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ ┃ #
    # --- This module will use workers in the broker, each worker will manage a shard of all hosts/checks.  ---
    # --- This parameter is used by the broker to set the number of workers.                                ---
    # --- Each worker will use one CPU, which will balance the metrology processing load among CPUs.        ---
    # >>> Default : 1 ( worker )                                                                            ---
    # broker_module_nb_workers                          1

    # ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ #
    # ┃ ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈    Module options    ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ ┃ #
    # --- Number of day the events are keep in database                                                     ---
    # >>> Default : 30 ( days )                                                                             ---
    # day_keep_data                                     30

    # ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ #
    # ┃ ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈    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

}