InfluxDB Error creation failed: 401 Unauthorized

Hello,

I’m trying to collect data from a Azure SQL Managed Instance I’ve stumbled across this article using Grafana, InfluxDB & telegraf for achieving some useful looking dashboards.

I’m running a VM in Azure in the same VNET and after following the instructions from the article and running systemctl status -l telegraf I see the below error.

[outputs.influxdb] When writing to [http://127.0.0.1:8086]: database “telegraf” creation failed: 401 Unauthorized

Upon logging into Grafana web gui and trying to add the influxdb as a data source I just receive

influxDB Error: Bad Request

I’m running this on Ubuntu 18.04 LTS I tried spinning up a fresh 20.04 and ran into the same issue. This is my first experience with InfluxDB, telegraf or Grafana and I’m really struggling to get to the bottom of my issue.

Any assistance in identifying what’s going wrong would be much appreciated.

I’m unable to edit my post being a new user but below is my config.

[[inputs.sqlserver]]
servers = [“Server=[SQL MI];User Id=[SQL MI User];Password=[SQL MI User Password];app name=telegraf;”]

query_version = 2

[[outputs.influxdb]]
urls = [“http://127.0.0.1:8086”]
database = “telegraf”

Does “netstat -lptn” confirm that you do in fact have Influx listening on
localhost port 8086?

Antony.

I’m not much of a Linux user but it looks to have bound over ipv6 could this be the issue

And your ipv4 seems to listen on port 4222 ?