Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Make by tools (01.00.01) - action=clean_macro_parameter
Scroll Ignore
scroll-viewporttrue
scroll-pdftrue
scroll-officetrue
scroll-chmtrue
scroll-htmlfalse
scroll-docbooktrue
scroll-eclipsehelptrue
scroll-epubtrue
scroll-htmlfalse
Panel
titleSommaire

Table of Contents
stylenone

Rôle

Le démon Broker exporte et gère les données du Scheduler ( les objets Broks ).

  • Sa gestion ne peut se faire qu'à travers des modules.
  • Plusieurs modules de gestion peuvent être activés en même temps. 

Exemples de modules du Broker :

  • Module pour exporter les données de métrologie: Graphite-Perfdata
  • Module pour l'API Livedata
  • Module pour l'affichage de l'interface de visualisation : WebUI

Données : les Broks

Le Broker reçoit toutes les données des Schedulers. Ce sont les objets Broks.

Info
titleLes Broks

Les Broks sont des conteneurs de données échangées entre les Schedulers et les Brokers. Il y a plusieurs types de Broks :

  • Des évènements ( comme un Scheduler qui vient de démarrer ).
  • La configuration des éléments supervisés ( hôtes, checks, période de temps, utilisateurs ).
  • L'état des hôtes, clusters et checks après chaque vérification.


Le rôle du démon Broker est de donner ces données ( Broks ) à tous ses modules.


Panel

Données de métrologie

Les données de métrologie sont sauvegardées sur le serveur du Broker dans l'application graphite.

Cette application écoute le port 2003, et cette connexion se fait sans authentification.

Cette application doit donc écouter exclusivement sur l'interface réseau locale ( loopback ) du serveur du Broker. 

Logique interne du Broker

Panel

Résumé des connexions du Broker

SourceDestinationPortProtocoleNote
BrokerScheduler7768HTTP/HTTPS

Description des variables

Scroll Title
anchorparameter_cfg
title
NomTypeUnitéDéfautCommentaireDescription
No Format
broker_name
Texte__

Cette variable est utilisée pour identifier le nom réduit du Broker auquel les données sont associées.

No Format
address
URLlocalhost

Définit l'adresse permettant de joindre ce Broker.

Par défaut "localhost", changez-le par un nom DNS ou une adresse IP.

No Format
port
Entier__7772

Port TCP utilisé par le démon.

No Format
use_ssl
Booléen__0

Définit si le Broker doit être contacté en HTTPS ou HTTP.

Valeurs possibles:

  • 1 ( HTTPS )
  • 0 ( HTTP )


No Format
spare
Booléen__0 ( maître )

Définit si le Broker peut être géré comme un spare ( prendra uniquement la configuration si le maître échoue ).

Valeurs possibles:

  • 1 ( Activé )
  • 0 ( Désactivé )
No Format
spare_daemon
Texte____

Nom du démon spare ( c.a.d broker_name, à ne pas confondre avec son nom DNS ou adresse IP ) qui sera utilisé pour reprendre le travail de ce démon s'il vient à ne plus être disponible.

No Format
broker__manage_spare__spare_must_have_the_same_list_of_module_type
Booléen__1

Définit si la configuration des modules du spare défini par spare_daemon sera vérifiée pour voir si elle corresponds bien à celle du maitre.

Valeurs possibles:

  • 1 ( Activé )
  • 0 ( Désactivé )
No Format
timeout
EntierSeconde3

Définit le temps en secondes avant que l'Arbiter ne considère ce démon comme à l'arrêt. Si ce démon est joignable en HTTPS ( use_ssl à 1 ) avec une latence élevée, Shinken conseille alors d'augmenter la valeur de timeout ( l'Arbiter aura besoin de plus d'allers/retours pour le contacter ).

No Format
data_timeout
EntierSeconde120

Temps avant de considérer un transfert de configuration ou de données comme échoué.

No Format
max_check_attempts
Entier__3

Si le ping permettant de détecter la disponibilité réseau du nœud est en échec N fois ou plus, alors le nœud est considéré comme mort .

No Format
check_interval
EntierSeconde60

Intervalle de Ping.

No Format
modules
Texte____

Définit les modules chargés par le Broker.

No Format
realm
Texte____

Définit le royaume où le Broker doit être.

Si aucun n'est sélectionné, celui par défaut lui sera assigné.

No Format
manage_sub_realms
Booléen__1

Définit si le Broker prendra des tâches des Schedulers des sous-royaumes.

Valeurs possibles:

  • 1 ( Activé )
  • 0 ( Désactivé )
No Format
manage_arbiters
Booléen__1

Prends les données de l'Arbiter. Il ne devrait y avoir qu'un seul Broker pour l'Arbiter.

Valeurs possibles:

  • 1 ( Activé )
  • 0 ( Désactivé )
No Format
satellitemap
Texte

__

__

Cette variable est utilisée dans le cas de royaume situé derrière un réseau NATé.

  • Elle est de la forme d'une liste séparée par des "," de valeur nom-démon=address:port
  • Les démons ainsi listé seront contacté avec le couple address:port du paramètre au lieu de leur adresse dans leur .cfg. *

Ceci permet ainsi à des démon derrière un réseau NAT d'échanger sur leur adresse locale au lieu de devoir ressortir sur leur adresse publique.

  • Exemple:  daemon1=192.168.0.1:7768,daemon2=192.168.0.1:7771
No Format
broks_packet_size
EntierKilo-octet204800

Si présentes, les demandes vers les Schedulers vont avoir comme limite haute de taille de paquet cette valeur ( en Ko ).

Par défaut les envois sont illimités.

No Format
broker__manage_brok__enable_sub_processes_memory_usage_protection
Booléen__1

Définit si le Broker va vérifier qu'il y a assez de RAM disponibles sur le système avant de lancer ses processus workers qui poussent les broks vers les modules externes ( comme WebUI ).

Valeurs possibles:

  • 1 ( Activé )
  • 0 ( Désactivé )
No Format
broker__manage_brok__sub_process_memory_usage_system_reserved_memory
EntierPourcentage0

Dans le cas de la protection de mémoire, on peut réserver un pourcentage de RAM pour le système qui ne sera pas considérée comme disponible par le démon.

No Format
broker__manage_brok__sub_processes_memory_usage_protection_max_retry_time
EntierSeconde5

Dans le cas de la protection mémoire, pendant combien de temps le Broker va attendre avant de considérer qu'il n'a pas assez de mémoire, ce qui aura comme conséquence de tuer le module externe concerné.

No Format
broker__manage_brok__sub_process_broks_pusher_min_execution_timeout
EntierSeconde5

Temps que le Broker va laisser aux workers qui poussent les broks vers les modules externes pour s'exécuter.

No Format
broker__manage_brok__sub_process_broks_pusher_security_ratio
Entier__5

Le Broker va estimer le temps d'exécution des workers qui poussent les broks en se basant sur leur moyenne passée, et va appliquer ce ratio multiplicateur comme timeout d'exécution.

No Format
broker__manage_brok__sub_process_broks_pusher_max_execution_timeout
EntierSeconde240

Temps que le Broker va laisser aux workers qui poussent les broks vers les modules externes pour s'exécuter.

No Format
broker__manage_brok__sub_process_broks_pusher_max_retry
Entier__3

Nombre de tentatives où le Broker va relancer les workers qui poussent les broks avant d’arrêter et tuer le module lié.

No Format
broker__manage_brok__sub_process_broks_pusher_queue_batch_size
Entier__100000

Taille maximum en nombres de Broks que peuvent faire les workers qui poussent les broks aux modules externes ( comme WebUI ).

Attention, trop augmenter cette limite peux poser des problèmes d'envoi trop importants pour la socket de communication.

No Format
enabled
Booléen__1

Définit si le Broker est activé ou non.

Valeurs possibles:

  • 1 ( Activé )
  • 0 ( Désactivé )

Définition - exemple

broker__manage_brok__oversized_data_warning_threshold__serialization_time
EntierMillisecondes100

Délai en millisecondes passées à la sérialisation d'un Brok lors de l'envoi au module ( et ses workers ). Passé ce délai sera affiché dans les logs du Broker en WARNING deux messages contenant :

  • le temps passé à le sérialiser et la taille de ses données variables.
  • le temps passé à le sérialiser et le nombre de ses données variables.

( voir la page Broker - Les logs communs des modules du Broker ).

No Format
broker__manage_brok__oversized_data_error_threshold__serialization_time
EntierMillisecondes500

Délai en millisecondes passées à la sérialisation d'un Brok lors de l'envoi au module ( et ses workers ). Passé ce délai sera affiché dans les logs du Broker en ERROR deux messages contenant :

  • le temps passé à le sérialiser et la taille de ses données variables.
  • le temps passé à le sérialiser et le nombre de ses données variables.

( voir la page Broker - Les logs communs des modules du Broker ).


Warning

La valeur ne peut pas être strictement inférieur au seuil d'attention.

No Format
enabled
Booléen__1

Définit si le Broker est activé ou non.

Valeurs possibles:

  • 1 ( Activé )
  • 0 ( Désactivé )

Définition - exemple

Dans le répertoire /etc/shinken/brokers/, voici un exemple de définition qui permet la définition du Broker ( à placer dans un fichier CFG )  :

(warning) Il est conseillé d'éditer les fichiers .cfg avec l'encodage utf-8

Code Block
languagejs
themeConfluence
#======================================

Dans le répertoire /etc/shinken/brokers/, voici un exemple de définition qui permet la définition du Broker ( à placer dans un fichier CFG )  :

(warning) Il est conseillé d'éditer les fichiers .cfg avec l'encodage utf-8

Code Block
languagejs
themeConfluence
#===============================================================================
# BROKER
#===============================================================================
# Description: The Broker is responsible for:
# - Exporting centralized logs of all Shinken daemon processes
# - Exporting status data
# - Exporting performance data
# - Exposing Shinken APIs:
#   - Status data
#   - Performance data
#   - Command interface
#=========================================
# BROKER
#======================================

define broker {

    #======== Daemon name and address =========
    # Daemon name. Must be unique
    broker_name               broker-master

    # IP/fqdn of this daemon (note: you MUST change it by the real ip/fqdn of this server)
    address                   localhost

    # Port (HTTP/HTTPS) exposed by this daemon
    port                      7772

    # 0 = use HTTP, 1 = use HTTPS
    use_ssl	                  0


    #========================
# Description: The broker is responsible for:
# - Exporting centralized logs of all Shinken daemon processes
# - Exporting status data
# - Exporting performance data
# - Exposing Shinken APIs:
#   - Status data
#   - Performance data
#   - Command interface
#============================ Master or spare selection =========
    # 1 = is a spare, 0 = is not a spare
    spare                     0

    # spare_daemon: name of the daemon that will take this daemon job if it dies
    # IMPORTANT:
    #   * a spare_daemon can only be the spare of 1 (and only one) master daemon=========================================

define broker {

# Shinken Enterprise. Lines added by import core. Do not remove it, it's used by Shinken Enterprise to update your objects if you re-import them.
    _SE_UUID            core-broker-060340145ade11e5b703080027f08538
    _SE_UUID_HASH       8e00136f9e61061e07ca0f4a63509b68
# End of Shinken Enterprise part

    #======== Daemon name and address =========
    # Daemon name. *Must a spare_daemon cannot have a spare_daemon
be unique
    broker_name    #   * the spare must have modules with the same module_type as the master broker-master

    # IP/fqdn of this daemon -(note: dependingyou ofMUST thechange valueit ofby the broker__manage_spare__spare_must_have_the_same_list_of_module_type parameterreal ip/fqdn of this server)
    #address Example: spare_daemon              broker-spare
    spare_daemonlocalhost

    # 1 =Port (defaultHTTP/HTTPS) theexposed spareby definedthis with spare_daemon
 must have the sameport module_type as this master
    # 0 = the spare module_type are not checked
    # broker__manage_spare__spare_must_have_the_same_list_of_module_type     1


 7772

    #======== Daemon connection timeout and down state limit =========
    # timeout: how many seconds to consider a node don't answer
    timeout                   3

    # data_timeout: how many second to consider a configuration transfer to be failed
    # because the network bandwidth is too small.
    data_timeout 0 = use HTTP, 1 = use HTTPS
    use_ssl	                  0


    #======== Master or spare selection =========
    # 1 = is a spare, 0 = is not a spare
    spare                         1200

    # maxspare_check_attemptsdaemon: howname of manythe faildaemon checkthat towill considertake this daemon as DEADjob if it dies
    max_check_attempts# IMPORTANT:
    #   * 3

    # Check this daemon every X seconds
    check_interval            60

a spare_daemon can only be the spare of 1 (and only one) master daemon
    #   * a spare_daemon cannot have a spare_daemon
    #======== Modules to enable* forthe thisspare daemon =========
    # Available:
    # - WebUI must have modules with the same module_type as the master
    #     - depending of the value of the broker__manage_spare__spare_must_have_the_same_list_of_module_type parameter
    # Example: spare_daemon      : Visualisation interface
    # - Graphitebroker-Perfdataspare
    spare_daemon

    # 1 = (default) the spare :defined Savewith allspare_daemon metricsmust intohave athe graphite database
    # - sla         same module_type as this master
    # 0 = the spare module_type are not checked
       # broker__manage_spare__spare_must_have_the_same_list_of_module_type     1


    #======== Daemon connection :timeout Saveand sladown intostate a databaselimit =========
    # -timeout: Livestatushow many seconds to consider a node don't answer
    timeout         : TCP    API to query element state, used3

 by nagios external tools like NagVis or Thruk
    # - broker-module-livedata  # data_timeout: how many second to consider a configuration transfer to be failed
    # because the :network RESTbandwidth APIis totoo querysmall.
 all monitored element data_timeout (host, cluster or check)
    # - event-manager-writer    120

    # max_check_attempts: how many fail :check Saveto eventsconsider forthis eventsdaemon manageras (doDEAD
 not forget to activatemax_check_attempts the module in your webui to see data)3

    # -Check Simple-logthis daemon every X seconds
    check_interval             : Save all logs into a common file, Use this module only if you need to have all the check results in one file.
    # - broker--module-report-builder  : External module used by webui--module-report-handler to generate reports
    modules         60


    #======== Modules to enable for this daemon =========
    # Available:
    # - WebUI                          : Visualisation interface
    # - Graphite-Perfdata         WebUI, Graphite-Perfdata, sla, event-manager-writer


  :  #======== Realm and architecture settings =========Save all metrics into a graphite database
    # Realm- to set this daemon into
sla             realm               : Save sla into a All
database
    # - 1Livestatus = take data from the daemon realm and its sub realms
    # 0 = take data only from: theTCP daemonAPI realm
to query element  manage_sub_realms        1


state, used by nagios external tools like NagVis or Thruk
    # In NATted environments, you declare each satellite ip[:port] as seen by
    # *this* Broker (if port not set, the port declared by satellite itself
    # is used)
    #satellitemap    scheduler-1=1.2.3.4:7768, poller-1=1.2.3.5:7771

    # Exchange between Brokers <- Schedulers can be limited by packet size (in kB- broker-module-livedata         : REST API to query all monitored element data (host, cluster or check)
    # - event-manager-writer           : Save events for events manager (do not forget to activate the module in your webui to see data)
    # Note: as compression is automatic, this is a higher limit, and in real case the
- Simple-log                  #   : Save all logs packetsinto willa becommon lowerfile, thanUse this value
module only if you # broks_packet_size 1024


    #======== Memory protection =========need to have all the check results in one file.
    # Are the daemon module process and worker process are waiting for enough- broker--module-report-builder  : External module used by webui--module-report-handler to generate reports
    #modules memory to be available before being launch. Default: 1 (enabled)
    broker__manage_brok__enable_sub_processes_memory_usage_protection   1

 WebUI, Graphite-Perfdata,  # The sub process memory usage protection can have a system reserved memorysla, event-manager-writer
    

    #======== Realm and architecture settings =========
    # thatRealm won'tto beset usedthis bydaemon thesesinto
 sub process when launched
realm    # By default: 0 (no reserved memory)
    # Example: 10  (means 10% ofAll

 the total memory is# reserved1 for= thetake system)
data from the  broker__manage_brok__sub_process_memory_usage_system_reserved_memory    0
daemon realm and its sub realms
    # If0 a= subtake processdata cannotonly from bethe starteddaemon becauserealm
 of the protection, how many seconds
 manage_sub_realms      # it will1

 be retry and wait# thatIn theNATted systemenvironments, memoryyou isdeclare freedeach until it fail to startsatellite ip[:port] as seen by
    # By default: 5 (seconds)
    broker__manage_brok__sub_processes_memory_usage_protection_max_retry_time   5

*this* daemon (if port not set, the port declared by satellite itself
    #======== Brok pusher worker ========= is used)
    # The#satellitemap Broker spawn broks pusher sub process to push to external modules (like WebUI scheduler-1=1.2.3.4:7768, scheduler-2=1.2.3.5:7771

    # Exchange between brokers <- schedulers can be limited by packet size (in kB)
    # theNote: Brokeras willcompression lookis atautomatic, this workeris executiona timehigher limit, and willin killreal ifcase it timeoutthe
    # The  Broker will compute the averagepackets executionwill timebe oflower previousthan workersthis tovalue
    # decide about how many time this worker will take based on:
    # number of broks to send / past average send speed (broks/s)broks_packet_size 1024


    #======== Memory protection =========
    # Are the daemon module process and worker process are waiting for enough
    # Ifmemory thisto timebe isavailable reach,before itbeing meanslaunch. thatDefault: the pusher process is killed
1 (enabled)
    # For small amount of broks to send, it should lead to ridiculously small allowed execution timebroker__manage_brok__enable_sub_processes_memory_usage_protection   1

    # The sub process memory usage protection can have a system reserved memory
    # andthat thewon't facbe toused spawnby thetheses sub process canwhen belaunched
 higher than this value,# soBy wedefault: are0 using(no areserved minimalmemory)
    # execution timeout
    # Default: 5 (second Example: 10  (means 10% of the total memory is reserved for the system)
    broker__manage_brok__sub_process_broksmemory_pusherusage_minsystem_executionreserved_timeoutmemory    0

    # If a 5

sub process cannot be #started Inbecause orderof to manage the fact that the server can slow down during this send, you can setup athe protection, how many seconds
    # ratioit that will be retry usedand towait increasethat the system allowedmemory timeoutis byfreed multiplyuntil it fail to start
    # DefaultBy default: 5 (seconds)
    broker__manage_brok__sub_processprocesses_broksmemory_pusherusage_security_ratioprotection_max_retry_time   5


    #======== Brok pusher worker =========
    # The broker 5

spawn broks pusher sub #process Atto thepush Brokerto startexternal withoutmodules stats, this valid will be used for the timeout
    # Default: 240 (seconds)
    broker__manage_brok__sub_process_broks_pusher_max_execution_timeout           240

    # If a sub process reach a timeout, it will be killed and relaunched. After max retry,(like WebUI)
    # the broker will look at this worker execution time, and will kill if it timeout
    # The broker will compute the average execution time of previous workers to
    # decide about how many time this worker will take based on:
    # thenumber attachedof modulebroks willto besend restarted
/ past average send # Default: 3speed (broks/s)
    broker__manage_brok__sub_process_broks_pusher_max_retry             # If this time is reach, it means that the pusher process is killed

    # For small amount of broks 3



    #======== Enable or not this daemon =========to send, it should lead to ridiculously small allowed execution time
    # 1and =the isfac enabled,to 0spawn =the issub disabled
process can be higher enabledthan this value, so we are using a minimal
    # execution timeout
    1

}

 # Default: 5 (second)
    broker__manage_brok__sub_process_broks_pusher_min_execution_timeout           5

    # In order to manage the fact that the server can slow down during this send, you can setup a
    # ratio that will be used to increase the allowed timeout by multiply it
    # Default: 5
    broker__manage_brok__sub_process_broks_pusher_security_ratio                  5

    # At the broker start without stats, this valid will be used for the timeout
    # Default: 240 (seconds)
    broker__manage_brok__sub_process_broks_pusher_max_execution_timeout           240

    # If a sub process reach a timeout, it will be killed and relaunched. After max retry,
    # the attached module will be restarted
    # Default: 3
    broker__manage_brok__sub_process_broks_pusher_max_retry                       3

    # broker__manage_brok__sub_process_broks_pusher_queue_batch_size:
    #   * defines the maximum number of broks the "queue brok pusher"
    #     process will handle per send to external module ( like WebUI ) .
    #   * Remaining broks will be handled in next send.
    #   * IMPORTANT: increase this value can lead to error on the socket
    # Default: 100000 (broks/batch)
    # broker__manage_brok__sub_process_broks_pusher_queue_batch_size      100000

    # Broks whose serialization time exceeds this threshold will generate a warning
    # Default: 100 (milliseconds)
    # broker__manage_brok__oversized_data_warning_threshold__serialization_time   100

    # Broks whose serialization time exceeds this threshold will generate an error
    # Default: 500 (milliseconds)
    # broker__manage_brok__oversized_data_error_threshold__serialization_time     500


    #======== VMWare / ESXi ==========
    # 1 (default) = if vmware get the ESXi CPU stats value, 0 = do not get value
    vmware__statistics_compute_enable     1


    #======== Enable or not this daemon =========
    # 1 = is enabled, 0 = is disabled
    enabled                  1

}
  
Excerpt
hiddentrue
Scroll Title
anchordata_for_check_sup_de_sup
title
NomModifiable sur UnitéDéfautValeur par défaut à l'installation de ShinkenDescription
No Format
BROKER_PORT

l'Hôte

( Onglet Données )

---7772 7772

Configuration du port de communication avec le Broker.

Modèles définissant cette donnée : 

Note : Cette valeur remplacera la valeur $ARG1$ dans la commande