Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -config-directory argument to Windows service #2312

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

- [#2077](https://github.com/influxdata/telegraf/issues/2077): SQL Server Input - Arithmetic overflow error converting numeric to data type int.
- [#2262](https://github.com/influxdata/telegraf/issues/2262): Flush jitter can inhibit metric collection.
- [#1797](https://github.com/influxdata/telegraf/issues/1797): Windows service does not support config directory.

## v1.2 [2017-01-00]

Expand Down
5 changes: 4 additions & 1 deletion cmd/telegraf/telegraf.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ func main() {
DisplayName: "Telegraf Data Collector Service",
Description: "Collects data using a series of plugins and publishes it to" +
"another series of plugins.",
Arguments: []string{"-config", "C:\\Program Files\\Telegraf\\telegraf.conf"},
Arguments: []string{
"-config", "C:\\Program Files\\Telegraf\\telegraf.conf",
"-config-directory", "C:\\Program Files\\Telegraf\\telegraf.d",
},
}

prg := &program{}
Expand Down
6 changes: 3 additions & 3 deletions docs/WINDOWS_SERVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Telegraf natively supports running as a Windows Service. Outlined below is are
the general steps to set it up.

1. Obtain the telegraf windows distribution
2. Create the directory `C:\Program Files\Telegraf` (if you install in a different
location simply specify the `-config` parameter with the desired location)
2. Create the directories `C:\Program Files\Telegraf` and `C:\Program Files\Telegraf\telegraf.d`
(if you install in a different location simply specify the `-config` and `-config-directory` parameters with the desired location)
3. Place the telegraf.exe and the telegraf.conf config file into `C:\Program Files\Telegraf`
4. 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 paths in double quotes ""):

Expand All @@ -17,7 +17,7 @@ the general steps to set it up.
6. To check that it works, run:

```
> C:\"Program Files"\Telegraf\telegraf.exe --config C:\"Program Files"\Telegraf\telegraf.conf --test
> C:\"Program Files"\Telegraf\telegraf.exe --config C:\"Program Files"\Telegraf\telegraf.conf --config-directory C:\"Program Files"\Telegraf\telegraf.d --test
```

7. To start collecting data, run:
Expand Down