Running Telegraf as a Windows service
This page documents an earlier version of Telegraf. Telegraf v1.26 is the latest stable version.
Telegraf natively supports running as a Windows service.
The following commands are available:
Command | Effect |
---|---|
telegraf.exe --service install | Install telegraf as a service |
telegraf.exe --service uninstall | Remove the telegraf service |
telegraf.exe --service start | Start the telegraf service |
telegraf.exe --service stop | Stop the telegraf service |
Outlined below are the general steps to install Telegraf as a Service.
Installing a Windows service requires administrative permissions. Be sure to launch Powershell as administrator.
Download the Telegraf binary and unzip its contents to
C:\Program Files\InfluxData\Telegraf
.In PowerShell, run the following as an administrator:
> cd "C:\Program Files\InfluxData\Telegraf" > .\telegraf.exe --service install --config "C:\Program Files\InfluxData\Telegraf\telegraf.conf"
When installing Telegraf as a Windows service, provide the absolute path of the Telegraf configuration file. Otherwise the Windows service may fail to start.
To test that the installation works, run:
> C:\"Program Files"\InfluxData\Telegraf\telegraf.exe --config C:\"Program Files"\InfluxData\Telegraf\telegraf.conf --test
To start collecting data, run:
telegraf.exe --service start
Logging and troubleshooting
When Telegraf runs as a Windows service, Telegraf logs messages to Windows event logs. If the Telegraf service fails to start, view error logs by selecting Event Viewer→Windows Logs→Application.
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Telegraf and this documentation. To find support, use the following resources:
InfluxDB Cloud customers can contact InfluxData Support.