Running Telegraf as a Windows service
This page documents an earlier version of Telegraf. Telegraf v1.26 is the latest stable version.
Running Telegraf as a Windows service
Telegraf natively supports running as a Windows service. Outlined below are the general steps to set it up.
Obtain the Telegraf distribution for Windows.
Create the directory
C:\Program Files\Telegraf
(if you install in a different location, specify the-config
parameter with the desired location)Place the
telegraf.exe
and thetelegraf.conf
files intoC:\Program Files\Telegraf
.To install the service into the Windows Service Manager, run the following in PowerShell as an administrator. If necessary, you can wrap any spaces in the file directories in double quotes
"<file directory>"
:> C:\"Program Files"\Telegraf\telegraf.exe --service install
Edit the configuration file to meet your requirements.
To verify that it works, run:
> C:\"Program Files"\Telegraf\telegraf.exe --config C:\"Program Files"\Telegraf\telegraf.conf --test
To start collecting data, run:
> net start telegraf
Other supported operations
Telegraf can manage its own service through the --service
flag:
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 |
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.