| Scroll Ignore | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||
|
Concept
Ce module permet de dรฉfinir les paramรจtres d'accรจs aux donnรฉes SLA pour la gรฉnรฉration des rapports.
Il est possible, si vous avez plusieurs modules de type "broker__module_report_builder" d'avoir plusieurs configurations de ce module ( pour, par exemple, se connecter sur des bases MongoDB diffรฉrentes ).
| Warning |
|---|
Les paramรจtres dรฉfinissant le calcul du taux de disponibilitรฉ des SLA pour ce module doivent รชtre les mรชmes que ceux du module SLA attachรฉ au Broker qui รฉcrit les SLA pour le royaume. |
Activation du module
Les modules de type "report_builder__module_sla_reader" sont des modules qui doivent รชtre activรฉs sur un module de type "broker__module_report_builder".
- L'activation du module s'effectue en ajoutant le nom de ce module dans le fichier de configuration du module de type
"broker__module_report_builder"correspondant. - Pour cela, ouvrir le fichier de configuration du module de type
"broker__module_report_builder", et ajouter le nom du module de type"report_builder__module_sla_reader"dans le paramรจtre modules.
Pour prendre en compte le changement de configuration, redรฉmarrer l'Arbiter:
| No Format |
|---|
service shinken-arbiter restart |
| Warning |
|---|
Pour pouvoir disposer des rapports, il faut activer un et un seul module |
Exemple d'activation du module nommรฉ "report-builder--module-sla-reader" sur le module nommรฉ broker--module-report-builder ( configuration livrรฉe par dรฉfaut par Shinken )
L'exemple suivant active le module "report-builder--module-sla-reader" ( dont la configuration est dans le fichier /etc/shinken/modules/report-builder--module-sla-reader.cfg ), pour le
Le module report-builder--module-sla-reader est un module qui doit รชtre activรฉ sur le module broker--module-report-builder.
| Warning |
|---|
Ce module est obligatoire pour pouvoir disposer des rapports. |
"broker--module-report-builder" correspondant.broker--module-report-builder" ( par dรฉfautย de Shinken le fichier de configuration du module "broker--module-report-builder"
( dont la configuration est dans le fichier /etc/shinken/modules/broker--module-report-builder.cfg
ย ))
Modification dans le fichier
, et ajouter le nom du module "
broker-
-
module-
report-
Exemple : avec un module dont le nom est "report-builder--module-sla-reader" :builde" "/etc/shinken/modules/broker--module-report-builder.cfg"
| Code Block | ||||
|---|---|---|---|---|
| ||||
define module {
[...]
modules Module 1, Module 2, Module 3, report-builder--module-sla-reader
ย [...]
} |
Pour prendre en compte le changement de configuration, redรฉmarrer l'Arbiter:
| No Format |
|---|
service shinken-arbiter restart |
Configuration
La configuration du module se trouve par dรฉfaut dans le fichier /etc/shinken/modules/report-builder--module-sla-reader.cfg
- Un exemple de configuration est รฉgalement disponibleย dans /etc/shinken-user-example/configuration/daemons/brokers/modules/broker__module_report_builder/modules/report_builder__module_sla_reader/report-builder--module-sla-reader-example.cfg
Exemple de fichier de configuration
| Code Block | ||||
|---|---|---|---|---|
| ||||
# CFG_FORMAT_VERSION 1 ( SHINKEN : DON'T TOUCH THIS LINE )
#================================================================================
# report-builder--module-sla-reader
#================================================================================
# Modules that can load this module:
# - broker--module-report-builder
# This module reads SLA data from a mongodb database
#================================================================================
define module {
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ #
# โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ MODULE IDENTITY โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ #
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ #
# โโโ Module name [ Must be unique ] [ MANDATORY ] โโโ
# โโโ โโโ
module_name report-builder--module-sla-reader
# โโโ Module type [ Do not edit ] [ MANDATORY ] โโโ
# โโโ โโโ
module_type report_builder__module_sla_reader
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ #
# โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ 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 sla data โโโ
# โโโ
# Default : shinken โโโ
# โโโ โโโ
# database shinken
# โโโ username/password to authenticate to MongoDB. โโโ
# โโโ Both parameters must be provided for authentication to function correctly. โโโ
# โโโ โโโ
# database__username
# โโโ โโโ
# database__password
# โโโ SSH tunnel activation to secure your mongodb connection โโโ
# โโโ That will allow all mongodb to be encrypted & authenticated with SSH โโโ
# โโโ
# Default : 0 => Disable ( disable ssh tunnel ) โโโ
# ... : 1 => Enable ( enable ssh tunnel ) โโโ
# โโโ โโโ
# use_ssh_tunnel 0
# โโโ If the SSH connection goes wrong, then retry use_ssh_retry_failure time before_shinken_inactive โโโ
# โโโ
# Default : 1 ( number of retry ) โโโ
# โโโ โโโ
# 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 ( number of 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. โโโ
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ #
# โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ SLA CALCULATION โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ #
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ #
# โโโ Some status can impact โโโ
# โโโ -> positively (counted as OK/UP) โโโ
# โโโ -> negatively (counted as CRITICAL/DOWN) โโโ
# โโโ -> not impact the SLA โโโ
# โโโ (is not counted, meaning the period of study is reduced by the period that is not counted). โโโ
# โโโ This configuration aims at giving Shinken administrators a way to configure โโโ
# โโโ how the SLA are calculated. โโโ
# โโโ SLA are computed on a daily basis. โโโ
# โโโ SLA of the current day are always recomputed after a configuration change. โโโ
# โโโ SLA from days before are by default not recomputed. โโโ
# โโโ
# Default : 0 => Disable ( old SLA will not be recalculated ) โโโ
# ... : 1 => Enable ( old SLA will be recomputed with current settings ) โโโ
# โโโ โโโ
# recompute_old_sla 0
# โโโ Warning periods โโโ
# โโโ
# Default : 0 => Warning counts as DOWN โโโ
# ... : 1 => Warning counts as UP โโโ
# โโโ โโโ
# warning_counts_as_ok 0
# โโโ Unknown periods โโโ
# โโโ
# Default : include => "Unknown" status is counted negatively in the SLA. โโโ
# ... : exclude => "Unknown" are not counted from SLA considered period. โโโ
# ... : ok => "Unknown" are considered as UP periods โโโ
# โโโ โโโ
# unknown_period include
# โโโ No_data periods ( "Missing data" and "Shinken inactive" status ) โโโ
# โโโ
# Default : include => Only status is considered. "Missing data" and "Shinken inactive" โโโ
# status are counted negatively in the SLA. โโโ
# ... : exclude => No_data are not counted from SLA considered period. โโโ
# ... : ok => No_data are considered as UP periods. โโโ
# โโโ โโโ
# no_data_period include
# โโโ Downtime periods โโโ
# โโโ
# Default : include => Only status is considered. โโโ
# ... : exclude => Downtimes are not counted from SLA considered period. โโโ
# ... : ok => Downtimes are considered as UP periods. โโโ
# ... : critical => Downtimes are considered as DOWN periods. โโโ
# โโโ โโโ
# downtime_period include
} |
Dรฉtails des sections composant le fichier de configuration
Identification du module
| Code Block | ||||
|---|---|---|---|---|
| ||||
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ #
# โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ MODULE IDENTITY โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ #
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ #
# โโโ Module name [ Must be unique ] [ MANDATORY ] โโโ
# โโโ โโโ
module_name report-builder--module-sla-reader
# โโโ Module type [ Do not edit ] [ MANDATORY ] โโโ
# โโโ โโโ
module_type report_builder__module_sla_reader |
Il est possible de dรฉfinir plusieurs instances de module de type "broker__module_report_builder__module_sla_reader" dans une architecture Shinken.
- Chaque instance devra avoir un nom unique.
| Scroll Title | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||
|
Option de lecture du taux de SLA
| Code Block | ||||
|---|---|---|---|---|
| ||||
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ #
# โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ SLA CALCULATION โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ #
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ #
# โโโ Some status can impact โโโ
# โโโ -> positively (counted as OK/UP) โโโ
# โโโ -> negatively (counted as CRITICAL/DOWN) โโโ
# โโโ -> not impact the SLA โโโ
# โโโ (is not counted, meaning the period of study is reduced by the period that is not counted). โโโ
# โโโ This configuration aims at giving Shinken administrators a way to configure โโโ
# โโโ how the SLA are calculated. โโโ
# โโโ SLA are computed on a daily basis. โโโ
# โโโ SLA of the current day are always recomputed after a configuration change. โโโ
# โโโ SLA from days before are by default not recomputed. โโโ
# โโโ
# Default : 0 => Disable ( old SLA will not be recalculated ) โโโ
# ... : 1 => Enable ( old SLA will be recomputed with current settings ) โโโ
# โโโ โโโ
# recompute_old_sla 0
# โโโ Warning periods โโโ
# โโโ
# Default : 0 => Warning counts as DOWN โโโ
# ... : 1 => Warning counts as UP โโโ
# โโโ โโโ
# warning_counts_as_ok 0
# โโโ Unknown periods โโโ
# โโโ
# Default : include => "Unknown" status is counted negatively in the SLA. โโโ
# ... : exclude => "Unknown" are not counted from SLA considered period. โโโ
# ... : ok => "Unknown" are considered as UP periods โโโ
# โโโ โโโ
# unknown_period include
# โโโ No_data periods ( "Missing data" and "Shinken inactive" status ) โโโ
# โโโ
# Default : include => Only status is considered. "Missing data" and "Shinken inactive" โโโ
# status are counted negatively in the SLA. โโโ
# ... : exclude => No_data are not counted from SLA considered period. โโโ
# ... : ok => No_data are considered as UP periods. โโโ
# โโโ โโโ
# no_data_period include
# โโโ Downtime periods โโโ
# โโโ
# Default : include => Only status is considered. โโโ
# ... : exclude => Downtimes are not counted from SLA considered period. โโโ
# ... : ok => Downtimes are considered as UP periods. โโโ
# ... : critical => Downtimes are considered as DOWN periods. โโโ
# โโโ โโโ
# downtime_period include |
| Scroll Title | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||
|
| Info |
|---|
Plus de dรฉtails sur ces paramรจtres et sur le fonctionnement des SLA sont disponibles sur cette page : Calcul du taux de SLA |
Accรจs ร la base MongoDB
Cette configuration s'effectue dans le fichier de configuration du module.ย
Pour se connecter ร la base MongoDB utilisรฉe pour le stockage des donnรฉes, 2 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'une connexion SSH pour plus de sรฉcuritรฉ.
Configuration des paramรจtres communs aux deux mรฉthodes
| Code Block | ||||
|---|---|---|---|---|
| ||||
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ #
# โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ 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 sla data โโโ
# โโโ
# Default : shinken โโโ
# โโโ โโโ
# database shinken
# โโโ username/password to authenticate to MongoDB. โโโ
# โโโ Both parameters must be provided for authentication to function correctly. โโโ
# โโโ โโโ
# database__username
# โโโ โโโ
# database__password |
| Scroll Title | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||
|
Connexion directe au serveur MongoDB
Par dรฉfaut, le module se connecte de maniรจre directe ร la base MongoDB, avec les paramรจtres communs listรฉs ci-dessus, et le paramรจtre "use_ssh_tunnel" dรฉfini ร 0.
Connexion par SSH 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 ).
| Code Block | ||||
|---|---|---|---|---|
| ||||
# โโโ SSH tunnel activation to secure your mongodb connection โโโ
# โโโ That will allow all mongodb to be encrypted & authenticated with SSH โโโ
# โโโ
# Default : 0 => Disable ( disable ssh tunnel ) โโโ
# ... : 1 => Enable ( enable ssh tunnel ) โโโ
# โโโ โโโ
# use_ssh_tunnel 0
# โโโ If the SSH connection goes wrong, then retry use_ssh_retry_failure time before_shinken_inactive โโโ
# โโโ
# Default : 1 ( number of retry ) โโโ
# โโโ โโโ
# 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 | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||
|
Gestion de l'auto reconnexion avec un cluster MongoDB
| Code Block | ||||
|---|---|---|---|---|
| ||||
# โโโโโโโโโโโโโโ 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 ( number of 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 | ||
|---|---|---|
| ||
Primaire : terme 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.ย รlection : processus de MongoDB pour choisir un nouveau membre Primaire si le membre Primaire actuel devient inaccessible. Voir : 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 SLA va se reconnecter automatiquement au cluster MongoDB.
Il va faire un nombre d'essaisย รฉgal 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 ne 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 | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||
|
Les valeurs par dรฉfaut 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. |
...