Hi,
I’m trying to setup Telegraf (1.21.4) with InfluxDB (2.1.1) to capture some statistics from the Telegraf ping and internet_speed plugins.
However, I seem to be repeatedly hitting permissions issues trying to write to the InfluxDB2 instance.
Here is my telegraf configuration:
[[outputs.influxdb_v2]]
# ## The URLs of the InfluxDB cluster nodes.
# ##
# ## Multiple URLs can be specified for a single cluster, only ONE of the
# ## urls will be written to each interval.
# ## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
# urls = ["http://127.0.0.1:8086"]
urls = ["http://10.5.1.72:8086"]
#
# ## Token for authentication.
# token = ""
token = "oZSZ0CnbZcwKouMQ3JfR7n7K0vAuMNFaa0rymxpQ6jGQU8ZqHjiHb9Vu5OVf23CeLR7Tytuzg8doVQTo_n_3Vg=="
#
# ## Organization is the name of the organization you wish to write to; must exist.
# organization = ""
organization = "foo"
#
# ## Destination bucket to write into.
# bucket = ""
bucket = "internet-testing"
(I’ve included my token verbatim above, in case I mis-formatted it - obviously will rotate it now…aha).
And in the journalctl -u inf:
Mar 19 07:32:13 foo-monitoring telegraf[3610]: 2022-03-18T20:32:13Z I! Starting Telegraf 1.21.4
Mar 19 07:32:13 foo-monitoring telegraf[3610]: 2022-03-18T20:32:13Z I! Loaded inputs: cpu disk diskio internet_speed kernel mem ping processes swap system
Mar 19 07:32:13 foo-monitoring telegraf[3610]: 2022-03-18T20:32:13Z I! Loaded aggregators:
Mar 19 07:32:13 foo-monitoring telegraf[3610]: 2022-03-18T20:32:13Z I! Loaded processors:
Mar 19 07:32:13 foo-monitoring telegraf[3610]: 2022-03-18T20:32:13Z I! Loaded outputs: influxdb influxdb_v2
Mar 19 07:32:13 foo-monitoring telegraf[3610]: 2022-03-18T20:32:13Z I! Tags enabled: host=foo-monitoring
Mar 19 07:32:13 foo-monitoring telegraf[3610]: 2022-03-18T20:32:13Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"foo-monitoring", Flush Interval:10s
Mar 19 07:32:13 foo-monitoring telegraf[3610]: 2022-03-18T20:32:13Z W! [outputs.influxdb] When writing to [http://localhost:8086]: database "telegraf" creation failed: 401 Unauthorized
Mar 19 07:32:23 foo-monitoring telegraf[3610]: 2022-03-18T20:32:23Z E! [outputs.influxdb] E! [outputs.influxdb] Failed to write metric (will be dropped: 401 Unauthorized):
Mar 19 07:32:33 foo-monitoring telegraf[3610]: 2022-03-18T20:32:33Z E! [outputs.influxdb] E! [outputs.influxdb] Failed to write metric (will be dropped: 401 Unauthorized):
Mar 19 07:32:43 foo-monitoring telegraf[3610]: 2022-03-18T20:32:43Z E! [outputs.influxdb] E! [outputs.influxdb] Failed to write metric (will be dropped: 401 Unauthorized):
Mar 19 07:32:53 foo-monitoring telegraf[3610]: 2022-03-18T20:32:53Z E! [outputs.influxdb] E! [outputs.influxdb] Failed to write metric (will be dropped: 401 Unauthorized):
Mar 19 07:33:03 foo-monitoring telegraf[3610]: 2022-03-18T20:33:03Z E! [outputs.influxdb] E! [outputs.influxdb] Failed to write metric (will be dropped: 401 Unauthorized):
I’ve tried using both a read/write API token scoped to the bucket (internet-testing
, and even an All Access API token, and both seem to give the 401 error.
Did I miss a step somewhere?