Telegraf stops reading file

why do we need to restart telegraf sometimes when a we restart a process that populates the csv file that telegraf writes into influxdb?

Hello @neo1702,
I’m not sure. That shouldn’t have an affect. Can you share any error message or steps to reproduce it? What version of telegraf are you running?

@popey have you run into this before?

as this behaviour is very intermittent, i had to wait for this to happen so that i can check the logs…
the error logs simply say “no such file or directory”
this happens after the process is started and this process then starts updating a csv file
which i am trying to write into influxdb using telegraf

this gets resolved as soon as i restart telegraf.

Is this file subject to log rotation, meaning that the old file gets closed and
renamed, and new file is then opened with the same name, either ona regular
(commonly, daily or weekly) basis, or when the file reaches a certain size?

If that is the case then you should add telegraf to the list of processes to
be restarted after rotating the file.

Antony.

1 Like

yes the old file gets removed and a new file with new filename replaces it…
the filenames has current date that changes… which is taken care of by using variable that is declared in /etc/default/telegraf($TODAY.foo.csv)

I do restart telegraf as there is no other solution. but why is it so? variable is set and the same is used in the conf file.
AND, this does not happen as a standard behaviour… in most of the cases the files gets picked by telegraf as we have the variable… but for a particular process telegraf fails to read the file…

logs as i said are also not very helpful… where should i look to get some solution… restarting it not a good solution and also is not required for all the processes so there has to be some explanation to this.