From 013a4f92e76bd61fb7fb49b7004b77242ffd29f1 Mon Sep 17 00:00:00 2001 From: Kelly Date: Wed, 25 Sep 2019 17:21:33 -0700 Subject: [PATCH 1/3] 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 %}} From 41c25df3df579dfe2ba3e15546ac6dfe1638acbd Mon Sep 17 00:00:00 2001 From: Kelly Date: Fri, 27 Sep 2019 11:39:32 -0700 Subject: [PATCH 2/3] add edits from Scott and Tim --- .../use-telegraf/auto-config/_index.md | 45 ++++++++++++------- .../write-data/use-telegraf/manual-config.md | 26 ++++++----- 2 files changed, 45 insertions(+), 26 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 1c6a1a8b0..74c4a87aa 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 @@ -53,14 +53,18 @@ for using Telegraf with InfluxDB v2.0._ 12. Click **Finish**. Your Telegraf configuration name and the associated bucket name appears in the list of Telegraf configurations. -### Monitor a Windows machine + {{% note %}} -If you're using Telegraf to monitor a Windows machine, you must complete the following steps. +### Windows -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. +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 `[[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 that **telegraf.exe** can access. + + {{% /note %}} ## Start Telegraf @@ -76,39 +80,47 @@ A token identifies specific permissions to the InfluxDB instance. {{< tabs-wrapper >}} {{% tabs %}} [macOS or Linux](#) -[Windows PowerShell](#) -[Windows CMD](#) +[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 %}} -{{% /tab-content %}} - -{{% 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 %}} @@ -121,6 +133,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 1a8e1f53d..9945fbfb8 100644 --- a/content/v2.0/write-data/use-telegraf/manual-config.md +++ b/content/v2.0/write-data/use-telegraf/manual-config.md @@ -59,39 +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](#) +[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 %}} -{{% /tab-content %}} - -{{% 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)._ @@ -136,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 From 94d8aa4dff5a91b4015241cec3e17fdcf139dbf0 Mon Sep 17 00:00:00 2001 From: Kelly Date: Fri, 27 Sep 2019 13:52:30 -0700 Subject: [PATCH 3/3] add edit from Scott --- content/v2.0/write-data/use-telegraf/auto-config/_index.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 74c4a87aa..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 @@ -61,7 +61,11 @@ If you plan to monitor a Windows host using the System plugin, you must complete 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. +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 %}}