How to fix: Error getting HTTP 401 Unauthorized on the Telegraf?
Robson de Lima Laurindo
Senior Performance Testing Engineer at VTXRM - Software Factory
Have you already found this following message: Error getting HTTP config.?Retry 0 of 3 in 10s.?Status=401 on your Telegraf?
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.
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.
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.
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"
3.2 - Enter to address copied preivously. In case, you are using Windows, you can insert this command ".\" before copying. For example: .\telegraf --config https://yourIP:numberport/api/v2/telegrafs/xxxxxxxxxxxxxxxxx
For now, the Telegraf is working (I hopefully), so check out your plugins are properly configured and have fun!