Merge pull request #1239 from influxdata/manage-telegrafs

Telegraf configuration management
pull/1244/head
Scott Anderson 2020-07-23 15:47:56 -06:00 committed by GitHub
commit 3565bb953b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 317 additions and 92 deletions

View File

@ -566,8 +566,8 @@ Use Telegraf to quickly write data to {{< cloud-name >}}.
Create new Telegraf configurations automatically in the InfluxDB UI, or manually update an
existing Telegraf configuration to send data to your {{< cloud-name "short" >}} instance.
For details, see [Automatically configure Telegraf](/v2.0/write-data/use-telegraf/auto-config/#create-a-telegraf-configuration)
and [Manually update Telegraf configurations](/v2.0/write-data/use-telegraf/manual-config/).
For details, see [Automatically configure Telegraf](/v2.0/write-data/no-code/use-telegraf/auto-config/)
and [Manually update Telegraf configurations](/v2.0/write-data/no-code/use-telegraf/manual-config/).
#### Scrape data

View File

@ -1016,7 +1016,7 @@ Related entries: [function](#function)
A plugin-driven agent that collects, processes, aggregates, and writes metrics.
Related entries: [Automatically configure Telegraf](/v2.0/write-data/no-code/use-telegraf/auto-config/), [Manually configure Telegraf](/v2.0/write-data/no-code/use-telegraf/manual-config/), [Telegraf plugins](/v2.0/reference/telegraf-plugins/), [Use Telegraf to collect data](/v2.0/write-data/use-telegraf/), [View a Telegraf configuration](/v2.0/write-data/no-code/use-telegraf/auto-config/view-telegraf-config/)
Related entries: [Automatically configure Telegraf](/v2.0/write-data/no-code/use-telegraf/auto-config/), [Manually configure Telegraf](/v2.0/write-data/no-code/use-telegraf/manual-config/), [Telegraf plugins](/v2.0/reference/telegraf-plugins/), [Use Telegraf to collect data](/v2.0/write-data/use-telegraf/), [View a Telegraf configuration](/v2.0/telegraf-configs/view/)
### time (data type)

View File

@ -0,0 +1,36 @@
---
title: Telegraf configurations
description: >
placeholder
weight: 12
menu: v2_0
v2.0/tags: [telegraf]
related:
- /v2.0/write-data/no-code/use-telegraf/manual-config/
- /v2.0/write-data/no-code/use-telegraf/auto-config/
---
InfluxDB lets you automatically generate Telegraf configurations or upload customized
Telegraf configurations that collect metrics and write them to InfluxDB.
Telegraf retrieves configurations from InfluxDB on startup.
## Use InfluxDB Telegraf configurations
With a Telegraf configuration stored in InfluxDB, the `telegraf` agent can retrieve
the configuration from an InfluxDB HTTP(S) endpoint.
- Ensure Telegraf has network access to InfluxDB (OSS or Cloud).
- Start the `telegraf` agent using the `--config` flag to provide the URL of the
InfluxDB Telegraf configuration. For example:
```sh
telegraf --config http://localhost:9999/api/v2/telegrafs/<telegraf-config-id>
```
{{% note %}}
_[Setup instructions](/v2.0/telegraf-configs/view/#view-setup-instructions) for
each Telegraf configuration are provided in the InfluxDB UI._
{{% /note %}}
## Manage Telegraf configurations
{{< children >}}

View File

@ -0,0 +1,73 @@
---
title: Create a Telegraf configuration
description: >
Use the InfluxDB UI or the [`influx` CLI](/v2.0/reference/cli/influx/)
to create an Telegraf configuration.
weight: 101
menu:
v2_0:
name: Create a config
parent: Telegraf configurations
related:
- /v2.0/write-data/no-code/use-telegraf/manual-config/
- /v2.0/write-data/no-code/use-telegraf/auto-config/
- /v2.0/telegraf-configs/update/
---
Use the InfluxDB user interface (UI) or the [`influx` CLI](/v2.0/reference/cli/influx/)
to create a Telegraf configuration.
To create a Telegraf configuration, do one of the following:
- [Use the InfluxDB UI](#use-the-influxdb-ui)
- [Use the `influx` CLI](#use-the-influx-cli)
- [Create a custom Telegraf configurations](#create-a-custom-telegraf-configurations)
## Use the InfluxDB UI
Use the InfluxDB UI to automatically generate and store new Telegraf configurations in InfluxDB.
Creating the configuration in the UI lets you select from a list of available technologies
and generates a Telegraf configuration to collect metrics from those technologies.
For more information, see [Automatically configure Telegraf](/v2.0/write-data/no-code/use-telegraf/auto-config/).
Telegraf has an extensive list of plugins for many different technologies and use cases.
Not all options are available through the InfluxDB UI, but you can
[create and upload custom Telegraf configurations to InfluxDB](#create-custom-influxdb-telegraf-configurations).
## Use the influx CLI
Use the [`influx telegrafs create` command](/v2.0/reference/cli/influx/telegrafs/create/)
to upload a Telegraf configuration file from your local machine and create a new Telegraf
configuration in InfluxDB.
Provide the following:
- **Telegraf configuration name**
- **Telegraf configuration description**
- **Telegraf configuration file**
{{% note %}}
If a **name** and **description** are not provided, they are set to empty strings.
{{% /note %}}
<!-- -->
```sh
# Syntax
influx telegrafs create \
-n <telegraf-config-name> \
-d <telegraf-config-description> \
-f /path/to/telegraf.conf
# Example
influx telegrafs create \
-n "Example Telegraf config"
-d "This is a description for an example Telegraf configuration."
-f /path/to/telegraf.conf
```
## Create a custom Telegraf configurations
1. Create a custom Telegraf configuration file that includes the `outputs.influxdb_v2`
output plugin. _See [Manually configure Telegraf](/v2.0/write-data/no-code/use-telegraf/manual-config/)_
for more information.
2. Add and customize [Telegraf plugins](/v2.0/reference/telegraf-plugins) and save your changes.
3. [Use the `influx telegrafs create` command](#use-the-influx-cli) to upload your
custom Telegraf configuration to InfluxDB.

View File

@ -0,0 +1,53 @@
---
title: Remove a Telegraf configuration
description: >
Use the InfluxDB UI or the [`influx` CLI](/v2.0/reference/cli/influx/)
to remove Telegraf configurations from InfluxDB.
weight: 104
menu:
v2_0:
name: Remove a config
parent: Telegraf configurations
aliases:
- /v2.0/write-data/no-code/use-telegraf/auto-config/delete-telegraf-config/
- /v2.0/collect-data/use-telegraf/auto-config/delete-telegraf-config
---
Use the InfluxDB user interface (UI) or the [`influx` CLI](/v2.0/reference/cli/influx/)
to remove Telegraf configurations from InfluxDB.
{{% note %}}
Deleting a Telegraf configuration does not affect _**running**_ Telegraf agents.
However, if an agents stops, it needs a new configuration to start.
{{% /note %}}
To remove a Telegraf configuration, do one of the following:
- [Use the InfluxDB UI](#use-the-influxdb-ui)
- [Use the `influx` CLI](#use-the-influx-cli)
## Use the InfluxDB UI
1. In the navigation menu on the left, select **Data** (**Load Data**) > **Telegraf**.
{{< nav-icon "load data" >}}
2. Hover over the configuration you want to delete, click the **{{< icon "trash" >}}**
icon, and then click **Delete**.
## Use the influx CLI
Use the [`influx telegrafs rm` command](/v2.0/reference/cli/influx/telegrafs/rm/)
to remove a Telegraf configuration from InfluxDB.
Provide the following:
- **Telegraf configuration ID** (shown in the output of `influx telegrafs`)
```sh
# Syntax
influx telegrafs rm -i <telegraf-config-id>
# Example
influx telegrafs rm -i 12ab34de56fg78hi
```

View File

@ -0,0 +1,87 @@
---
title: Update a Telegraf configuration
description: >
Use the InfluxDB user interface (UI) or the [`influx` CLI](/v2.0/reference/cli/influx/)
to update InfluxDB Telegraf configurations.
weight: 103
menu:
v2_0:
name: Update a config
parent: Telegraf configurations
aliases:
- /v2.0/write-data/no-code/use-telegraf/auto-config/update-telegraf-config/
- /v2.0/collect-data/use-telegraf/auto-config/update-telegraf-config
---
Use the InfluxDB user interface (UI) or the [`influx` CLI](/v2.0/reference/cli/influx/)
to update InfluxDB Telegraf configurations.
To update a Telegraf configuration, do one of the following:
- [Use the InfluxDB UI](#use-the-influxdb-ui)
- [Use the `influx` CLI](#use-the-influx-cli)
- [Customize an existing Telegraf configuration](#customize-an-existing-telegraf-configuration)
## Use the InfluxDB UI
The InfluxDB UI lets you update the **name** or **description** of a Telegraf configuration.
{{% note %}}
You cannot modify Telegraf settings in existing Telegraf configurations directly
through the InfluxDB UI.
To modify existing Telegraf configuration settings,
[use the `influx` CLI to update the Telegraf configuration](#use-the-influx-cli).
{{% /note %}}
1. In the navigation menu on the left, select **Data** (**Load Data**) > **Telegraf**.
{{< nav-icon "load data" >}}
2. Hover over the configuration you want to edit and click **{{< icon "pencil" >}}**
to update the name or description.
3. Press **Return** or click out of the editable field to save your changes.
## Use the influx CLI
Use the [`influx telegrafs update` command](/v2.0/reference/cli/influx/telegrafs/update/)
to update an existing InfluxDB Telegraf configuration name, description, or settings
from a Telegraf configuration file on your local machine.
Provide the following:
- **Telegraf configuration ID** (shown in the output of `influx telegrafs`)
- **Telegraf configuration name**
- **Telegraf configuration description**
- **Telegraf configuration file**
{{% warn %}}
If a **name** and **description** are not provided, they are replaced with empty strings.
{{% /warn %}}
<!-- -->
```sh
# Syntax
influx telegrafs update \
-i <telegraf-config-id> \
-n <telegraf-config-name> \
-d <telegraf-config-description> \
-f /path/to/telegraf.conf
# Example
influx telegrafs update \
-i 12ab34de56fg78hi
-n "Example Telegraf config"
-d "This is a description for an example Telegraf configuration."
-f /path/to/telegraf.conf
```
## Customize an existing Telegraf configuration
1. In the navigation menu on the left, select **Data** (**Load Data**) > **Telegraf**.
{{< nav-icon "load data" >}}
2. Click the **name** of the Telegraf configuration to customize.
3. Click **Download Config** to download the Telegraf configuration file to your
local machine.
4. Add or update [Telegraf plugin](/v2.0/reference/telegraf-plugins) settings and
save your changes.
5. [Use the `influx telegrafs update` command](#use-the-influx-cli) to upload your
modified Telegraf configuration to InfluxDB and replace the existing configuration.

View File

@ -0,0 +1,45 @@
---
title: View Telegraf configurations
description: >
Use the InfluxDB user interface (UI) or the [`influx` CLI](/v2.0/reference/cli/influx/)
to view and download InfluxDB Telegraf configurations.
weight: 102
menu:
v2_0:
name: View configs
parent: Telegraf configurations
aliases:
- /v2.0/write-data/no-code/use-telegraf/auto-config/view-telegraf-config/
- /v2.0/collect-data/use-telegraf/auto-config/view-telegraf-config
---
Use the InfluxDB user interface (UI) or the [`influx` CLI](/v2.0/reference/cli/influx/)
to view and download InfluxDB Telegraf configurations.
To view Telegraf configurations, do one of the following:
- [Use the InfluxDB UI](#use-the-influxdb-ui)
- [Use the `influx` CLI](#use-the-influx-cli)
## Use the InfluxDB UI
In the navigation menu on the left, select **Data** (**Load Data**) > **Telegraf**.
{{< nav-icon "load data" >}}
### View and download the telegraf.conf
To view the `telegraf.conf` associated with the configuration,
click the **Name** of the configuration.
Then click **Download Config** to download the file.
### View setup instructions
To view the setup instructions for a Telegraf configuration, click **Setup Instructions**.
Setup instructions include commands for adding your InfluxDB authentication token
as an environment variable and starting Telegraf with the specific configuration.
## Use the influx CLI
Use the [`influx telegrafs` command](/v2.0/reference/cli/influx/telegrafs/) to
list Telegraf configurations stored in InfluxDB.
```sh
influx telegrafs
```

View File

@ -11,6 +11,8 @@ menu:
v2_0:
parent: Telegraf (agent)
weight: 201
related:
- /v2.0/telegraf-configs/create/
---
The InfluxDB user interface (UI) can automatically create
@ -108,7 +110,7 @@ export INFLUX_TOKEN=YourAuthenticationToken
{{% code-tab-content %}}
```sh
$env:INFLUX_TOKEN = YourAuthenticationToken"
$env:INFLUX_TOKEN = "YourAuthenticationToken"
```
{{% /code-tab-content %}}
@ -143,6 +145,5 @@ telegraf -config http://localhost:9999/api/v2/telegrafs/0xoX00oOx0xoX00o
## Manage Telegraf configurations
Create, view, and manage Telegraf configurations in the InfluxDB UI.
{{< children >}}
For more information about managing Telegraf configurations in InfluxDB, see
[Telegraf configurations](/v2.0/telegraf-configs/).

View File

@ -1,25 +0,0 @@
---
title: Delete a Telegraf configuration
seotitle: Delete a Telegraf configuration from the InfluxDB UI
description: Delete a Telegraf configuration created in the InfluxDB UI.
aliases:
- /v2.0/collect-data/use-telegraf/auto-config/delete-telegraf-config
menu:
v2_0:
parent: Automatically configure Telegraf
weight: 303
---
To delete a Telegraf configuration:
1. In the navigation menu on the left, select **Data** (**Load Data**) > **Telegraf**.
{{< nav-icon "load data" >}}
3. Hover over the configuration you want to delete, click the **{{< icon "trash" >}}**
icon, and click **Delete**.
{{% note %}}
Deleting a Telegraf configuration does not affect _**running**_ Telegraf agents.
However, if an agents stops, it needs a new configuration to start.
{{% /note %}}

View File

@ -1,26 +0,0 @@
---
title: Update a Telegraf configuration
seotitle: Update Telegraf configurations in the InfluxDB UI
description: Update the name and description of a Telegraf configuration created in the InfluxDB UI.
aliases:
- /v2.0/collect-data/use-telegraf/auto-config/update-telegraf-config
menu:
v2_0:
parent: Automatically configure Telegraf
weight: 302
---
The InfluxDB user interface (UI) allows you to update the **name** or **description**
of a Telegraf configuration created in the UI.
{{% note %}}
You cannot modify Telegraf settings in existing Telegraf configurations through the UI.
{{% /note %}}
1. In the navigation menu on the left, select **Data** (**Load Data**) > **Telegraf**.
{{< nav-icon "load data" >}}
3. Hover over the configuration you want to edit and click **{{< icon "pencil" >}}**
to update the name or description.
4. Press Return or click out of the editable field to save your changes.

View File

@ -1,30 +0,0 @@
---
title: View a Telegraf configuration
seotitle: View a Telegraf configuration in the InfluxDB UI
description: >
View the `telegraf.conf` and setup instructions associated with a Telegraf configuration
created in the InfluxDB UI.
aliases:
- /v2.0/collect-data/use-telegraf/auto-config/view-telegraf-config
menu:
v2_0:
parent: Automatically configure Telegraf
weight: 301
---
View Telegraf configuration information in the InfluxDB user interface (UI):
- In the navigation menu on the left, select **Data** (**Load Data**) > **Telegraf**.
{{< nav-icon "load data" >}}
### View and download the telegraf.conf
To view the actual `telegraf.conf` associated with the configuration,
click the **Name** of the configuration.
Then click **Download Config** to download the file.
### View the setup instructions
To view the setup instructions, click **Setup Instructions**.
Setup instructions include commands for adding your InfluxDB authentication token
as an environment variable and starting Telegraf with the specific configuration.

View File

@ -13,6 +13,10 @@ menu:
parent: Telegraf (agent)
weight: 202
v2.0/tags: [manually, plugin, mqtt]
related:
- /v2.0/reference/telegraf-plugins/
- /v2.0/telegraf-configs/create/
- /v2.0/telegraf-configs/update/
---
Use the Telegraf `influxdb_v2` output plugin to collect and write metrics into an InfluxDB v2.0 bucket.
@ -134,17 +138,24 @@ The example below illustrates an `influxdb_v2` configuration.
```
{{% 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 %}}
## Add a custom Telegraf configuration to InfluxDB
To add a custom or manually configured Telegraf configuration to your collection
of Telegraf configurations in InfluxDB, use the [`influx telegrafs create`](/v2.0/reference/cli/influx/telegrafs/create/)
or [`influx telegrafs update`](/v2.0/reference/cli/influx/telegrafs/update/) commands.
For more information, see:
- [Create a Telegraf configuration](/v2.0/telegraf-configs/create/#use-the-influx-cli)
- [Update a Telegraf configuration](/v2.0/telegraf-configs/update/#use-the-influx-cli)
## 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
telegraf -config /path/to/custom/telegraf.conf
telegraf --config /path/to/custom/telegraf.conf
```