# Appendix D - Datadog Integration

N2W Backup & Recovery Instance is now supporting the monitoring of backups, DR, copy to S3, alerts, and more by Datadog. Datadog is a monitoring service for cloud-scale applications, providing monitoring of servers, databases, tools, and services, through a SaaS-based data analytics platform. Datadog will allow CPM users to monitor and analyze the N2W Backup & Recovery Dashboard metrics.

## **D.1 Activating Datadog and Monitoring N2W** <a href="#d-1-activating-datadog-and-monitoring-n-2-ws" id="d-1-activating-datadog-and-monitoring-n-2-ws"></a>

Use the following procedure to activate Datadog. Ready-made dashboards for monitoring are included.

**To activate the service and to monitor your N2W instance:**

1. **Setup Datadog Account.**

   Visit Datadog at <https://www.datadoghq.com/pricing/> and set up an account that fits your scale.

   ​
2. **Install Python Integration.**

   &#x20;a. Login to Datadog and go to **Integrations.**

   &#x20;b. Search for ‘Python’ and install it:

![](https://content.gitbook.com/content/5oB64hgFIX2jdQ2O72cF/blobs/MnSw6WG7cUsCHF4m8pNl/Screenshot%20\(24\).png)

&#x20;       c. Search for 'N2WS' and install it. See step 6.

&#x20;   3\. **Enable Datadog support on N2W Instance.** \
&#x20;        a. Connect to your N2W Backup & Recovery Instance with SSH Client. \
&#x20;        b. Type `sudo su`. \
&#x20;        c. Add the following lines to `/cpmdata/conf/cpmserver.cfg`:

```
[external_monitoring]
enabled=True
```

{% hint style="info" %}
If `cpmserver.cfg` doesn't exist, create, and add the above lines.
{% endhint %}

&#x20;        d. Run `service apache2 restart`.

&#x20;   4\. **Install Datadog Agent on N2W Instance.** \
&#x20;        a. Login to Datadog and go to **Integrations** **> Install Agents > Linu**x:

![](https://content.gitbook.com/content/5oB64hgFIX2jdQ2O72cF/blobs/4SmBdzTj9ysPJoJ3LmaS/Screenshot%20\(25\).png)

&#x20;        b.  In step 3 of the Install the Datadog Agent on Linux page, create the install command by selecting an **API Key**, and then selecting **Use API Key**.&#x20;

![](https://content.gitbook.com/content/5oB64hgFIX2jdQ2O72cF/blobs/39O3PU9r782jFAHKZgrv/Screenshot%20\(26\).png)

&#x20;   c. Use the copy icon in the upper right corner of the code block to copy the entire agent install command.

<figure><img src="https://content.gitbook.com/content/5oB64hgFIX2jdQ2O72cF/blobs/Aar0hTd4SXanbTNNehOv/Screenshot%20(27).png" alt=""><figcaption></figcaption></figure>

&#x20;       d. Connect to your N2W Backup & Recovery Instance with SSH Client, type `sudo su` and run the agent **Install** command. \
&#x20;       e. Restart the Datadog Agent: `sudo service datadog-agent restart`&#x20;

{% hint style="info" %}
Datadog updates N2W metrics hourly.
{% endhint %}

&#x20;  5\. **Setup Datadog Dashboard metrics.** \
&#x20;       a. Log in to Datadog and go to **Metrics** > **Explorer**. \
&#x20;       b. In the **Graph** list, select your metrics. All N2W metrics begin with **`cpm_`** followed by `<metric-name>`.

![](https://gblobscdn.gitbook.com/assets%2F-MCmcYDqe7zxX8UChJRp%2F-MJghfrLdmeCNLU8vy7b%2F-MJhxjtdevZwKGXFUzz4%2FApp%20D%20Datadog%20Metrics%20Expl.png?alt=media\&token=ba83e790-5c54-4e08-9ed1-f2d9b2e6bcb2)

&#x20;       c. In the **Over** list, select data. You can either select a specific user or the entire N2W instance. All N2W user data begins with **`cpm:user:`** followed by `<user-name>`.

![](https://gblobscdn.gitbook.com/assets%2F-MCmcYDqe7zxX8UChJRp%2F-MJghfrLdmeCNLU8vy7b%2F-MJhxjtQb-zuzCVpOWCn%2FApp%20D%20Datadog%20Metrics%20Over.png?alt=media\&token=c0386c58-7c3c-480a-b672-8886c0c043f5)

&#x20;   6\. **Configure your Datadog dashboard by using the N2W template or creating your own dashboards, and choose the data to monitor.** \
&#x20;       a. To use the N2WS template, in Datadog Integrations at <https://app.datadoghq.com/account/settings#integrations>, search for the '**N2WS**' tile and install it. You will get a variety of dashboards for your account. Dashboards are named 'N2WBackup\&Recovery-\<dashboard\_name\[-version]>'. When dashboards are added for a new N2W version, the dashboards will contain the version number, such as '3-2-0' and '4-0-0'. Version numbers indicate which dashboards are valid for versions going forward.\
&#x20;       b. To create a Datadog dashboard: \
&#x20;             i. Go to **Dashboards** and select **New Dashboard**.

![](https://gblobscdn.gitbook.com/assets%2F-MCmcYDqe7zxX8UChJRp%2F-MJghfrLdmeCNLU8vy7b%2F-MJhxjtYfMDNXPa-sCpA%2FApp%20D%20Datadog%20Create%20Dashb.png?alt=media\&token=25c2362b-100a-4b6e-adc7-c61d50b1348d)

&#x20;            ii. Add a graph type by dragging and dropping its template to the dashboard:

![](https://gblobscdn.gitbook.com/assets%2F-MCmcYDqe7zxX8UChJRp%2F-MJghfrLdmeCNLU8vy7b%2F-MJhxjtU3mg9NrA7XsB2%2FApp%20D%20Datadog%20Timeseries%20graph.png?alt=media\&token=852d3e31-152a-484f-9440-71fb2fccf86d)

&#x20;           iii. Edit the graph for the data to be monitored:

![](https://gblobscdn.gitbook.com/assets%2F-MCmcYDqe7zxX8UChJRp%2F-MJghfrLdmeCNLU8vy7b%2F-MJhxjtZmhDToUTCvkbL%2FApp%20D%20Datadog%20Data%202%20monitor.png?alt=media\&token=675c96a3-fb6a-4f79-8f77-671dcfc2fd9a)

&#x20;           iv. Save the graph settings.

![](https://gblobscdn.gitbook.com/assets%2F-MCmcYDqe7zxX8UChJRp%2F-MJghfrLdmeCNLU8vy7b%2F-MJhxjtX9EBljgeQeZmp%2FApp%20D%20Datadog%20CPM%20Server%20status%20.png?alt=media\&token=8cd3346d-4fb3-4d42-80c1-a9ea49f4fea7)

&#x20;   7\. **View N2W Alerts on Datadog Events.** \
&#x20;        a. Log in to Datadog and go to **Events**. \
&#x20;        b. View your instance alerts:

![](https://gblobscdn.gitbook.com/assets%2F-MCmcYDqe7zxX8UChJRp%2F-MJghfrLdmeCNLU8vy7b%2F-MJhxjt_ty2M429_vd2H%2FApp%20D%20Datadog%20Event%20Alerts.png?alt=media\&token=00ca1860-1432-42f6-9987-283f8574b0d8)

## D.2 Monitoring N2W with Web Proxy <a href="#d-2-monitoring-n-2-ws-with-web-proxy" id="d-2-monitoring-n-2-ws-with-web-proxy"></a>

If you have restricted outbound traffic, you can proxy all Datadog Agent traffic through different hosts.

1. Connect to your N2W Backup & Recovery Instance with SSH Client.

```
cd /etc/datadog-agent
```

&#x20;   2\. Enable **proxy:** section on `datadog.yaml`. \
&#x20;   3\. Add your proxy IP, port, username, and password:

```
https: "http://your-proxy-IP:your-proxy-port"    
http: "http://your-proxy-IP:your-proxy-port"
```

&#x20;4\. Validate **datadog.yaml** on <https://yamlchecker.com/>.

Example:

```
proxy:
http://54.159.14.45:3128
http://54.159.145.45:3128
```

For additional proxy configuration options, see <https://docs.datadoghq.com/agent/proxy/>


---

# 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.n2ws.com/user-guide/appendix-d-datadog-integration.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.
