diff --git a/en/integrations/event-management/sc-bsm.md b/en/integrations/event-management/sc-bsm.md index bbef5425bc9f..114b879e30a3 100644 --- a/en/integrations/event-management/sc-bsm.md +++ b/en/integrations/event-management/sc-bsm.md @@ -3,124 +3,259 @@ id: sc-hp-bsm title: BSM --- -## BSM + Centreon Integration Benefits +## Before starting -BSM Stream Connector sends events related data from **Centreon** to **Micro Focus BSM** (Business Service Management). +- You can send events from a central server, a remote server or a poller. +- By default, this stream connector sends **host_status** and **service_status** events. The event format is shown **[there](#event-format)**. +- Aformentioned events are fired each time a host or a service is checked. Various parameters let you filter out events. -## How it Works +## Installation -* Every time a service or a host's state is checked, the event passes through Centreon Broker, which uses the functions defined in the Stream Connector to send state changes to BSM. +### Dependencies -## Requirements + + -* Integration with BSM requires the ability to access a **webservice on you BSM platform**. Please contact your BSM expert for this part. -* A Centreon account is required with either **admin privileges** or **Export configuration** and **Broker configuration** menu access in the WUI. -* A **`root` access in command-line interface on Centreon central server** is required as well. +Install **Epel** repository. -## Support +```shell +yum -y install epel-release +``` -If you need help with this integration, depending on how you are using Centreon, you can: +Install dependencies. -* **Commercial Edition customers**: please contact the [Centreon Support team](mailto:support@centreon.com). -* **Open Source Edition users** or **Centreon IT-100 users** (free versions): please reach our [Community Slack](https://centreon.github.io) where our users and staff will try to help you. +```shell +yum install luarocks make gcc lua-curl lua-devel +``` -## Integration Walkthrough + -### Installation +Install dnf plugins package. -Login as `root` on the Centreon central server using your favorite SSH client. +```shell +dnf -y install dnf-plugins-core +``` -In case your Centreon central server must use a proxy server to reach the Internet, you will have to export the `https_proxy` environment variable and configure `yum` to be able to install everything. +Install **Powertools** repository. -```bash -export https_proxy=http://my.proxy.server:3128 -echo "proxy=http://my.proxy.server:3128" >> /etc/yum.conf +```shell +dnf config-manager --set-enabled powertools ``` -Now that your Centreon central server is able to reach the Internet, you can run: +Install **Epel** repository. -```bash -yum install -y lua-curl epel-release -yum install -y luarocks -luarocks install luaxml +```shell +dnf -y install epel-release ``` -This package is necessary for the script to run. Now let's download the script: +Install dependencies. -```bash -wget -O /usr/share/centreon-broker/lua/bsm_connector.lua https://raw.githubusercontent.com/centreon/centreon-stream-connector-scripts/master/centreon-certified/bsm/bsm_connector-apiv1.lua -chmod 644 /usr/share/centreon-broker/lua/bsm_connector.lua +```shell +dnf install make gcc libcurl-devel lua-devel luarocks ``` -The BSM StreamConnnector is now installed on your Centreon central server! + -### Broker configuration +Install dnf plugins package. -1. Login to the Centreon WUI using an administrator account. -2. Navigate to the **Configuration** > **Pollers** menu and select **Broker configuration**. -3. Click on the **central-broker-master** broker configuration object and navigate to the **Output** tab. -4. Add a new **Generic - Stream connector** output. -5. Name it as you want (eg. **BSM**) and set the right path for the LUA script: `/usr/share/centreon-broker/lua/bsm_connector.lua`. -6. The parameter `http_server_url` has to be set according to your BSM platforms characteristics: +```shell +dnf -y install dnf-plugins-core +``` + +Install **Epel** repository. -| Name | Type | Value | -|-------------------|--------|-------------------------------------------------------------------| -| `http_server_url` | String | `https://:30005/bsmc/rest/events//` | +```shell +dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm +``` -7. Save your configuration, then navigate to the **Configuration** > **Pollers** menu and select **Pollers**. -8. Select the **Central** poller and click on **Export configuration**. -9. Keep **Generate Configuration Files** and **Run monitoring engine debug (-v)** checked and select **Move Export Files** and then click on the **Export** button. -10. Restart the `cbd` service: +Enable **Codeready** repository. -```bash -systemctl restart cbd +```shell +subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms ``` -Now your central server has loaded the BSM Stream Connector and has started to send data! +Install dependencies. -> To make sure that everything goes fine, you should have a look at `central-broker-master.log` and `stream-connector-bsm.log`, both located in `/var/log/centreon-broker`. +```shell +dnf install make gcc libcurl-devel lua-devel luarocks +``` -#### Advanced configuration + -**Parameters table** +### Lua modules -| Name | Type | Value example | Explanation | -|---------------------|--------|-------------------------------------------------------------------|----------------------------------------------------------------------------------------------| -| `http_server_url` | String | `https://:30005/bsmc/rest/events//` | URL of your BSM platform | -| `http_proxy_string` | String | `http://your.proxy.server:3128` | Proxy string needed to reach the Internet in HTTP/HTTPS | -| `source_ci` | String | `Centreon` (default value) | Name used to identify the transmitter | -| `log_level` | Number | 2 (default value) | Verbosity level for logs 0: errors only 1: +warnings, 2: +verbose, 3: +debug | -| `log_path` | String | `/var/log/centreon-broker/my-custom-logfile.log` | Log file full path and name | -| `max_buffer_size` | Number | 1 (default value) | Number of events to enqueue in buffer before sending | -| `max_buffer_age` | Number | 5 (default value) | Maximum number of seconds before sending an event when `max_buffer_size` hasn't been reached | + + -**Remarks** +Install **luaxml**. -* The default value of 2 for `log_level` is fine for initial troubleshooting, but can generate a huge amount of logs if you monitor a lot of hosts. In order to get less log messages, you should tune this parameter. -* The default value of 1 for `max_buffer_size` works fine and ensures the best response times. You might want to tune it (*ie.* increase it) if you have an important amount of data to send to BSM. +```shell +luarocks install luaxml +``` ---------------- +Install Centreon lua modules. + +```shell +luarocks install centreon-stream-connectors-lib +``` -## How to Uninstall + -1. Login to the Centreon WUI using an administrator account. -2. Navigate to the **Configuration** > **Pollers** menu and select **Broker configuration**. -3. Click on the **central-broker-master** broker configuration object and navigate to the **Output** tab. -4. Delete the **Generic - Stream connector** output by clicking on the red circled cross at the end of the line. -5. Save your configuration, then navigate to the **Configuration** > **Pollers** menu and select **Pollers**. -6. Select the **Central** poller and click on **Export configuration**. -7. Keep **Generate Configuration Files** and **Run monitoring engine debug (-v)** checked and select **Move Export Files** and then click on the **Export** button. -8. Restart the `cbd` service: +Install **lua-curl**. -```bash -systemctl restart cbd +```shell +luarocks install Lua-cURL ``` -The Stream Connector is not loaded anymore! +Install **luaxml**. + +```shell +luarocks install luaxml +``` + +Install Centreon lua modules. + +```shell +luarocks install centreon-stream-connectors-lib +``` + + + +### Download BSM stream connector + +```shell +wget -O /usr/share/centreon-broker/lua/bsm-events-apiv2.lua https://raw.githubusercontent.com/centreon/centreon-stream-connector-scripts/master/centreon-certified/bsm/bsm-events-apiv2.lua +chmod 644 /usr/share/centreon-broker/lua/bsm-events-apiv2.lua +``` + +## Configuration + +To configure your stream connector, you must **head over** the **Configuration --> Poller --> Broker configuration** menu. **Select** the **central-broker-master** configuration (or the appropriate broker configuration if it is a poller or a remote server that will send events) and **click** the **Output tab** when the broker form is displayed. + +**Add** a new **generic - stream connector** output and **set** the following fields as follow: + +| Field | Value | +| --------------- | ------------------------------------------------------ | +| Name | BSM | +| Path | /usr/share/centreon-broker/lua/bsm-events-apiv2.lua | + +### Add BSM mandatory parameters + +Stream connectors have a set of mandotory parameters dedicated to the Software that they are associated with. To add them you must **click** on the **+Add a new entry** button located **below** the **filter category** input. + +| Type | Name | Value (explanation) | defaultvalue | +|--------|---------------------|------------------------------------------------------------------------------------------------------------------------| ----------------------------------------------------------------- | +| String | `http_server_url` | URL of your BSM platform | `https://:30005/bsmc/rest/events//` | -9. Optionally, you can even delete the script file: +### Add BSM optional parameters -```bash -rm -f /usr/share/centreon-broker/lua/bsm_connector.lua +Some stream connectors have a set of optional parameters dedicated to the Software that they are associated with. To add them you follow the same process as for the mandatory parameters. + +| Type | Name | Value (explanation) | defaultvalue | +|--------|---------------------|------------------------------------------------------------------------------------------------------------------------| ----------------------------------------------------------------- | +| String | `http_proxy_string` | Setting the proxy to output to the Internet in HTTP/HTTPS | `http://your.proxy.server:3128` | +| String | `source_ci` | Name to identify the sender | `Centreon` | +| Number | `log_level` | Log verbosity level 0: errors only, 1: +warnings, 2: +verbose, 3: +debug | 2 | +| String | `log_path` | Full path of the log file | `/var/log/centreon-broker/my-custom-logfile.log` | +| Number | `max_buffer_size` | Maximum number of events to be buffered while waiting to be transmitted in one transmission | 1 | +| Number | `max_buffer_age` | Maximum time to wait before sending events to the buffer if `max_buffer_size` is not yet reached | 5 | + +### Proxy configuration + +When using a proxy to connect to the BSM endpoint, you can use additional parameters to configure it: + +| Type | Name | Value explanation | +| -------- | ------------------ | ----------------------------------------------------- | +| string | proxy_address | Proxy address | +| number | proxy_port | Proxy port (mandatory when proxy_address is set) | +| string | proxy_username | Proxy username the file in which logs are written | +| password | proxy_password | Proxy password (mandatory when proxy_username is set) | + +### Standard parameters + +All stream connectors can use a set of optional parameters that are made available through Centreon stream connectors lua modules. + +All those parameters are documented **[here](https://github.com/centreon/centreon-stream-connector-scripts/blob/master/modules/docs/sc_param.md#default-parameters)**. + +Some of them are overridden by this stream connector. + +| Type | Name | Default value for the stream connector | +| ------ | ------------------- | -------------------------------------- | +| string | accepted_categories | neb | +| string | accepted_elements | host_status,service_status | + +## Event bulking + +This stream connector is compatible with event bulking. Meaning that it is able to send more that one event in each call to the BSM REST API. + +To use this feature you must add the following parameter in your stream connector configuration. + +| Type | Name | Value | +| ------ | --------------- | --------------- | +| number | max_buffer_size | `more than one` | + +## Event format + +This stream connector will send event with the following format. + +### Service status event + +```xml +{ + "" + "" Central "" + "" Ping "" + "" 0 "" + "" 1640862289 "" + "" OK - 10.30.2.31 rta 0.285ms lost 0% "" + "" 0 "" no url for this service "" + "" 19 "" + "" 546 "" + "" 0 "" + "" +} +``` + +### Host status event + +```xml +{ + "" + "" Central "" + "" 0 "" + "" no notes found on host "" + "" no action url for this host "" + "" Centreon "" + "" 0 "" + "" 0 "" + "" +} ``` +### Custom event format + +This stream connector allows you to change the format of the event to suit your needs. Only the **event** part of the json is customisable. It also allows you to handle events type that are not handled by default such as **ba_status events**. + +In order to use this feature you need to configure a json event format file and add a new stream connector parameter. + +| Type | Name | Value | +| ------ | ----------- | ------------------------------------------------------- | +| string | format_file | /etc/centreon-broker/lua-conf/bsm-events-format.json | + +> The event format configuration file must be readable by the centreon-broker user + +To learn more about custom event format and templating file, head over the following **[documentation](https://github.com/centreon/centreon-stream-connector-scripts/blob/master/modules/docs/templating.md#templating-documentation)**. + +## Curl commands + +Here is the list of all the curl commands that are used by the stream connector. + +### Send events + +```shell +curl -X POST https://centreon.bsm.server:30005/bsmc/rest/events/myCentreon/ + -H "Content-Type: application/xml" + -H "Accept: application/xml" + -d "CentralPing01640862289OK - 10.30.2.31 rta 0.285ms lost 0%0no url for this service195460" +``` diff --git a/fr/integrations/event-management/sc-bsm.md b/fr/integrations/event-management/sc-bsm.md index 863433a43b36..bc173d208138 100644 --- a/fr/integrations/event-management/sc-bsm.md +++ b/fr/integrations/event-management/sc-bsm.md @@ -3,126 +3,235 @@ id: sc-hp-bsm title: BSM --- -## Ce qu'apporte l'intégration de BSM + Centreon +## Installation -Le Stream Connector BSM envoie les données de **Centreon** vers le gestionnaire de service **Micro Focus BSM** (Business Service Management). +### Dépendances -## Comment ça marche + + -* Chaque fois qu'un service ou un hôte est vérifié par le moteur de supervision, le résultat passe par *Centreon Broker*, qui utilise les fonctions définies dans le script du Stream Connector pour transmettre les changements d'état à BSM. +Installer le dépôt **Epel**. -## Prérequis +```shell +yum -y install epel-release +``` -* Pour pouvoir transmettre des données vers BSM, il faut avoir créé un webservice au préalable. Veuillez contacter votre expert BSM pour cette partie. -* L'intégration d'un Stream Connector nécessite un **compte Centreon avec des privilèges d'administrateur** ou bien les accès aux menus **Exporter la configuration** et **Configuration de Centreon Broker**. -* Un **accès `root` en ligne de commande sur le serveur Centreon central** est également requis. +Installer les dépendances. -## Support +```shell +yum install luarocks make gcc lua-curl lua-devel +``` -Si vous avez besoin d'aide, vous pourrez en trouver via deux canaux, suivant votre statut : + -* **Clients de Centreon titulaires d'un contrat de support** : vous pouvez vous adresser directement à [l'équipe du Support de Centreon](mailto:support@centreon.com). -* **Utilisateurs de l'édition Open Source** ou de **Centreon IT-100** (versions gratuites) : nous vous invitons à rejoindre notre [communauté sur Slack](https://centreon.github.io) où nos utilisateurs et nos équipes feront de leur mieux pour vous aider. +Installez le paquet dnf plugins. -## Procédure d'intégration +```shell +dnf -y install dnf-plugins-core +``` -### Installation +Installer le dépôt **Powertools**. -Se connecter en tant que `root` au serveur central Centreon avec votre client SSH favori. +```shell +dnf config-manager --set-enabled powertools +``` -Dans le cas où votre serveur doit passer par un proxy pour accéder à Internet, il faudra exporter la variable d'environnement `https_proxy` et configurer `yum` pour être en mesure d'installer toutes les dépendances. +Installer le dépôt **Epel**. -```bash -export https_proxy=http://my.proxy.server:3128 -echo "proxy=http://my.proxy.server:3128" >> /etc/yum.conf +```shell +dnf -y install epel-release ``` -Maintenant que le serveur peut accéder à Internet, lancer les commandes : +Installer les dépendances. -```bash -yum install -y lua-curl epel-release -yum install -y luarocks -luarocks install luaxml +```shell +dnf install make gcc libcurl-devel lua-devel luarocks ``` -Ce paquet est nécessaire au bon fonctionnement du script LUA qu'il ne reste plus qu'à télécharger : + -```bash -wget -O /usr/share/centreon-broker/lua/bsm_connector.lua https://raw.githubusercontent.com/centreon/centreon-stream-connector-scripts/master/centreon-certified/bsm/bsm_connector-apiv1.lua -chmod 644 /usr/share/centreon-broker/lua/bsm_connector.lua -``` +Installez le paquet dnf plugins. -Le Stream Connector BSM est maintenant installé sur votre serveur Centreon central ! +```shell +dnf -y install dnf-plugins-core +``` -### Configuration +Installer le dépôt **Epel**. -#### Configuration de *Centreon Broker* +```shell +dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm +``` -1. Se connecter à l'interface Web de Centreon avec un compte administrateur. -2. Naviguer vers **Configuration** > **Collecteurs** et choisir **Configuration de Centreon Broker**. -3. Cliquer sur l'objet de configuration **central-broker-master** et naviguer dans l'onglet **Output**. -4. Sélectionner **Generic - Stream connector** et cliquer sur **Ajouter** pour créer une nouvelle sortie. -5. Choisir son nom (**Name**) par exemple **BSM** et saisir l'emplacement (**Path**) où le script a été installé : `/usr/share/centreon-broker/lua/bsm_connector.lua`. -6. Le paramètre `http_server_url` est à personnaliser dans tous les cas : +Activez le dépôt **Codeready**. -| Name | Type | Value | -|-------------------|--------|-------------------------------------------------------------------| -| `http_server_url` | String | `https://:30005/bsmc/rest/events//` | +```shell +subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms +``` -7. Sauvegarder la configuration, puis naviguer vers le menu **Configuration** > **Collecteurs** et choisir **Collecteurs**. -8. Sélectionner le collecteur **Central** et cliquer sur **Exporter la configuration**. -9. Conserver les cases **Générer les fichiers de configuration** et **Lancer le débogage du moteur de supervision (-v)** et cocher également **Deplacer les fichiers générés** puis cliquer sur le bouton **Exporter**. -10. Redémarrer le service `cbd` : +Installer les dépendances. -```bash -systemctl restart cbd +```shell +dnf install make gcc libcurl-devel lua-devel luarocks ``` -Votre serveur central a maintenant chargé le Stream Connector et commence à envoyer des données vers BSM ! + + +### Lua modules -> Pour s'assurer que tout fonctionne bien, on consultera les fichiers `central-broker-master.log` et `stream-connector-bsm.log`, tous deux situés à l'emplacement `/var/log/centreon-broker` du serveur central. + + -#### Configuration avancée +Installer les modules lua de Centreon. -**Tableau des paramètres** +```shell +luarocks install centreon-stream-connectors-lib +``` -| Name | Type | Value (exemple) | Explication | -|---------------------|--------|-------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------| -| `http_server_url` | String | `https://:30005/bsmc/rest/events//` | URL de votre plateforme BSM | -| `http_proxy_string` | String | `http://your.proxy.server:3128` | Paramétrage du proxy permettant de sortir vers Internet en HTTP/HTTPS | -| `source_ci` | String | `Centreon` (valeur par défaut) | Nom permettant d'identifier l'émetteur | -| `log_level` | Number | 2 (valeur par défaut) | Niveau de verbosité des logs 0: errors seulement, 1: +warnings, 2: +verbose, 3: +debug | -| `log_path` | String | `/var/log/centreon-broker/my-custom-logfile.log` | Chemin complet du fichier de log | -| `max_buffer_size` | Number | 1 (valeur par défaut) | Nombre maximum d'événements à stocker en mémoire tampon en attendant de les transmettre en un seul envoi | -| `max_buffer_age` | Number | 5 (valeur par défaut) | Temps d'attente maximum avant d'envoyer les événements en mémoire tampon si `max_buffer_size` n'est pas encore atteint | + -**Remarques** +Installer **lua-curl**. -* La valeur par défaut de 2 pour le paramètre `log_level` est adaptée à la mise en place et au *troubleshooting* initial éventuel, cela peut cependant générer un volume important de logs. Il est donc recommandé, une fois la mise en place validée, de l'abaisser à 1. -* La valeur par défaut de 1 pour le paramètre `max_buffer_size` fonctionne bien et garantit une latence réduite au minimum entre l'apparition d'une alerte et sa transmission à BSM. Il pourrait s'avérer utile de l'augmenter dans le cas où le flux à transmettre comporterait en continu plusieurs événements par seconde et au-delà. +```shell +luarocks install Lua-cURL +``` ---------------- +Installer les modules lua de Centreon. -## Désinstallation +```shell +luarocks install centreon-stream-connectors-lib +``` -1. Se connecter à l'interface Web de Centreon avec un compte administrateur. -2. Naviguer vers **Configuration** > **Collecteurs** et choisir **Configuration de Centreon Broker**. -3. Cliquer sur l'objet de configuration **central-broker-master** et naviguer dans l'onglet **Output**. -4. Supprimer la sortie **Generic - Stream connector** en cliquant sur la croix rouge entourée d'un cercle à la fin de la ligne. -5. Sauvegarder la configuration, puis naviguer vers le menu **Configuration** > **Collecteurs** et choisir **Collecteurs**. -6. Sélectionner le collecteur **Central** et cliquer sur **Exporter la configuration**. -7. Conserver les cases **Générer les fichiers de configuration** et **Lancer le débogage du moteur de supervision (-v)** et cocher également **Deplacer les fichiers générés** puis cliquer sur le bouton **Exporter**. -8. Redémarrer le service `cbd` : + -```bash -systemctl restart cbd +### Télécharger le Stream Connector BSM events + +```shell +wget -O /usr/share/centreon-broker/lua/bsm-events-apiv2.lua https://raw.githubusercontent.com/centreon/centreon-stream-connector-scripts/master/centreon-certified/bsm/bsm-events-apiv2.lua +chmod 644 /usr/share/centreon-broker/lua/bsm-events-apiv2.lua ``` -Le Stream Connector n'est plus chargé par `centreon-broker`. +## Configuration + +Pour configurer votre Stream Connector, vous devez **allez** dans le menu **Configuration --> Poller --> Broker configuration**. **Sélectionner** la configuration **central-broker-master** (ou la configuration de broker appropriée s'il s'agit d'un poller ou d'un serveur distant qui enverra des événements) et **cliquer** sur l'onglet **Output** lorsque le formulaire du broker s'affiche. + +**Ajouter** une nouvelle sortie **généric - stream connector** et **régler** les champs suivants comme suit : + +| Field | Value | +| --------------- | ------------------------------------------------------ | +| Name | BSM | +| Path | /usr/share/centreon-broker/lua/bsm-events-apiv2.lua | + +### Ajouter les paramètres obligatoires de BSM + +Chaque Stream Connector dispose d'un ensemble de paramètres obligatoires. Pour les ajouter, vous devez **cliquer** sur le bouton **+Add a new entry** situé **sous** l'entrée **filter category**. + +| Type | Name | Value (explanation) | defaultvalue | +|--------|---------------------|------------------------------------------------------------------------------------------------------------------------| ----------------------------------------------------------------- | +| String | `http_server_url` | URL of your BSM platform | `https://:30005/bsmc/rest/events//` | + +### Ajouter les paramètres optionnels de BSM + +Certains Stream Connector disposent d'un ensemble de paramètres optionnels dédiés au logiciel auquel ils sont associés. Pour les ajouter, vous devez **cliquer** sur le bouton **+Add a new entry** situé **sous** l'entrée **filter category**. + +| Type | Name | Value (explanation) | defaultvalue | +|--------|---------------------|------------------------------------------------------------------------------------------------------------------------| ----------------------------------------------------------------- | +| String | `http_proxy_string` | Setting the proxy to output to the Internet in HTTP/HTTPS | `http://your.proxy.server:3128` | +| String | `source_ci` | Name to identify the sender | `Centreon` | +| Number | `log_level` | Log verbosity level 0: errors only, 1: +warnings, 2: +verbose, 3: +debug | 2 | +| String | `log_path` | Full path of the log file | `/var/log/centreon-broker/my-custom-logfile.log` | +| Number | `max_buffer_size` | Maximum number of events to be buffered while waiting to be transmitted in one transmission | 1 | +| Number | `max_buffer_age` | Maximum time to wait before sending events to the buffer if `max_buffer_size` is not yet reached | 5 | + +### Configuration du proxy -9. Ce n'est pas nécessaire, mais vous pouvez également supprimer le script pour désinstaller complètement le Stream Connector : +Lorsque vous utilisez un proxy pour vous connecter au système BSM, vous pouvez utiliser des paramètres supplémentaires pour le configurer : -```bash -rm -f /usr/share/centreon-broker/lua/bsm_connector.lua +| Type | Name | Value explanation | +| -------- | ------------------ | ----------------------------------------------------- | +| string | proxy_address | Proxy address | +| number | proxy_port | Proxy port (mandatory when proxy_address is set) | +| string | proxy_username | Proxy username the file in which logs are written | +| password | proxy_password | Proxy password (mandatory when proxy_username is set) | + +### Paramètres standard + +Tous les Stream Connectors peuvent utiliser un ensemble de paramètres optionnels qui sont mis à disposition par les modules lua des Stream Connector Centreon. + +Tous ces paramètres sont documentés **[ici](https://github.com/centreon/centreon-stream-connector-scripts/blob/master/modules/docs/sc_param.md#default-parameters)**. + +Certains d'entre eux sont remplacés par ce Stream Connector. + +| Type | Name | Default value for the stream connector | +| ------ | ------------------- | -------------------------------------- | +| string | accepted_categories | neb | +| string | accepted_elements | host_status,service_status | + +## Regroupement d'événements + +Ce Stream Connector n'est pas compatible avec le groupage d'événements. Cela signifie que l'option `max_buffer_size` ne peut pas être supérieure à 1. + +## Format de l'événement + +Ce Stream Connetor enverra l'évenement au format suivant. + +### Service status event + +```xml +{ + "" + "" Central "" + "" Ping "" + "" 0 "" + "" 1640862289 "" + "" OK - 10.30.2.31 rta 0.285ms lost 0% "" + "" 0 "" no url for this service "" + "" 19 "" + "" 546 "" + "" 0 "" + "" +} ``` +### Host status event + +```xml +{ + "" + "" Central "" + "" 0 "" + "" no notes found on host "" + "" no action url for this host "" + "" Centreon "" + "" 0 "" + "" 0 "" + "" +} +``` + +### Format d'événement personnalisé + +Ce Stream Connector vous permet de modifier le format de l'événement en fonction de vos besoins. Seule la partie **event** du json est personnalisable. Il vous permet également de gérer des types d'événements qui ne sont pas gérés par défaut tels que les événements **ba_status**. + +Afin d'utiliser cette fonctionnalité, vous devez configurer un fichier de format d'événement json et ajouter un nouveau paramètre du Stream Connector. + +| Type | Name | Value | +| ------ | ----------- | ------------------------------------------------------- | +| string | format_file | /etc/centreon-broker/lua-conf/bsm-events-format.json | + +> Le fichier de configuration du format des événements doit être lisible par l'utilisateur de *centreon-broker*. + +Pour en savoir plus sur le format d'événement personnalisé et le fichier modèle, consultez cette **[documentation](https://github.com/centreon/centreon-stream-connector-scripts/blob/master/modules/docs/templating.md#templating-documentation)**. + +## Commande curl + +Voici la liste de toutes les commandes curl qui sont utilisées par le Stream Connector. + +### Envoie d'évenements + +```shell +curl -X POST https://centreon.bsm.server:30005/bsmc/rest/events/myCentreon/ + -H "Content-Type: application/xml" + -H "Accept: application/xml" + -d "CentralPing01640862289OK - 10.30.2.31 rta 0.285ms lost 0%0no url for this service195460" +``` \ No newline at end of file