Présentation

 Pour une raison de simplicité de gestion, les dispositions par défaut et le reste de la configuration du module est découpée en plusieurs parties qui se trouve par défaut dans les fichiers suivants :

  • Pour la configuration générale du module : 
    • /etc/shinken/modules/webui_module_service_weather.cfg
      • Fichier d'exemple : /etc/shinken-user-example/configuration/daemons/brokers/modules/webui/modules/webui_module_service_weather/webui_module_service_weather.cfg

  • Pour la configuration de la disposition par défaut de la grille : 
    • /etc/shinken-user/configuration/daemons/brokers/modules/webui/modules/webui_module_service_weather/webui_module_service_weather__default_grid_layout.cfg
  • Pour la configuration de la disposition par défaut de la barre d'information :
    • /etc/shinken-user/configuration/daemons/brokers/modules/webui/modules/webui_module_service_weather/webui_module_service_weather__default_info_bar_layout.cfg
  • Pour la configuration de la disposition par défaut des widgets :
    • /etc/shinken-user/configuration/daemons/brokers/modules/webui/modules/webui_module_service_weather/webui_module_service_weather__default_widgets_layout.cfg


Si vous faite plusieurs module de météos vous devez choisir soit de :

  • Faire un nouveau répertoire appeler par exemple du nom de votre nouveau module pour la configuration
    • exemple /etc/shinken-user/configuration/daemons/brokers/modules/webui/modules/Mon-Module-Webui-Module-Service-Weather
    • Voir la page Module webui-module-service-weather pour plus de détail pour le choix du nom du module
  • Gardé la configuration dans le même répertoire pour uniformiser la configuration des toutes les météos


Configuration du module

Exemple de fichier de configuration

#================================================================================
# webui-module-service-weather
#================================================================================
# Modules that can load this module:
# - WebUI
# This module display service-weather in WebUI
#================================================================================

define module {

# ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ #
# │ ────────────────────────────────────── MODULE IDENTITY ────────────────────────────────────── │ #
# └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ #

# ─── Module name [ Must be unique ] [ MANDATORY ] ───
# ─── ───
module_name webui-module-service-weather

# ─── Module type [ Do not edit ] [ MANDATORY ] ───
# ─── ───
module_type webui_module_service_weather

# ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ #
# │ ────────────────────────────────── EXTERNAL LINKS OPTIONS ─────────────────────────────────── │ #
# └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ #

# ─── This option allows you to change the path for external links. ───
# ─── Use it for security reasons, to have external url with a different path than the ───
# ─── default installation ───
# ─── Change this parameter will change all your external links. ───
# ─── sample url : http://localhost:7767/service-weather/external/abcd01/xyz009 ───
# ─── where : ───
# ─── "http://localhost:7767" is the value of the base url ───
# ─── "external" is the value of this parameter ───
# ─── "abcd01" is the service weather uuid ───
# ─── "xyz009" is the external link configuration uuid ───
# ─── The character / and the others url forbidden characters are not allowed in this parameter ───
# ─── Example : !,#,$,&,',(,),*,+,,/,:,;,=,?,@,[,],<,>, accented characters, ... ───
# ───
# Default : external ───
# ───
# broker__module_webui__module_service_weather__default_external_link__external_part_url external

# ─── This option allows you to change the path for external links. ───
# ─── Use it for security reasons, to have external url with a different path than the ───
# ─── default installation ───
# ─── Change this parameter will change all your external links. ───
# ─── sample url : http://localhost:7767/service-weather/external/abcd01/xyz009 ───
# ─── where : ───
# ─── "http://localhost:7767" is the value of this parameter ───
# ─── "external" is the value of the external_part_url ───
# ─── "abcd01" is the service weather uuid ───
# ─── "xyz009" is the external link configuration uuid ───
# ─── The character / and the others url forbidden characters are not allowed in this parameter ───
# ─── Example : !,#,$,&,',(,),*,+,,/,:,;,=,?,@,[,],<,>, accented characters, ... ───
# ───
# Default : Your broker base url ───
# ───
# broker__module_webui__module_service_weather__default_external_link__base_url

# ─── This option allows you to change if the authentication is needed for an external link. ───
# ───
# Default : 1 ( authentication is needed ) ───
# ... : 0 ( authentication is not needed ) ───
# ───
# broker__module_webui__module_service_weather__default_external_link__authentication_needed 1

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

# ─── INTERNAL : DO NOT EDIT FOLLOWING PARAMETERS WITHOUT YOUR DEDICATED SUPPORT ───
# ─── Maximal number of widgets for one weather page. ───
# ─── Use this to limit your users and prevent them from making a weather page that takes ───
# ─── all server resources. ───
# ─── ───
# broker__module_webui__module_service_weather__default_max_widget_number 100

# ─────────────────────── cache ─────────────────────────────────────────────────────────────────────── #

# ─── The refresh interval in seconds between each cache data calculation. ───
# ─── Increase this period if the cache takes too many resources on server. ───
# ─── Minimum value is 60 seconds. ───
# ───
# Default : 60 ( seconds ) ───
# ───
# broker__module_webui__module_service_weather__cache__refresh_interval 60

# ─── Define the limited time allowed to refresh the cache before raising a warning. ───
# ─── This will be used by the shinken-broker-module-weather-service checks to change its state ───
# ───
# Default : 30 ( seconds ) ───
# ───
# broker__module_webui__module_service_weather__cache__time_taken_for_compute_warning 30

# ─── Define the limited time allowed to refresh the cache before raising an error. ───
# ─── This will be used by the shinken-broker-module-weather-service checks to change its state ───
# ───
# Default : 40 ( seconds ) ───
# ───
# broker__module_webui__module_service_weather__cache__time_taken_for_compute_critical 40

# ─── The time to wait before starting to refresh the cache ───
# ─── At start of the Broker, some element data are not directly available ───
# ─── Increase this time if the module has "missing element" on every element at start ───
# ─── This will give more time to the Scheduler to give all element data to the Broker and the module ───
# ───
# Default : 30 ( seconds ) ───
# ───
# broker__module_webui__module_service_weather__awaited_time_before_fetching_element_data 30

[OVERRIDE_FROM] /etc/shinken-user/configuration/daemons/brokers/modules/webui/modules/webui_module_service_weather/webui_module_service_weather__default_grid_layout.cfg
[OVERRIDE_FROM] /etc/shinken-user/configuration/daemons/brokers/modules/webui/modules/webui_module_service_weather/webui_module_service_weather__default_info_bar_layout.cfg
[OVERRIDE_FROM] /etc/shinken-user/configuration/daemons/brokers/modules/webui/modules/webui_module_service_weather/webui_module_service_weather__default_widgets_layout.cfg

}

Détails des sections composant le fichier de configuration

Identification du module

Il est possible de définir plusieurs instances de module de type "webui-module-service-weather" dans votre architecture Shinken.

  • Chaque instance devra avoir un nom unique.

Nom

Type

Unité

Défaut

Commentaire


module_name 


Texte

---

webui-module-service-weather

Nous vous conseillons de choisir un nom en fonction de l'utilisation du module pour que votre configuration soit simple à maintenir.

Doit être unique.


module_type 


Texte

---

webui_module_service_weather

Ne peut être modifié.


Options des liens externes


# ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ #
# │ ────────────────────────────────── EXTERNAL LINKS OPTIONS ─────────────────────────────────── │ #
# └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ #

# ─── This option allows you to change the path for external links. ───
# ─── Use it for security reasons, to have external url with a different path than the ───
# ─── default installation ───
# ─── Change this parameter will change all your external links. ───
# ─── sample url : http://localhost:7767/service-weather/external/abcd01/xyz009 ───
# ─── where : ───
# ─── "http://localhost:7767" is the value of the base url ───
# ─── "external" is the value of this parameter ───
# ─── "abcd01" is the service weather uuid ───
# ─── "xyz009" is the external link configuration uuid ───
# ─── The character / and the others url forbidden characters are not allowed in this parameter ───
# ─── Example : !,#,$,&,',(,),*,+,,/,:,;,=,?,@,[,],<,>, accented characters, ... ───
# ───
# Default : external ───
# ───
# broker__module_webui__module_service_weather__default_external_link__external_part_url external

# ─── This option allows you to change the path for external links. ───
# ─── Use it for security reasons, to have external url with a different path than the ───
# ─── default installation ───
# ─── Change this parameter will change all your external links. ───
# ─── sample url : http://localhost:7767/service-weather/external/abcd01/xyz009 ───
# ─── where : ───
# ─── "http://localhost:7767" is the value of this parameter ───
# ─── "external" is the value of the external_part_url ───
# ─── "abcd01" is the service weather uuid ───
# ─── "xyz009" is the external link configuration uuid ───
# ─── The character / and the others url forbidden characters are not allowed in this parameter ───
# ─── Example : !,#,$,&,',(,),*,+,,/,:,;,=,?,@,[,],<,>, accented characters, ... ───
# ───
# Default : Your broker base url ───
# ───
# broker__module_webui__module_service_weather__default_external_link__base_url

# ─── This option allows you to change if the authentication is needed for an external link. ───
# ───
# Default : 1 ( authentication is needed ) ───
# ... : 0 ( authentication is not needed ) ───
# ───
# broker__module_webui__module_service_weather__default_external_link__authentication_needed 1


Nom

Type

Unité

Défaut

Commentaire


broker__module_webui__module_service_weather__default_external_link__external_part_url


Texte

---

external

Cette option vous permet de modifier le chemin d'accès aux liens externes.
Exemple d'url : http://localhost:7767/service-weather/external/abcd01/xyz009
Où :

  • http://localhost:7767 est la valeur de la base url
  • external est la valeur de ce paramètre
  • abcd01 est l'uuid de la météo du service
  • xyz009 est l'uuid de configuration du lien externe

Le caractère "/" et les autres caractères interdits dans les URL ne sont pas autorisés dans ce paramètre.
Exemple de caractères interdit : !,#,$,&,',(,),*,+,,/,:,;,=,?,@,[,],<,>, caractères avec des accents, ...


broker__module_webui__module_service_weather__default_external_link__base_url


Texte---La base url du Broker

Cette option vous permet de modifier la base url d'accès aux liens externes.
Exemple d'url : http://localhost:7767/service-weather/external/abcd01/xyz009
Où :

  • http://localhost:7767 est la valeur de ce paramètre
  • external est la valeur du paramètre external_part_url
  • abcd01 est l'uuid de la météo du service
  • xyz009 est l'uuid de configuration du lien externe

Le caractère "/" et les autres caractères interdits dans les URL ne sont pas autorisés dans ce paramètre.
Exemple de caractères interdit : !,#,$,&,',(,),*,+,,/,:,;,=,?,@,[,],<,>, caractères avec des accents, ...


broker__module_webui__module_service_weather__default_external_link__authentication_needed


TexteBooléen1Cette option permet de choisir si une authentification est nécessaire pour avoir accès aux liens externes de la météo.


La modification de ce paramètre entraîne la modification de tous vos liens externes.


Options interne


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

# ─── INTERNAL : DO NOT EDIT FOLLOWING PARAMETERS WITHOUT YOUR DEDICATED SUPPORT ───
# ─── Maximal number of widgets for one weather page. ───
# ─── Use this to limit your users and prevent them from making a weather page that takes ───
# ─── all server resources. ───
# ─── ───
# broker__module_webui__module_service_weather__default_max_widget_number 100

# ─────────────────────── cache ─────────────────────────────────────────────────────────────────────── #

# ─── The refresh interval in seconds between each cache data calculation. ───
# ─── Increase this period if the cache takes too many resources on server. ───
# ─── Minimum value is 60 seconds. ───
# ───
# Default : 60 ( seconds ) ───
# ───
# broker__module_webui__module_service_weather__cache__refresh_interval 60

# ─── Define the limited time allowed to refresh the cache before raising a warning. ───
# ─── This will be used by the shinken-broker-module-weather-service checks to change its state ───
# ───
# Default : 30 ( seconds ) ───
# ───
# broker__module_webui__module_service_weather__cache__time_taken_for_compute_warning 30

# ─── Define the limited time allowed to refresh the cache before raising an error. ───
# ─── This will be used by the shinken-broker-module-weather-service checks to change its state ───
# ───
# Default : 40 ( seconds ) ───
# ───
# broker__module_webui__module_service_weather__cache__time_taken_for_compute_critical 40

# ─── The time to wait before starting to refresh the cache ───
# ─── At start of the Broker, some element data are not directly available ───
# ─── Increase this time if the module has "missing element" on every element at start ───
# ─── This will give more time to the Scheduler to give all element data to the Broker and the module ───
# ───
# Default : 30 ( seconds ) ───
# ───
# broker__module_webui__module_service_weather__awaited_time_before_fetching_element_data 30


Nom

Type

Unité

Défaut

Commentaire


broker__module_webui__module_service_weather__default_max_widget_number


Entier positif

---

100


Nombre maximal de widgets pour une page météo. Utilisez ceci pour limiter vos utilisateurs et les empêcher de faire une page météo qui prend toutes les ressources du serveur.


broker__module_webui__module_service_weather__cache__refresh_interval


Entier positifseconde60

L’intervalle de rafraîchissement en secondes entre chaque calcul de données du cache. Augmentez cette période si le cache prend trop de ressources sur le serveur.


broker__module_webui__module_service_weather__cache__time_taken_for_compute_warning


Entier positif---30

Définie la limite de temps alloué pour rafraîchir le cache, avant de générer un avertissement dans les checks de Sup de Sup. Ceci sera utilisé par les checks shinken-broker-module-weather-service.


broker__module_webui__module_service_weather__cache__time_taken_for_compute_critical


Entier positifseconde40

Définie la limite temps alloué pour rafraîchir le cache avant de générer une erreur dans les checks de Sup de Sup. Ceci sera utilisé par les checks shinken-broker-module-weather-service.


broker__module_webui__module_service_weather__awaited_time_before_fetching_element_data


Entier positifseconde30

Temps d’attente avant de commencer à rafraîchir le cache.

Au démarrage du Broker, certaines données ne sont pas disponibles.

Augmentez cette durée si le module affiche "élément manquant" sur chaque élément au démarrage.

Cela donnera plus de temps au Scheduler pour donner les données au Broker et au module.