Problem start service telegram

Hi all, I have a problem starting the Telegraf service.

basalisco@HASSIO:~$ sudo service telegraf restart
basalisco@HASSIO:~$ sudo service telegraf status
● telegraf.service - Telegraf
     Loaded: loaded (/lib/systemd/system/telegraf.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-01-09 18:17:22 CET; 6min ago
       Docs: https://github.com/influxdata/telegraf
   Main PID: 13746 (telegraf)
      Tasks: 9 (limit: 9345)
     Memory: 50.9M
     CGroup: /system.slice/telegraf.service
             └─13746 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d

gen 09 18:23:24 HASSIO telegraf[13746]: 2024-01-09T17:23:24Z E! [outputs.influxdb_v2] When writing to [http://10.0.0.30:8086]: failed to write metric to Monitoring (401 Unauthorized): unauthorized: unauthorized access
gen 09 18:23:24 HASSIO telegraf[13746]: 2024-01-09T17:23:24Z E! [agent] Error writing to outputs.influxdb_v2: failed to send metrics to any configured server(s)
gen 09 18:23:34 HASSIO telegraf[13746]: 2024-01-09T17:23:34Z E! [outputs.influxdb_v2] When writing to [http://10.0.0.30:8086]: failed to write metric to Monitoring (401 Unauthorized): unauthorized: unauthorized access
gen 09 18:23:34 HASSIO telegraf[13746]: 2024-01-09T17:23:34Z E! [agent] Error writing to outputs.influxdb_v2: failed to send metrics to any configured server(s)
gen 09 18:23:44 HASSIO telegraf[13746]: 2024-01-09T17:23:44Z E! [outputs.influxdb_v2] When writing to [http://10.0.0.30:8086]: failed to write metric to Monitoring (401 Unauthorized): unauthorized: unauthorized access
gen 09 18:23:44 HASSIO telegraf[13746]: 2024-01-09T17:23:44Z E! [agent] Error writing to outputs.influxdb_v2: failed to send metrics to any configured server(s)
gen 09 18:23:54 HASSIO telegraf[13746]: 2024-01-09T17:23:54Z E! [outputs.influxdb_v2] When writing to [http://10.0.0.30:8086]: failed to write metric to Monitoring (401 Unauthorized): unauthorized: unauthorized access
gen 09 18:23:54 HASSIO telegraf[13746]: 2024-01-09T17:23:54Z E! [agent] Error writing to outputs.influxdb_v2: failed to send metrics to any configured server(s)
gen 09 18:24:04 HASSIO telegraf[13746]: 2024-01-09T17:24:04Z E! [outputs.influxdb_v2] When writing to [http://10.0.0.30:8086]: failed to write metric to Monitoring (401 Unauthorized): unauthorized: unauthorized access
gen 09 18:24:04 HASSIO telegraf[13746]: 2024-01-09T17:24:04Z E! [agent] Error writing to outputs.influxdb_v2: failed to send metrics to any configured server(s)

This happens after the reboot. But if I start it by hand I have no problem

basalisco@HASSIO:~$ telegraf --config /etc/telegraf/telegraf.conf
2024-01-09T17:42:02Z I! Loading config: /etc/telegraf/telegraf.conf
2024-01-09T17:42:02Z I! Starting Telegraf 1.29.1 brought to you by InfluxData the makers of InfluxDB
2024-01-09T17:42:02Z I! Available plugins: 241 inputs, 9 aggregators, 30 processors, 24 parsers, 60 outputs, 6 secret-stores
2024-01-09T17:42:02Z I! Loaded inputs: snmp
2024-01-09T17:42:02Z I! Loaded aggregators: 
2024-01-09T17:42:02Z I! Loaded processors: 
2024-01-09T17:42:02Z I! Loaded secretstores: 
2024-01-09T17:42:02Z I! Loaded outputs: influxdb_v2
2024-01-09T17:42:02Z I! Tags enabled: host=test
2024-01-09T17:42:02Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"test", Flush Interval:10s
2024-01-09T17:42:04Z W! DeprecationWarning: Value "agent_host" for option "agent_host_tag" of plugin "inputs.snmp" deprecated since version 1.29.0 and will be removed in : should be set to "source" for consistent usage across plugins

I’d say the service starts but is unable to write metrics ... (401 Unauthorized): unauthorized: unauthorized access

How did you manage authentication? I think there are issues with the user running the service…

Sorry for duplicate post.

https://community.influxdata.com/t/problem-start-telegraf-service/32758/4

Solved.

1 Like