Telegraf failed to start?

I running a fresh install of Ubuntu and have installed influxDb and telegraf using the online tutorials.

For some reason I cannot get telegraf to start?

ubuntu@ubuntu-virtual-machine:~$ sudo systemctl start telegraf
ubuntu@ubuntu-virtual-machine:~$ sudo systemctl status telegraf
● telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB
Loaded: loaded (/lib/systemd/system/telegraf.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Mon 2018-03-19 19:12:02 GMT; 8s ago
Docs: GitHub - influxdata/telegraf: The plugin-driven server agent for collecting & reporting metrics.
Process: 4272 ExecStart=/usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf
Main PID: 4272 (code=exited, status=1/FAILURE)

Mar 19 19:12:02 ubuntu-virtual-machine systemd[1]: telegraf.service: Unit entered failed state.
Mar 19 19:12:02 ubuntu-virtual-machine systemd[1]: telegraf.service: Failed with result ‘exit-code’.
Mar 19 19:12:02 ubuntu-virtual-machine systemd[1]: telegraf.service: Service hold-off time over, scheduling restart.
Mar 19 19:12:02 ubuntu-virtual-machine systemd[1]: Stopped The plugin-driven server agent for reporting metrics into Inf
Mar 19 19:12:02 ubuntu-virtual-machine systemd[1]: telegraf.service: Start request repeated too quickly.
Mar 19 19:12:02 ubuntu-virtual-machine systemd[1]: Failed to start The plugin-driven server agent for reporting metrics

Is there anyway of finding out why? Or reinstalling telegraf?

Have you looked at the logs for telegraf? It’s often an issue in the telegraf.conf file, and the logs may have more than just using systemctl. Try journalctl -fu telegraf to follow the logs on startup.

1 Like

I ended up giving up using Ubuntu on a VM and installed Ubuntu directly onto the machine and the install was perfectly smooth. I think it has something to do with ESXi permission / configuration!

I am seeing exactly the same issue. Looking in the syslog I see that there seems to be an issue with creating the following directories.
log extract below.
Aug 23 21:03:45 masternode telegraf[5979]: time=“2021-08-23T21:03:45+01:00” level=error msg=“failed to create cache directory. /etc/telegraf/.cache/snowflake, err: mkdir /etc/telegraf/.cache: permission denied. ignored\n” func=“gosnowflake.(*defaultLogger).Errorf” file=“log.go:120”
Aug 23 21:03:45 masternode telegraf[5979]: time=“2021-08-23T21:03:45+01:00” level=error msg=“failed to open. Ignored. open /etc/telegraf/.cache/snowflake/ocsp_response_cache.json: no such file or directory\n” func=“gosnowflake.(*defaultLogger).Errorf” file=“log.go:120”

All the searching I have found that the issue is with telegraf 1.19 and the suggestion is to revert to telegraf 1.18. I have found the earlier version, but I cannot find the file format to install onto a raspberry pi.

Any suggestions ?
Thanks
Lawrence