Merge pull request #495 from influxdata/windows-get-started

add doc for config Telegraf w Windows #493
pull/503/head
kelseiv 2019-09-30 10:17:44 -07:00 committed by GitHub
commit 012a629fc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 102 additions and 6 deletions

View File

@ -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 11. Once Telegraf is running, click **Listen for Data** to confirm Telegraf is successfully
sending data to InfluxDB. sending data to InfluxDB.
Once confirmed, a **Connection Found!** message appears. Once confirmed, a **Connection Found!** message appears.
12. Click **Finish**. Your configuration name and the associated bucket name appears 12. Click **Finish**. Your Telegraf configuration name and the associated bucket name appears
in the list of Telegraf connections. 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 ## 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. Requests to the [InfluxDB v2 API](/v2.0/reference/api/) must include an authentication token.
A token identifies specific permissions to the InfluxDB instance. A token identifies specific permissions to the InfluxDB instance.
Define the `INFLUX_TOKEN` environment variable using your token. ### Configure your token as an environment variable
_For information about viewing tokens, see [View tokens](/v2.0/security/tokens/view-tokens/)._
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 ```sh
export INFLUX_TOKEN=YourAuthenticationToken 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
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. Telegraf starts using the Telegraf configuration pulled from InfluxDB API.
{{% note %}} {{% note %}}
@ -80,6 +137,7 @@ telegraf -config http://localhost:9999/api/v2/telegrafs/0xoX00oOx0xoX00o
``` ```
## Manage Telegraf configurations ## Manage Telegraf configurations
Create, view, and manage Telegraf configurations in the InfluxDB UI. Create, view, and manage Telegraf configurations in the InfluxDB UI.
{{< children >}} {{< children >}}

View File

@ -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._ _See [Telegraf plugins](/v2.0/reference/telegraf-plugins/) for a complete list of available plugins._
## Enable and configure the InfluxDB v2 output plugin ## Enable and configure the InfluxDB v2 output plugin
To send data to an InfluxDB v2.0 instance, enable in the 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) [`influxdb_v2` output plugin](https://github.com/influxdata/telegraf/blob/master/plugins/outputs/influxdb_v2/README.md)
in the `telegraf.conf`. 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 A secure alternative is to set the `INFLUX_TOKEN` environment variable and include
it into your configuration file. it into your configuration file.
{{< tabs-wrapper >}}
{{% tabs %}}
[macOS or Linux](#)
[Windows](#)
{{% /tabs %}}
{{% tab-content %}}
```sh ```sh
export INFLUX_TOKEN=YourAuthenticationToken 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)._ _See the [example `telegraf.conf` below](#example-influxdb-v2-configuration)._
{{% /note %}} {{% /note %}}
@ -104,16 +138,20 @@ The example below illustrates `influxdb_v2` configurations that write to InfluxD
# ... # ...
``` ```
{{% /code-tab-content %}} {{% /code-tab-content %}}
{{< /code-tabs-wrapper >}} {{< /code-tabs-wrapper >}}
{{% note %}} {{% note %}}
##### Write to InfluxDB v1.x and v2.0 ##### Write to InfluxDB v1.x and v2.0
If a Telegraf agent is already writing to an InfluxDB v1.x database, 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. enabling the InfluxDB v2 output plugin will write data to both v1.x and v2.0 instances.
{{% /note %}} {{% /note %}}
## Start Telegraf ## Start Telegraf
Start the Telegraf service using the `-config` flag to specify the location of your `telegraf.conf`. Start the Telegraf service using the `-config` flag to specify the location of your `telegraf.conf`.
```sh ```sh