Telegraf config is not starting after reboot

Hi,

at first sry for my bad english :slight_smile:

I’ve installed influxdb2 within a LXC in proxmox running debian11.
After that I install telegraf as described here

Everything works fine and I get an config running.
But when I reboot the LXC, the config won’t run automatically and I had to start it manually with the known commands

export INFLUX_TOKEN=KALh4U4ggnFv4====
telegraf --config http://10.1.1.100:8086/api/v2/telegrafs/xxxxxxxxxxxxx

I’ve found a similar topic with the same issue and I followed the steps

My telegraf.service looks like this

[Service]
Type=notify
EnvironmentFile=-/etc/default/telegraf
User=telegraf
ExecStart=/usr/bin/telegraf --config http://10.1.1.100:8086/api/v2/telegrafs/xxxxxxxxxxxxx
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartForceExitStatus=SIGPIPE
KillMode=control-group

and in the /etc/default/telegraf I add my token

INFLUX_TOKEN=KALh4U4ggnFv4====

But after all of that, after a reboot the config won’t even start automatically .

Hope someone could help me :slight_smile:

greetings
shortyle

Hi,

First thing to do is read the logs and see why it is not starting. Try looking at journalctl --no-pager --unit telegraf and see what errors show up

thx for replying @jpowers

well log looks good for me

Mar 11 10:34:14 ITG systemd[1]: Stopping Telegraf...
Mar 11 10:34:14 ITG telegraf[125]: 2023-03-11T09:34:14Z I! [agent] Hang on, flushing any cached metrics before shutdown
Mar 11 10:34:14 ITG telegraf[125]: 2023-03-11T09:34:14Z I! [agent] Stopping running outputs
Mar 11 10:34:14 ITG systemd[1]: telegraf.service: Succeeded.
Mar 11 10:34:14 ITG systemd[1]: Stopped Telegraf.
Mar 11 10:34:14 ITG systemd[1]: telegraf.service: Consumed 3min 24.359s CPU time.
-- Boot 74937528aae94cbcb34d7800bacce7db --
Mar 11 10:35:19 ITG systemd[1]: Starting Telegraf...
Mar 11 10:35:19 ITG telegraf[125]: 2023-03-11T09:35:19Z I! Starting Telegraf 1.25.3
Mar 11 10:35:19 ITG telegraf[125]: 2023-03-11T09:35:19Z I! Available plugins: 228 inputs, 9 aggregators, 26 processors, 21 parsers, 57 outputs, 2 secret-stores
Mar 11 10:35:19 ITG telegraf[125]: 2023-03-11T09:35:19Z I! Loaded inputs: knx_listener
Mar 11 10:35:19 ITG telegraf[125]: 2023-03-11T09:35:19Z I! Loaded aggregators:
Mar 11 10:35:19 ITG telegraf[125]: 2023-03-11T09:35:19Z I! Loaded processors:
Mar 11 10:35:19 ITG telegraf[125]: 2023-03-11T09:35:19Z I! Loaded secretstores:
Mar 11 10:35:19 ITG telegraf[125]: 2023-03-11T09:35:19Z I! Loaded outputs: influxdb_v2
Mar 11 10:35:19 ITG telegraf[125]: 2023-03-11T09:35:19Z I! Tags enabled: host=ITG
Mar 11 10:35:19 ITG telegraf[125]: 2023-03-11T09:35:19Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"ITG", Flush Interval:10s
Mar 11 10:35:19 ITG telegraf[125]: 2023-03-11T09:35:19Z I! [inputs.knx_listener] Trying to connect to "tunnel" at "10.1.1.100:3671"
Mar 11 10:35:19 ITG telegraf[125]: 2023-03-11T09:35:19Z I! [inputs.knx_listener] Connected!
Mar 11 10:35:19 ITG systemd[1]: Started Telegraf.

and the knx.listener config seems to be running. Days and days ago it didn’t work. I’m a little bit confused right now, but glad it seems to work.

I’ll keep an eye on it.

Thx again @jpowers