Add internal function for telegraf version (#4828)

This commit is contained in:
Kevin Conaway
2018-10-09 16:45:07 -04:00
committed by Daniel Nelson
parent 709eadffc4
commit 7bb219222a
3 changed files with 41 additions and 0 deletions

View File

@@ -326,6 +326,16 @@ func main() {
return
}
shortVersion := version
if shortVersion == "" {
shortVersion = "unknown"
}
// Configure version
if err := internal.SetVersion(shortVersion); err != nil {
log.Println("Telegraf version already configured to: " + internal.Version())
}
if runtime.GOOS == "windows" && !(*fRunAsConsole) {
svcConfig := &service.Config{
Name: *fServiceName,