-
Notifications
You must be signed in to change notification settings - Fork 127
Improvements to CLM doc #5107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Improvements to CLM doc #5107
Changes from 31 commits
f420147
b2e91fc
457600f
c653148
47400dc
fb621fc
3cd8134
7ef9bb3
da0ecbc
8b3b83d
ea79035
da40dc7
1460fd5
772dddb
823fa4b
f93cba7
6bb4733
d2ae546
a8826d0
736b355
6fd3d4e
38c6af8
32162c0
0f03698
cd21e4f
b3fd9c3
7dfb9c1
0612e73
6ca4b11
26fa25b
76f57ed
bb58fd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,15 +5,15 @@ title: Gérer les jetons d'authentification | |
| import Tabs from '@theme/Tabs'; | ||
| import TabItem from '@theme/TabItem'; | ||
|
|
||
| Chaque hôte a besoin d'un jeton pour s'authentifier auprès de CLM. Ce jeton permet à l'hôte de s'identifier de manière sécurisée lors de l'envoi de données, garantissant ainsi que seuls les hôtes autorisés peuvent se connecter à votre instance CLM et l'utiliser. | ||
| Chaque hôte a besoin d'un jeton pour s'authentifier auprès de Centreon Log Management (CLM). Ce jeton permet à l'hôte de s'identifier de manière sécurisée lors de l'envoi de données, garantissant ainsi que seuls les hôtes autorisés peuvent se connecter à votre plateforme CLM et l'utiliser. | ||
|
|
||
| ## Créer un jeton | ||
|
|
||
| 1. À la page **Administration > Token management**, cliquez sur **Add**. | ||
| 2. Dans la fenêtre qui s'ouvre, entrez un nom (obligatoire) et une description (facultative) pour votre jeton. | ||
| 3. Cliquez sur **Generate token**. La fenêtre affiche votre jeton. Elle ne l'affiche qu'une seule fois : stockez-le de manière sécurisée. Si vous fermez la fenêtre, vous ne pourrez plus afficher le jeton. | ||
|
|
||
| Vous pouvez supprimer un jeton à l'aide de l'icône **Delete** sur la page **Administration > Token management**. Si vous supprimez un jeton, tous les hôtes qui l'utilisent ne pourront plus s'authentifier auprès de CLM. Par conséquent, les logs envoyés par ces hôtes ne parviendront plus à votre instance CLM jusqu'à ce qu'un nouveau jeton valide soit configuré. La suppression d'un jeton est irréversible. | ||
| Vous pouvez supprimer un jeton à l'aide de l'icône **Delete** sur la page **Administration > Token management**. Si vous supprimez un jeton, tous les hôtes qui l'utilisent ne pourront plus s'authentifier auprès de CLM. Par conséquent, les logs envoyés par ces hôtes ne parviendront plus à votre plateforme CLM jusqu'à ce qu'un nouveau jeton valide soit configuré. La suppression d'un jeton est irréversible. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tous les hôtes ( pas certain pour le mot hôte ici) |
||
|
|
||
| ## Utiliser des jetons dans la configuration de votre collecteur Open Telemetry | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,231 @@ | ||
| --- | ||
| id: collector-simple | ||
| title: Configurations simples de collecteur | ||
| --- | ||
|
|
||
| import Tabs from '@theme/Tabs'; | ||
| import TabItem from '@theme/TabItem'; | ||
|
|
||
| Voici deux exemples de configurations simples. Si vous souhaitez collecter plusieurs types de logs à partir d'un même hôte, utilisez la page [Configuration complète de collecteur (sources de logs multiples)](collector.md). | ||
|
|
||
| ## Exemple 1 : Configuration rapide pour commencer à collecter les logs de l'Observateur d'événements Windows | ||
|
|
||
| 1. Sur une machine Windows, [installez l'OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.147.0/otelcol-contrib_0.147.0_windows_x64.msi). | ||
|
|
||
| 2. Dans Centreon Log Management (CLM), [générez un jeton pour authentifier l'hôte auprès de votre plateforme CLM](../administration/tokens.md). | ||
|
|
||
| 3. Sur votre machine Windows, modifiez le fichier **config.yaml** qui a été créé dans le répertoire où vous avez installé OpenTelemetry Collector. Par défaut, il se trouve ici : | ||
|
|
||
| ```shell | ||
| C:\Program Files\OpenTelemetry Collector\config.yaml | ||
| ``` | ||
|
|
||
| 4. Remplacez le contenu du fichier par l'extrait ci-dessous (remplacez **mytoken** par votre jeton). Veillez à enregistrer le fichier en tant qu'administrateur. | ||
|
|
||
| ```yaml | ||
| # Copyright 2025 Centreon. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| exporters: | ||
| otlphttp/centreon: # The exporter that will send logs to CLM | ||
| endpoint: "https://api.euwest1.obs.mycentreon.com/v1/ingress/otlp" | ||
| headers: | ||
| "X-Api-Key": "mytoken" ## Replace mytoken by your actual token | ||
| debug: # The exporter that will write debug info to log files | ||
| verbosity: detailed | ||
|
|
||
| processors: | ||
| batch: # This processor optimizes performance. | ||
| resourcedetection: # This processor enriches ALL logs with the information defined below. | ||
| detectors: ["system"] | ||
| system: | ||
| resource_attributes: # Each log entry will include the 4 attributes listed below. | ||
| host.name: | ||
| enabled: true | ||
| os.name: | ||
| enabled: true | ||
| os.type: | ||
| enabled: true | ||
| os.version: | ||
| enabled: true | ||
|
|
||
| receivers: | ||
| windowseventlog/application: | ||
| channel: application | ||
| operators: | ||
| - type: severity_parser | ||
| parse_from: body.level | ||
| overwrite_text: true | ||
| mapping: | ||
| fatal: | ||
| - Critical | ||
| - Critique | ||
| error: | ||
| - Error | ||
| - Erreur | ||
| warn: | ||
| - Warning | ||
| - Avertissement | ||
| info: | ||
| - Informational | ||
| - Information | ||
| - type: copy | ||
| from: body.execution.process_id | ||
| to: attributes["process.pid"] | ||
| - type: copy | ||
| from: body.provider.name | ||
| to: resource["event.provider.name"] | ||
| - type: copy | ||
| from: body.provider.guid | ||
| to: resource["event.provider.guid"] | ||
| if: "body.provider.guid != ''" | ||
| - type: copy | ||
| from: body.event_id.id | ||
| to: attributes["event.id"] | ||
| - type: copy | ||
| from: body.record_id | ||
| to: attributes["event.record.id"] | ||
| - type: copy | ||
| from: body.task | ||
| to: attributes["event.task"] | ||
| - type: move | ||
| from: body.message | ||
| to: body | ||
| - type: add | ||
| field: resource["service.version"] | ||
| value: "1.0.0" | ||
| - type: add | ||
| field: resource["service.name"] | ||
| value: "windows-event-log" | ||
| - type: add | ||
| field: resource["service.namespace"] | ||
| value: "application" | ||
|
|
||
| service: | ||
| pipelines: # This defines the order in which the collector runs its components. | ||
| logs: | ||
| receivers: [windowseventlog/application] | ||
| processors: [batch, resourcedetection] | ||
| exporters: [otlphttp/centreon] | ||
| ``` | ||
|
|
||
| 5. redémarrez le service OpenTelemetry Collector. | ||
|
|
||
| ```shell | ||
| net stop otelcol-contrib | ||
| net start otelcol-contrib | ||
| ``` | ||
|
|
||
| Vous devriez commencer à recevoir des logs dans Centreon Log Management. | ||
|
|
||
| ## Exemple 2 : Un fichier de configuration avec 3 sources de logs | ||
|
|
||
| Dans l'exemple suivant, nous recevons des données provenant de trois sources différentes sur le même serveur Windows. Les logs transitent par un seul pipeline. Toute la configuration est regroupée dans le fichier **config.yaml** du collecteur. (Suivez la même procédure que pour l'exemple 1 et adaptez le fichier de configuration ci-dessous.) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. je ne suis pas certain de comprendre pourquoi avoir tout mis dans config.yaml ici |
||
|
|
||
|  | ||
|
|
||
| ```yaml | ||
| # Copyright 2025 Centreon | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| exporters: | ||
| otlphttp/centreon: # The exporter that will send logs to CLM | ||
| endpoint: "https://api.euwest1.obs.mycentreon.com/v1/ingress/otlp" | ||
| headers: | ||
| "X-Api-Key": "mytoken" ## Replace mytoken by your actual token | ||
| debug: # The exporter that will write debug info to log files | ||
| verbosity: detailed | ||
|
|
||
| processors: | ||
| batch: # This processor optimizes performance. | ||
| resourcedetection: # This processor enriches ALL logs with the information defined below. | ||
| detectors: ["system"] | ||
| system: | ||
| resource_attributes: # Each log entry will include the 4 attributes listed below. | ||
| host.name: | ||
| enabled: true | ||
| os.name: | ||
| enabled: true | ||
| os.type: | ||
| enabled: true | ||
| os.version: | ||
| enabled: true | ||
|
|
||
| receivers: | ||
|
|
||
| windowseventlog/application: # You will receive logs from the Windows Application Event Log. | ||
| channel: application | ||
| operators: | ||
| - type: severity_parser | ||
| parse_from: body.level | ||
| overwrite_text: true | ||
| mapping: | ||
| fatal: [Critical, Critique] | ||
| error: [Error, Erreur] | ||
| warn: [Warning, Avertissement] | ||
| info: [Informational, Information] | ||
| - type: move | ||
| from: body.message | ||
| to: body | ||
| - type: add | ||
| field: resource["service.namespace"] | ||
| value: "application" | ||
| - type: add | ||
| field: resource["service.name"] | ||
| value: "windows-event-logs" | ||
|
|
||
| filelog/mssql: # You will receive logs from Microsoft SQL Server log files. | ||
|
|
||
| include: | ||
| - 'C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG' | ||
| encoding: utf-16le | ||
| start_at: end | ||
| multiline: | ||
| line_start_pattern: '^\d{4}-\d{2}-\d{2}' | ||
| operators: | ||
| - type: regex_parser | ||
| regex: '^(?P<time>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+)\s+(?P<source>[^\s]+)\s+(?P<msg>(?s).*)' | ||
| timestamp: | ||
| parse_from: attributes.time | ||
| layout: '%Y-%m-%d %H:%M:%S.%f' | ||
| - type: add | ||
| field: resource["service.name"] | ||
| value: "mssql-server" | ||
|
|
||
| filelog/messages: # You will receive logs from the system log files specified in the "include" attribute. | ||
| include: | ||
| - /var/log/messages | ||
| include_file_path: true | ||
| operators: | ||
| - type: regex_parser | ||
| regex: '^(?P<ts>\w{3}\s\d{2}\s\d{2}:\d{2}:\d{2})\s(?P<hostname>[\w_-]+)\s(?P<process>[\w_-]+)(\[(?<pid>\d+)\])?:\s(?<body>.*)$' | ||
| timestamp: | ||
| parse_from: attributes["ts"] | ||
| layout: '%b %d %H:%M:%S' | ||
| - type: move | ||
| from: attributes["pid"] | ||
| to: attributes["process.pid"] | ||
| - type: move | ||
| from: attributes["process"] | ||
| to: resource["service.name"] | ||
| - type: remove | ||
| field: attributes["ts"] | ||
| - type: move | ||
| from: attributes["body"] | ||
| to: body | ||
| # Add a service version, the template version | ||
| - type: add | ||
| field: resource["service.version"] | ||
| value: '1.0.0' | ||
| # Remove the hostname, use the resource detectors | ||
| - type: remove | ||
| field: attributes["hostname"] | ||
|
|
||
| service: | ||
| pipelines: # This defines the order in which the collector runs its components. | ||
| logs: | ||
| receivers: [windowseventlog/application, filelog/mssql, filelog/messages] | ||
| processors: [batch, resourcedetection] | ||
| exporters: [otlphttp/centreon, debug] | ||
|
|
||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| id: collector-troubleshooting | ||
| title: Dépanner votre installation | ||
| --- | ||
|
|
||
| import Tabs from '@theme/Tabs'; | ||
| import TabItem from '@theme/TabItem'; | ||
|
|
||
| Vérifiez l'état de votre collecteur sur l'hôte dont vous souhaitez recevoir les logs : | ||
|
|
||
| ```shell | ||
| journalctl -u otelcol-contrib.service | ||
| ``` | ||
|
|
||
| Si vous ne recevez pas les journaux attendus dans CLM, vérifiez que l'utilisateur **otelcol-contrib** dispose des droits suffisants pour lire les fichiers requis, en fonction du type de receiver. Exemple : | ||
|
|
||
| ```shell | ||
| ls -l /var/log/messages | ||
| id otelcol-contrib | ||
| usermod -aG root otelcol-contrib | ||
| ``` |
Uh oh!
There was an error while loading. Please reload this page.