content/shared/influxdb-v2/monitor-alert/templates/monitor.md
Use InfluxDB Cloud, the InfluxDB Open Source (OSS) Metrics template, and Telegraf to monitor one or more InfluxDB OSS instances.
Do the following:
Before you begin, make sure you have access to the following:
The InfluxDB OSS Monitoring template includes a Telegraf configuration that sends InfluxDB OSS metrics to an InfluxDB endpoint and a dashboard that visualizes the metrics.
Go to Settings > Templates in the navigation bar on the left
{{< nav-icon "Settings" >}}
Under Paste the URL of the Template's resource manifest file, enter the following template URL:
https://raw.githubusercontent.com/influxdata/community-templates/master/influxdb2_oss_metrics/influxdb2_oss_metrics.yml
Click {{< caps >}}Lookup Template{{< /caps >}}, and then click {{< caps >}}Install Template{{< /caps >}}. InfluxDB Cloud imports the template, which includes the following resources:
InfluxDB OSS Metricsscrape-influxdb-oss-telegrafoss_metricsInfluxDB OSS Deadmaninfluxdb2 and prometheusBy default, InfluxDB OSS 2.x has a /metrics endpoint available, which exports
internal InfluxDB metrics in Prometheus format.
/metrics endpoint is enabled.
If you've changed the default settings to disable the /metrics endpoint,
re-enable these settings./metrics endpoint of your InfluxDB OSS instance to view the InfluxDB OSS system metrics in your browser:Set up Telegraf to scrape metrics from InfluxDB OSS to send to your InfluxDB Cloud account.
On each InfluxDB OSS instance you want to monitor, do the following:
Set the following environment variables in your Telegraf environment:
INFLUX_URL: Your InfluxDB Cloud region URLINFLUX_ORG: Your InfluxDB Cloud organization nameIn the InfluxDB Cloud UI, go to Load Data > Telegraf in the left navigation.
{{< nav-icon "load-data" >}}
Click Setup Instructions under Scrape InfluxDB OSS Metrics.
Complete the Telegraf Setup instructions to start Telegraf using the Scrape InfluxDB OSS Metrics Telegraf configuration stored in InfluxDB Cloud.
{{% note %}} For your API token, generate a new token or use an existing All Access token. If you run Telegraf as a service, edit your init script to set the environment variable and ensure its available to the service. {{% /note %}}
Telegraf runs quietly in the background (no immediate output appears), and begins
pushing metrics to the oss_metrics bucket in your InfluxDB Cloud account.
To see your data in real time, view the Monitoring dashboard.
Select Dashboards in your InfluxDB Cloud account.
{{< nav-icon "dashboards" >}}
Click InfluxDB OSS Metrics. Metrics appear in your dashboard.
Customize your monitoring dashboard as needed. For example, send an alert in the following cases:
The Monitoring template includes a deadman check to verify metrics are reported at regular intervals.
To alert when data stops flowing from InfluxDB OSS instances to your InfluxDB Cloud account, do the following:
To view the deadman check, click Alerts in the navigation bar of your InfluxDB Cloud account.
{{< nav-icon "alerts" >}}
Choose a InfluxDB OSS field or create a new OSS field for your deadman alert:
Start under Schedule Every, set the amount of time to check for data.
Set the amount of time to wait before switching to a critical alert.
Click {{< icon "check" >}} to save the check.
To receive a notification message when your deadman check is triggered, create a notification endpoint and rule.
InfluxData supports different endpoints: Slack, PagerDuty, and HTTP. Slack is free for all users, while PagerDuty and HTTP are exclusive to the Usage-Based Plan.
Create a Slack Webhooks.
Go to Alerts > Alerts in the left navigation menu and then click {{< caps >}}Notification Endpoints{{< /caps >}}.
{{< nav-icon "alerts" >}}
Click {{< caps >}}{{< icon "plus" >}} Create{{< /caps >}}, and enter a name and description for your Slack endpoint.
Enter your Slack Webhook under Incoming Webhook URL and click {{< caps >}}Create Notification Endpoint{{< /caps >}}.
Send a notification to PagerDuty or HTTP endpoints (other webhooks) by upgrading your InfluxDB Cloud account.
Create a notification rule to set rules for when to send a deadman alert message to your notification endpoint.
Go to Alerts > Alerts in the left navigation menu and then click {{< caps >}}Notification Rules{{< /caps >}}.
{{< nav-icon "alerts" >}}
Click {{< caps >}}{{< icon "plus" >}} Create{{< /caps >}}, and then provide the required information.
Click {{< caps >}}Create Notification Rule{{< /caps >}}.