Skip to content

add nsd input plugin#7822

Merged
reimda merged 3 commits intoinfluxdata:masterfrom
gearnode:nsd-input
Sep 4, 2020
Merged

add nsd input plugin#7822
reimda merged 3 commits intoinfluxdata:masterfrom
gearnode:nsd-input

Conversation

@gearnode
Copy link
Copy Markdown
Contributor

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@gearnode gearnode force-pushed the nsd-input branch 2 times, most recently from 996925c to c1dce7c Compare July 11, 2020 14:51
@gearnode
Copy link
Copy Markdown
Contributor Author

gearnode commented Sep 2, 2020

@danielnelson Any ETA to merge this patch ?

Copy link
Copy Markdown
Contributor

@reimda reimda left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Daniel has moved on and isn't directly involved with telegraf now.

```toml
# A plugin to collect stats from the NSD DNS resolver
[[inputs.nsd]]
## Address of server to connect to, read from nsd conf default, optionally ':port'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Address of server to connect to, read from nsd conf default, optionally ':port'
## Address of server to connect to, optionally with ':port'. Defaults to the address in the nsd config file.

if len(serverIps) == 0 {
return nil, fmt.Errorf("error no ip for server: %s: %s", Server, err)
}
server := serverIps[0].IP.String()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I understand that nsd-control's -s option requires an IP address, not a hostname, so we need to resolve the name here. I'm a little concerned that this ignores secondary IPs. Ordinary, connecting through Dial() will try each IP in order until it succeeds (https://golang.org/pkg/net/#Dial). It may be unlikely that we can't connect on the first IP and we can on a secondary, but if this is the case and we never try the secondary IPs, telegraf will fail silently and it will be difficult for a user to debug.

I wonder if it would be worth it to remove the ability to resolve the server hostname and require the user to provide an IP, since this is what nsd-control's -s option requires.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree. In fact I add this because the unbound input plugin have this behavior.

@gearnode gearnode force-pushed the nsd-input branch 2 times, most recently from eb5a14f to f043543 Compare September 3, 2020 12:44
@gearnode gearnode requested a review from reimda September 3, 2020 12:52
@reimda reimda merged commit 6324b1f into influxdata:master Sep 4, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
This was referenced Oct 13, 2020
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants