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 option to disable dns lookup for chronyc #1265

Closed
wants to merge 1 commit into from
Closed

add option to disable dns lookup for chronyc #1265

wants to merge 1 commit into from

Conversation

zbindenren
Copy link
Contributor

@zbindenren zbindenren commented May 25, 2016

Make reverse lookups of time server configurable.

Required for all PRs:

  • CHANGELOG.md updated
  • Sign CLA (if not already signed)
  • README.md updated (if adding a new plugin)

}

func (c *Chrony) Gather(acc telegraf.Accumulator) error {
if len(c.path) == 0 {
return errors.New("chronyc not found: verify that chrony is installed and that chronyc is in your PATH")
}
cmd := execCommand(c.path, "tracking")
flags := []string{"-n", "tracking"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems more explicit to add flags to the array if you want them, rather than remove when you don't.

I would change to:

flags := []string{}
if !c.DNSLookup {
  flags = append(flags, "-n")
}
flags = append(flags, "tracking")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it.

@sparrc sparrc closed this in a8334c3 May 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants