Telegraf requires that inputs are up and available on start. When telegraf starts it will go through and start up the various inputs. In this startup process if the input has any services or devices that it needs to connect to, it will do this during this stage. If any inputs fail to connect to a service or device Telegraf will stop.
In the configure file connection_timeout = "60s" added. But it is not restarting telegraf.
This configuration setting is not used until after you connect. Additionally, it has no effect on restarting telegraf as a whole.
Your connection must work when telegraf starts or it will not start up.
connection refused.
Connection refused usually means that the service is either not listening on the specified port or a firewall is preventing a connection to the service.
In your case, I would suggest ensuring that the service is in fact running on that IP address on that port and is accessible. I like to use telnet
to quickly try these things. Based on your error message it would look like: telnet 192.168.1.5 1883