# Window OS

To push Metrics to vMonitor, you need to install the Metric Agent on your server. vMonitor uses the Telegraf Agent to push metrics to the system. Currently, the Telegraf Agent supports the IAM Service Account for authentication and authorization. Follow the steps below to set up the Telegraf Agent to push metrics to vMonitor.

### **Telegraf Agent with Service Account** <a href="#windowos-telegrafagentvoiserviceaccount" id="windowos-telegrafagentvoiserviceaccount"></a>

1. **Create a Service Account and attach the policy: vMonitorMetricPush to have sufficient permissions to push Metrics to vMonitor.**

To create a service account, visit [here](https://iam.console.vngcloud.vn/service-accounts).

* Select "**Create a Service Account**", enter a name for the Service Account, and click **Next Step** to assign permissions to the Service Account.
* Find and select the **Policy: vMonitorMetricPush**, then click "**Create a Service Account**" to create the Service Account. The Policy: vMonitorMetricPush, created by GreenNode, contains the exact permissions needed to push metrics to the system.
* After successfully creating the Service Account, you need to save the Client\_ID and Secret\_Key for the next step.

2\. **Download the Agent Installer for Windows**

* Access this link to load agent installer forWindows : <https://github.com/vngcloud/vmonitor-metrics-agent/releases/download/1.26.0-2.0.1/telegraf-nightly_windows_amd64.exe>

3\. Install the installer using the Client\_ID and Secret\_Key you copied above.

* Run the agent installer you downloaded above. A
* fter receiving the notification, select **More Info**.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-11092520b8da15ae3e40072585384a4b510b234b%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Then select **Run anyway** to start installing the agent.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-66f1de69e4b4160af033eaaf03c1fbddaffd88a5%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Chosse **Next** to continue

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-9aa24ff31faed01ba3a9be5a1a384b8a2d78b845%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Enter the two pieces of information, **Client\_ID** and **Secret\_Key**, you copied above into the fields: **IAM\_CLIENT\_ID** and **IAM\_CLIENT\_SECRET:**

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-d40dcf40aacaaf1d5504acea063d6c773328d979%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Keep the default settings and select Next to continue, or if you want to change the installation directory, make the necessary changes.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-59676cceb8f4980b8a5e77654baecf25754e73dc%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Select "**Accept the license**," then click **Next** to continue.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-e056bffd6f562a22e9e21ed86428b6b0b60fe20b%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Keep the default settings and select **Next** to continue, or you can customize the shortcut menu name for the agent.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-485ae0231808e55e59b5354f4593603c30eac3e2%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Select **Install** to begin the installation.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-a1fbafc11550e4dd0e8fe8359af02ce9f66a1959%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Select **Yes** to grant permissions for the agent to operate.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-f7562a25658128c3cd83bb8baf63c27cdd04e6a0%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* After the installation process is complete, select **Finish**.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-6795d3fdf9ea3f00750fa62efe544b7e2d494f58%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

4.**After successful installation, you will see the server on the Infrastructure List/Host page**.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-ae36757df9e4ff7a1f848d0081192fc39092b1ad%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### **Telegraf Agent với API\_KEY (deprecated**) <a href="#windowos-telegrafagentvoiapi_key-deprecated-khongkhuyencaosudung-saptoisedunghotrovoiphuongthucnay" id="windowos-telegrafagentvoiapi_key-deprecated-khongkhuyencaosudung-saptoisedunghotrovoiphuongthucnay"></a>

{% hint style="info" %}
**Notice:**

* We do not recommend using this method, as our system will soon stop supporting these API Keys.
  {% endhint %}

Step 1: Create an API Key (if you have not created any API Key before).

* Access the vMonitor Platform Product portal: <https://hcm-3.console.vngcloud.vn/vmonitor/>
* Select **Integration** => then choose **API Key**.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-e3cc0d472a368fffec1777cfa8ca41bf751415a3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Select **Create an API Key** to create a new one (if you have not created any API Key before).

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-fd04853ae12cbaf84b668eeafc39e859d31e14ef%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Step 2: Download Agent Installer

* Access the link to download the agent installer:: <https://github.com/vngcloud/vmonitor-metrics-agent/releases/download/1.23.0-1.4.0/telegraf-nightly_windows_amd64.exe>

Step 3: Install Agent

* Run the agent installer.
* After receiving the notification, select **More Info**.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-8b92b187cd95df0f9b7d76115a347c6ebfc3e776%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Then select **Run anyway** to start installing the agent.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-d015f9196d9315943ac51445ae177930bb9d9636%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Select **Next** to continue.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-ba78103c327d7a74692294edb5fffff82a9a7231%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Return to the vMonitor Platform portal, in the API Key section, select the **copy icon** to copy the API Key information.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-5b51c0af9b82e6486bc2e76e63f878f07a391c0e%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Paste the API Key information into the **credentials** entry field.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-e8e7f1e5bc13d8f8a47ab4771c11cb460a69a740%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* You can customize the installation folder if needed.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-8972f6c9db879095082407b1c0237e504e45759b%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Select **Accept the license**, then click **Next** to continue.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-4ba99a338646b9fd305628d89c0a8a741e9cbd40%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* You can customize the shortcut menu name for the agent, then select **Next** to continue.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-561ba50a4328eea7eaf5af1c380237ef4c904ae5%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Select **Install** to begin the installation.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-fbd460f382b066284f6a6989cf0cc0c29654a95f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Select **Yes** to grant permissions for the agent to operate.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-d6c371457bad9c07d6aae66e05ffee8525934781%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* After the installation process is complete, select **Finish**.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-81d5437c54dfae4fec4209453d53e66bb1fe66e4%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Step 4: Verify Agent Operated <a href="#windowos-b4-kiemtraagentdahoatdong" id="windowos-b4-kiemtraagentdahoatdong"></a>

* Access the vMonitor Platform portal, select **Infrastructure list** => choose **Host**, then check if the hostname of the VM has appeared in the list.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-9961dced218fd61b433d91eb70828aaee5681fc5%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Click on the **hostname** to check the monitoring dashboard.

<figure><img src="https://1985221522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7rE7M1L7GYcwQzNGd0aB%2Fuploads%2Fgit-blob-8fd4aaa08ea57308ed79a50d07fb261eb8251593%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
