How to fix: Error getting HTTP 401 Unauthorized on the Telegraf?

How to fix: Error getting HTTP 401 Unauthorized on the Telegraf?

Have you already found this following message: Error getting HTTP config. Retry 0 of 3 in 10s. Status=401 on your Telegraf?

No alt text provided for this image
Power Shell - Command Line

Calm down! I may help you to solve this issue!

I spent many hours by trying to solve this issue, when I executed the command line to start Telegraf to connect on the Influxdb.

Let´s check out the following settings:

1 - Ensure that you have created a configuration in the "Load Data" in InfluxDB.

1.1 - Click on Telegraf tab. You'll see if there is a configuration created properly, otherwise you need to create one.

No alt text provided for this image
Load Data on InfluxDB

2 - Click on the name of setting.

2.1 - Make sure that your token is configured correctly. In case, it is displayed a variable name, you need to ensure that your token is right.

No alt text provided for this image
Telegraf file configuration

2.1 - Click on "Setup Instructions" to see your command to start the Telegraf.

2.2 - In the option 3, do the copy to clipboard.

No alt text provided for this image
Telegraf Setup Instructions

3 - After validating your token, open your command line.

3.1 - Now, we go to configure your token as an environment variable.

Enter to --> $env:INFLUX_TOKEN = "YourAuthenticationToken"

No alt text provided for this image
Command in PowerShell

3.2 - Enter to address copied preivously. In case, you are using Windows, you can insert this command ".\" before copying. For example: .\telegraf --config http://yourIP:numberport/api/v2/telegrafs/xxxxxxxxxxxxxxxxx

No alt text provided for this image
PowerSheel - Starting the Telegraf

For now, the Telegraf is working (I hopefully), so check out your plugins are properly configured and have fun!

To view or add a comment, sign in

More articles by Robson de Lima Laurindo

Others also viewed

Explore content categories