# Manage agent

## Start/stop agent

1. &#x20;In the **Agent Manager** choose a agent you want start/stop.
2. Select **Stop** if the agent is running but you want to stop the agent.
3. Select **Start** if the agent is stopped but you want to start the agent.

   <figure><img src="/files/Ev16T3OgXayyEe8fO2cB" alt="" width="461"><figcaption></figcaption></figure>

## Export encryption keys

Once you install a agent its important that you export the the encryption keys and store them securely. To export the encryption keys,

1. In the **Agent Manager** select an agent and select  **Details**.
2. Select **Export Keys**.
3. Store exported file securely.

   <figure><img src="/files/G7g5aq67UhGuB0a2T8bi" alt="" width="464"><figcaption></figcaption></figure>

## Uninstall agent

1. &#x20;In the **Agent Manager** select the agent you want to uninstall and select **Details**.
2. Select **Uninstall**.
3. Generate a new token in the Hub and paste it into the uninstaller. Make sure to select the correct agent group when generating the token. Generated tokens are valid for one week.
4. Select **Uninstall** to confirm.

<figure><img src="/files/PrWPsbByVTeIm38tBGbO" alt="" width="462"><figcaption></figcaption></figure>

## Upgrade agent

1. &#x20;In the **Agent Manager** select the agent you want to upgrade and select **Details**.

   <figure><img src="/files/89mtpzyFf2u2SA93s9ah" alt="" width="461"><figcaption></figcaption></figure>
2. Select **Upgrade**.

   <figure><img src="/files/kchgVPZVl0MKtAUJiIRl" alt="" width="462"><figcaption></figcaption></figure>
3. Generate a new token in the Hub and paste it into the installer. Make sure to select the agent group that the agent belongs to when generating the token.&#x20;
4. Select **Upgrade** to confirm.

{% hint style="warning" %}
If you encounter following error during the upgrade, retry the update operation once again.

<img src="/files/nKhxI3PEUrXYtk0wnm8L" alt="" data-size="original">
{% endhint %}

## Access agent logs

1. In the **Agent Manager** select an agent and select **Details**.
2. Select **Open Folder.** This is will open the local file folder where the agent is installed.

   <figure><img src="/files/LiOXVG32t1pUsuEyRwAS" alt="" width="462"><figcaption></figcaption></figure>
3. In the local installation folder you can find sub folder named logs.

   <figure><img src="/files/W830K2flfieSOxE3wBrH" alt="" width="563"><figcaption></figcaption></figure>

## Configure agent logs

By default agent logs are kept for 7 days where a log file is created for each day. You can configure how long the agent logs are kept. *Note that the log configuration is reset every time the agent is upgraded.*

1. In the **Agent Manager** select an agent and select **Details**.
2. **Stop** the agent if its in running state.
3. Select **Open Folder.** This is will open the local file folder where the agent is installed.
4. In the local installation folder find the file named  `appSettings.json` file and open it in you favorite text editor.
5. Modify the parameter *RetainedFileCountLimit.* This number is usually in days. Save the file.

   <figure><img src="/files/wX2ebjZqaF00UGmtY4KG" alt=""><figcaption></figcaption></figure>
6. **Start** the agent again.

## Configure MaxConcurrentExecutions for a agent

By default, agents are configured to allow up to 50 concurrent sessions. You can override this setting by modifying the `appSettings.json` file. Keep in mind that increasing the **`MaxConcurrentExecutions`** value depends on the hardware capabilities of the machine or server where the agent is installed.

1. In the **Agent Manager** select an agent and select **Details**.
2. **Stop** the agent if its in running state.
3. Select **Open Folder.** This is will open the local file folder where the agent is installed.
4. In the local installation folder find the file named  `appSettings.json` file and open it in you favorite text editor.
5. Modify the <mark style="color:blue;">MachineStepQueueSettings</mark> section to include the **`MaxConcurrentExecutions`** parameter.

```json
"MachineStepQueueSettings": {
    "ConnectionString": "",
    "QueueName": "",
    "MaxConcurrentExecutions": 100
}
```


---

# Agent Instructions: 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.novacura.com/flow-connect/working-with-connect/connect-to-systems/connector-agents/manage-agent.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.
