> 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/da/platform/monitoring.md).

# Overvågning

Overvåg PowerShell Universal med Azure Application Insights og Windows-ydeevnetællere, og gennemgå aktive processer og brugersessioner i konsollen.

PowerShell Universal integrerer automatisk med Microsoft Application Insights for at levere overvågning og alarmering til Deres system. Det leverer også ydeevnetællere for forskellige funktioner i miljøet.

## Application Insights

### Konfiguration af Application Insights

I Azure Portal skal De oprette en ny Application Insights-ressource. Når den er oprettet, skal De kopiere forbindelsesstrengen.

Indsæt derefter Deres forbindelsesstreng i den [indstillingsfil ](/powershell-universal/da/config/settings.md)til PowerShell Universal. Genstart til sidst PowerShell Universal-serveren. Programovervågning vil nu være aktiveret.

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

Hvis De kører PowerShell Universal i Azure, kan De også oprette en ny Application Setting. I Deres webapp skal De klikke på Configuration og derefter klikke på New application setting.

Navnet skal være:

```
APPLICATIONINSIGHTS__CONNECTIONSTRING
```

Værdien skal være forbindelsesstrengen. Genstart Deres webapp for at begynde at indsamle metrikker.

### Visning af overvågningsdata

I Azure Portal kan De se Application Insights-ressourcen for at se oplysninger om Deres PowerShell Universal-server. Det omfatter data som mislykkede svar, serverens svartid, serveranmodninger og tilgængelighed. De kan også opsætte meddelelser for at overvåge bestemte tilstande på PowerShell Universal-serveren.

## Ydeevnetællere

{% hint style="info" %}
Ydeevnetællere understøttes kun på Windows.
{% endhint %}

Ydeevnetællere installeres, når MSI-installationsprogrammet køres. Når dette er sket, genereres ydeevnedata automatisk af følgende tællere.

* 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

Som standard installerer MSI'en ydeevnetællerne. Hvis De kører PowerShell Universal uden for MSI'en, skal De selv installere dem. De kan gøre det med følgende script. De skal køre det fra en forhøjet prompt.

```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
}
```

## Processer

Processer, der startes direkte fra PowerShell Universal, vises på processiden. De kan få adgang til denne side ved at klikke på Home og derefter kortet Processes.

Oplysningerne omfatter proces-id, formål, filnavn og hukommelsesforbrug. De kan også se tilstanden for runspaces i processen.

Bemærk, at processer, der er startet af Deres scripts, ikke vises her.

## Brugersessioner

De kan se brugersessioner for dashboards og admin console ved at klikke på kortet User Sessions på siden Home. Sessionsoplysningerne omfatter forbindelsestidspunkt, kilde, brugernavn, user agent-streng og ekstern IP-adresse.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/da/platform/monitoring.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
