I tried installing telegraf as windows service, on invoking the Telegraf service from services manager, received process terminated error - 1067. and there is no much info on windows event logger too.
This usually happens when you don’t use the absolute path to the configuration file, or when the path is not valid.
Have a look at the service properties and ensure the --config is right, you can see that in the “path to executable” just below the “Description”. (and post it here if possible)
You might need to unregister the service and register it back if the parameter is not correctly set.
You can also try to don’t use the double quotes around the path, or to use single quotes. (but I think neither of them will help)
Thanks for response … Even I tried installing the telegraf as windows service in another machine in C:drive under program files, but there also same kind of error.
This is value it points to path to executable in the recent one installed “C:\Program Files\Telegraf\telegraf.exe” --config “C:\Program Files\Telegraf\telegraf.conf” --service-name telegraf
Maybe we can get something more verbose using PowerShell
Start-Service -Name telegraf -Verbose
try it and let me know
I would also check the permission of the user running the service, but by default it should be “system”, so godlike privileges.
If you have no time to look into it you can use nssm as a workaround (not a real workaround tho, as it’s commonly used to run services on windows), it will achieve the same result
Received generic error, not much detail even with verbose,
VERBOSE: Performing the operation “Start-Service” on target “Telegraf Data Collector Service (telegraf)”.
Start-Service : Failed to start service ‘Telegraf Data Collector Service (telegraf)’.
At line:1 char:1
I have telegraf running on several Windows hosts and this happens only when the path to config is incorrect or there is toml parsing error.
You said that it works fine when you run it from cmd, but the command you posted is ‘telegraf -config telegraf.conf’, note that there is only one dash before config… and that’s a whole different command for telegraf, it outputs its default configuration to stdout. (but maybe is just a typo)
I’d suggest you try to run .\telegraf.exe --config __AbsolutePathToConf__ --test
also enable the debug logging for telegraf and write its log to a file (see the “agent” section of the config).
Then have a look at the log file for errors.
If there are no parsing or critical plugin related errors, then I have no clue about what could it be.
And goes on with … win_proc, CPU, disk, device , diskio… mem
…
In Log file just seeing following line alone - 2020-11-06T09:51:57Z D! [agent] Initializing plugins
…
Note : Another observation, when ever the specific machine is restarted, the Telegraf Data collector service runs automatically. When ever if it is tried to stop and start it again - It throws the same error -‘Erro -1067’
…