> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/fr/plateforme/monitoring.md).

# Surveillance

PowerShell Universal s'intègre automatiquement à Microsoft Application Insights pour assurer la surveillance et les alertes de votre système. Il fournit également des compteurs de performances pour diverses fonctionnalités de l'environnement.

## Application Insights

### Configuration d'Application Insights

Dans le portail Azure, vous devez créer une nouvelle ressource Application Insights. Une fois celle-ci créée, vous devez copier la chaîne de connexion.

![Application Insights Information](/files/GK99z8TYZrF9ataZwlkM)

Ensuite, collez votre chaîne de connexion dans le [fichier de paramètres](/powershell-universal/fr/config/settings.md) de PowerShell Universal. Enfin, redémarrez le serveur PowerShell Universal. La surveillance de l'application sera alors activée.

```json
  "ApplicationInsights": {
    "ConnectionString": "InstrumentationKey=73b84b67-6fc9-4c37-9f54-000000000000"
  },
```

Si vous exécutez PowerShell Universal dans Azure, vous pouvez également créer un nouveau paramètre d'application. Dans votre application web, cliquez sur Configuration, puis sur Nouveau paramètre d'application.

Le nom doit être :

```
APPLICATIONINSIGHTS__CONNECTIONSTRING
```

La valeur doit correspondre à la chaîne de connexion. Redémarrez votre application web pour commencer à collecter des métriques.

### Affichage des données de surveillance

Dans le portail Azure, vous pouvez consulter la ressource Application Insights pour obtenir des informations sur votre serveur PowerShell Universal. Ces informations comprennent notamment les réponses en échec, le temps de réponse du serveur, les requêtes au serveur et la disponibilité. Vous pourrez également configurer des alertes pour surveiller des conditions particulières du serveur PowerShell Universal.

## Compteurs de performances

{% hint style="info" %}
Les compteurs de performances sont uniquement pris en charge sur Windows.
{% endhint %}

Les compteurs de performances sont installés lors de l'exécution du programme d'installation MSI. Une fois cette étape effectuée, les données de performances sont automatiquement générées par les compteurs suivants.

* PowerShell Universal \ Active API Endpoints \ \_Total
* PowerShell Universal \ Active API Endpoints \ Endpoint
* PowerShell Universal \ API Endpoint Calls per Second \ \_Total
* PowerShell Universal \ API Endpoint Calls per Second \ Endpoint
* PowerShell Universal \ API Execution Time \ \_Total
* PowerShell Universal \ API Execution Time \ Endpoint
* PowerShell Universal \ Active Dashboard Connections \ \_Total
* PowerShell Universal \ Active Dashboard Connections \ Dashboard

### Installation

Par défaut, le programme d'installation MSI installe les compteurs de performances. Si vous exécutez PowerShell Universal en dehors du MSI, vous devrez les installer manuellement. Vous pouvez le faire à l'aide du script suivant. Vous devrez l'exécuter depuis une invite avec élévation de privilèges.

```powershell
$categoryName = "PowerShell Universal"
$categoryType = [System.Diagnostics.PerformanceCounterCategoryType]::MultiInstance
$categoryExists = [System.Diagnostics.PerformanceCounterCategory]::Exists($categoryName)

If (-Not $categoryExists)
{
$objCCDC = New-Object System.Diagnostics.CounterCreationDataCollection
$objCCD1 = New-Object System.Diagnostics.CounterCreationData
$objCCD1.CounterName = "Active Endpoints"
$objCCD1.CounterType = "NumberOfItems32"
$objCCD1.CounterHelp = "Active number of executing endpoints."
$objCCDC.Add($objCCD1) | Out-Null

$objCCD1 = New-Object System.Diagnostics.CounterCreationData
$objCCD1.CounterName = "Execution Time"
$objCCD1.CounterType = "averageTimer32"
$objCCD1.CounterHelp = "Average execution time."
$objCCDC.Add($objCCD1) | Out-Null

$objCCD1 = New-Object System.Diagnostics.CounterCreationData
$objCCD1.CounterName = "Execution Time Base"
$objCCD1.CounterType = "averageBase"
$objCCD1.CounterHelp = "Average execution time base."
$objCCDC.Add($objCCD1) | Out-Null

$objCCD1 = New-Object System.Diagnostics.CounterCreationData
$objCCD1.CounterName = "Calls per second"
$objCCD1.CounterType = "rateOfCountsPerSecond64"
$objCCD1.CounterHelp = "Number of executions per second."
$objCCDC.Add($objCCD1) | Out-Null

$objCCD1 = New-Object System.Diagnostics.CounterCreationData
$objCCD1.CounterName = "Active Connections"
$objCCD1.CounterType = "numberOfItems64"
$objCCD1.CounterHelp = "Number of active connections to dashboards"
$objCCDC.Add($objCCD1) | Out-Null

[System.Diagnostics.PerformanceCounterCategory]::Create($categoryName, $categoryHelp, $categoryType, $objCCDC)|Out-Null
}
```

## Processus

Les processus démarrés directement depuis PowerShell Universal s'affichent dans la page des processus. Vous pouvez accéder à cette page en cliquant sur Accueil, puis sur la carte Processus.

Les informations affichées comprennent l'identifiant du processus, son objectif, le nom du fichier et l'utilisation de la mémoire. Vous pouvez également consulter l'état des runspaces au sein du processus.

<figure><img src="/files/vI6qQ0IGvOTrZG3oykVm" alt=""><figcaption></figcaption></figure>

Notez que les processus démarrés par vos scripts ne seront pas répertoriés ici.

## Sessions utilisateur

Vous pouvez consulter les sessions utilisateur pour les tableaux de bord et la console d'administration en cliquant sur la carte Sessions utilisateur de la page d'accueil. Les informations de session comprennent l'heure de connexion, la source, le nom d'utilisateur, la chaîne de l'agent utilisateur et l'adresse IP distante.

<figure><img src="/files/XAWxCrr0XmPcP8bXtpHU" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/fr/plateforme/monitoring.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
