From 013a4f92e76bd61fb7fb49b7004b77242ffd29f1 Mon Sep 17 00:00:00 2001 From: Kelly Date: Wed, 25 Sep 2019 17:21:33 -0700 Subject: [PATCH] add doc for config Telegraf w Windows #493 --- .../use-telegraf/auto-config/_index.md | 51 +++++++++++++++++-- .../write-data/use-telegraf/manual-config.md | 32 ++++++++++++ 2 files changed, 78 insertions(+), 5 deletions(-) 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..1c6a1a8b0 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,22 +50,63 @@ 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. + +### Monitor a Windows machine + +If you're using Telegraf to monitor a Windows machine, 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 `[[inputs.processes]]` with + `[[inputs.win_perf_counters]]` or `[inputs.win_services]]`, depending on your Windows configuration. +3. Save the file and place it in a directory where **Telegraf.exe** can access. ## 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 PowerShell](#) +[Windows CMD](#) +{{% /tabs %}} + +{{% tab-content %}} ```sh export INFLUX_TOKEN=YourAuthenticationToken ``` +{{% /tab-content %}} + +{{% tab-content %}} + +```sh +$env:INFLUX_TOKEN = “YourAuthenticationToken" +``` + +{{% /tab-content %}} + +{{% tab-content %}} + +```sh +set INFLUX_TOKEN=YourAuthenticationToken +# Make sure to include a space character at the end of this command. +``` + +{{% /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. Telegraf starts using the Telegraf configuration pulled from InfluxDB API. 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..1a8e1f53d 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,10 +59,41 @@ 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 PowerShell](#) +[Windows CMD](#) +{{% /tabs %}} + +{{% tab-content %}} + ```sh export INFLUX_TOKEN=YourAuthenticationToken ``` +{{% /tab-content %}} + +{{% tab-content %}} + +```sh +$env:INFLUX_TOKEN = “YourAuthenticationToken" +``` + +{{% /tab-content %}} + +{{% tab-content %}} + +```sh +set INFLUX_TOKEN=YourAuthenticationToken +# Make sure to include a space character at the end of this command. +``` + +{{% /tab-content %}} + +{{< /tabs-wrapper >}} + _See the [example `telegraf.conf` below](#example-influxdb-v2-configuration)._ {{% /note %}}