diff --git a/content/v2.0/write-data/use-telegraf/auto-config/_index.md b/content/v2.0/write-data/use-telegraf/auto-config/_index.md index 4a1b18417..05e61cabf 100644 --- a/content/v2.0/write-data/use-telegraf/auto-config/_index.md +++ b/content/v2.0/write-data/use-telegraf/auto-config/_index.md @@ -50,24 +50,81 @@ for using Telegraf with InfluxDB v2.0._ 11. Once Telegraf is running, click **Listen for Data** to confirm Telegraf is successfully sending data to InfluxDB. Once confirmed, a **Connection Found!** message appears. -12. Click **Finish**. Your configuration name and the associated bucket name appears - in the list of Telegraf connections. +12. Click **Finish**. Your Telegraf configuration name and the associated bucket name appears + in the list of Telegraf configurations. + + {{% note %}} + +### Windows + +If you plan to monitor a Windows host using the System plugin, you must complete the following steps. + +1. In the list of Telegraf configurations, double-click your + Telegraf configuration, and then click **Download Config**. +2. Open the downloaded Telegraf configuration file and replace the `[[inputs.processes]]` plugin with one of the following Windows plugins, depending on your Windows configuration: + + - [`[[inputs.win_perf_counters]]`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters) + - [`[[inputs.win_services]]`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_services) + +3. Save the file and place it in a directory that **telegraf.exe** can access. + + {{% /note %}} ## Start Telegraf -### Configure your API token as an environment variable Requests to the [InfluxDB v2 API](/v2.0/reference/api/) must include an authentication token. A token identifies specific permissions to the InfluxDB instance. -Define the `INFLUX_TOKEN` environment variable using your token. -_For information about viewing tokens, see [View tokens](/v2.0/security/tokens/view-tokens/)._ +### Configure your token as an environment variable +1. Find your authentication token. _For information about viewing tokens, see [View tokens](/v2.0/security/tokens/view-tokens/)._ + +2. To configure your token as the `INFLUX_TOKEN` environment variable, run the command appropriate for your operating system and command-line tool: + +{{< tabs-wrapper >}} +{{% tabs %}} +[macOS or Linux](#) +[Windows](#) +{{% /tabs %}} + +{{% tab-content %}} ```sh export INFLUX_TOKEN=YourAuthenticationToken ``` +{{% /tab-content %}} + +{{% tab-content %}} + +{{< code-tabs-wrapper >}} +{{% code-tabs %}} +[PowerShell](#) +[CMD](#) +{{% /code-tabs %}} + +{{% code-tab-content %}} +```sh +$env:INFLUX_TOKEN = “YourAuthenticationToken" +``` +{{% /code-tab-content %}} + +{{% code-tab-content %}} +```sh +set INFLUX_TOKEN=YourAuthenticationToken +# Make sure to include a space character at the end of this command. +``` +{{% /code-tab-content %}} +{{< /code-tabs-wrapper >}} + +{{% /tab-content %}} +{{< /tabs-wrapper >}} ### Start the Telegraf service -Start the Telegraf service using the `-config` flag to specify the URL of your generated configuration file. + +Start the Telegraf service using the `-config` flag to specify the location of the generated Telegraf configuration file. + +- For Windows, the location is always a local file path. +- For Linux and macOS, the location can be a local file path or URL. + Telegraf starts using the Telegraf configuration pulled from InfluxDB API. {{% note %}} @@ -80,6 +137,7 @@ telegraf -config http://localhost:9999/api/v2/telegrafs/0xoX00oOx0xoX00o ``` ## Manage Telegraf configurations + Create, view, and manage Telegraf configurations in the InfluxDB UI. {{< children >}} diff --git a/content/v2.0/write-data/use-telegraf/manual-config.md b/content/v2.0/write-data/use-telegraf/manual-config.md index 65eecfa1b..9945fbfb8 100644 --- a/content/v2.0/write-data/use-telegraf/manual-config.md +++ b/content/v2.0/write-data/use-telegraf/manual-config.md @@ -29,6 +29,7 @@ Input plugins collect metrics. Output plugins define destinations where metrics _See [Telegraf plugins](/v2.0/reference/telegraf-plugins/) for a complete list of available plugins._ ## Enable and configure the InfluxDB v2 output plugin + To send data to an InfluxDB v2.0 instance, enable in the [`influxdb_v2` output plugin](https://github.com/influxdata/telegraf/blob/master/plugins/outputs/influxdb_v2/README.md) in the `telegraf.conf`. @@ -58,9 +59,42 @@ InfluxData does not recommend storing authentication tokens in plain text in the A secure alternative is to set the `INFLUX_TOKEN` environment variable and include it into your configuration file. +{{< tabs-wrapper >}} +{{% tabs %}} +[macOS or Linux](#) +[Windows](#) +{{% /tabs %}} + +{{% tab-content %}} ```sh export INFLUX_TOKEN=YourAuthenticationToken ``` +{{% /tab-content %}} + +{{% tab-content %}} + +{{< code-tabs-wrapper >}} +{{% code-tabs %}} +[PowerShell](#) +[CMD](#) +{{% /code-tabs %}} + +{{% code-tab-content %}} +```sh +$env:INFLUX_TOKEN = “YourAuthenticationToken" +``` +{{% /code-tab-content %}} + +{{% code-tab-content %}} +```sh +set INFLUX_TOKEN=YourAuthenticationToken +# Make sure to include a space character at the end of this command. +``` +{{% /code-tab-content %}} +{{< /code-tabs-wrapper >}} + +{{% /tab-content %}} +{{< /tabs-wrapper >}} _See the [example `telegraf.conf` below](#example-influxdb-v2-configuration)._ {{% /note %}} @@ -104,16 +138,20 @@ The example below illustrates `influxdb_v2` configurations that write to InfluxD # ... ``` + {{% /code-tab-content %}} {{< /code-tabs-wrapper >}} {{% note %}} + ##### Write to InfluxDB v1.x and v2.0 + If a Telegraf agent is already writing to an InfluxDB v1.x database, enabling the InfluxDB v2 output plugin will write data to both v1.x and v2.0 instances. {{% /note %}} ## Start Telegraf + Start the Telegraf service using the `-config` flag to specify the location of your `telegraf.conf`. ```sh