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

ntpq input plugin should use the -w parameter to get entire IPv6 address of remote #4746

Closed
jbro opened this issue Sep 25, 2018 · 4 comments · Fixed by #11593
Closed

ntpq input plugin should use the -w parameter to get entire IPv6 address of remote #4746

jbro opened this issue Sep 25, 2018 · 4 comments · Fixed by #11593
Labels
feature request Requests for new plugin and for new features to existing plugins help wanted Request for community participation, code, contribution size/m 2-4 day effort

Comments

@jbro
Copy link
Contributor

jbro commented Sep 25, 2018

Relevant telegraf.conf:

[[inputs.ntpq]]
  dns_lookup = false

System info:

Telegraf v1.6.4 (git: release-1.6 b24e8648)
Linux monitor 4.4.0-130-generic #156-Ubuntu SMP Thu Jun 14 08:53:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"

Steps to reproduce:

  1. $ sudo telegraf --test --input-filter ntpq
  2. $ ntpq -p -n
  3. $ ntpq -p -n -w

Expected behavior:

$ sudo telegraf --test --input-filter ntpq
2018/09/25 10:44:04 I! Using config file: /etc/telegraf/telegraf.conf
* Plugin: inputs.ntpq, Collection 1
> ntpq,host=monitor.nordu.net,refid=192.36.143.130,remote=2001:948:96::132,state_prefix=*,stratum=2,type=u reach=377i,when=22i,jitter=0.065,delay=12.424,offset=0.398,poll=32i 1537872245000000000
> ntpq,host=monitor.nordu.net,refid=192.36.143.130,remote=2001:948:96::133,state_prefix=+,stratum=2,type=u reach=377i,when=1i,poll=32i,delay=0.17,offset=-0.564,jitter=0.045 1537872245000000000
> ntpq,host=monitor.nordu.net,refid=83.168.200.199,remote=2001:948:96::134,state_prefix=-,stratum=3,type=u when=5i,poll=32i,delay=11.915,offset=-3.049,jitter=0.07,reach=377i 1537872245000000000
> ntpq,host=monitor.nordu.net,refid=192.36.143.130,remote=2001:948:96::135,state_prefix=+,stratum=2,type=u reach=377i,when=29i,jitter=0.045,delay=0.696,offset=-0.503,poll=32i 1537872245000000000

Actual behavior:

$ sudo telegraf --test --input-filter ntpq
2018/09/25 10:44:04 I! Using config file: /etc/telegraf/telegraf.conf
* Plugin: inputs.ntpq, Collection 1
> ntpq,host=monitor.nordu.net,refid=192.36.143.130,remote=2001:948:96::13,state_prefix=*,stratum=2,type=u reach=377i,when=22i,jitter=0.065,delay=12.424,offset=0.398,poll=32i 1537872245000000000
> ntpq,host=monitor.nordu.net,refid=192.36.143.130,remote=2001:948:96::13,state_prefix=+,stratum=2,type=u reach=377i,when=1i,poll=32i,delay=0.17,offset=-0.564,jitter=0.045 1537872245000000000
> ntpq,host=monitor.nordu.net,refid=83.168.200.199,remote=2001:948:96::13,state_prefix=-,stratum=3,type=u when=5i,poll=32i,delay=11.915,offset=-3.049,jitter=0.07,reach=377i 1537872245000000000
> ntpq,host=monitor.nordu.net,refid=192.36.143.130,remote=2001:948:96::13,state_prefix=+,stratum=2,type=u reach=377i,when=29i,jitter=0.045,delay=0.696,offset=-0.503,poll=32i 1537872245000000000

Additional info:

$ ntpq -p -n
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*2001:948:96::13 192.36.143.130   2 u   20   32  377   12.495    0.505   0.055
+2001:948:96::13 192.36.143.130   2 u   32   32  377    0.164   -0.301   0.106
-2001:948:96::13 83.168.200.199   3 u    8   32  377   11.953   -2.932   0.073
+2001:948:96::13 192.36.143.130   2 u   30   32  377    0.722   -0.426   0.074
$ ntpq -p -n -w
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*2001:948:96::132
                 192.36.143.130   2 u    1   32  377   12.495    0.505   0.057
+2001:948:96::133
                 192.36.143.130   2 u   13   32  377    0.164   -0.301   0.083
-2001:948:96::134
                 83.168.200.199   3 u   22   32  377   11.953   -2.932   0.073
+2001:948:96::135
                 192.36.143.130   2 u   11   32  377    0.722   -0.426   0.076
@glinton glinton added the feature request Requests for new plugin and for new features to existing plugins label Sep 26, 2018
@glinton
Copy link
Contributor

glinton commented Sep 26, 2018

I wonder if this plugin is a good candidate for custom flags, similar to the ping plugin.

@jbro
Copy link
Contributor Author

jbro commented Sep 28, 2018

The problem here is that I can't distinguish the peers, as all the measurements have remote=2001:948:96::13. So optional flags would be a fix for that, but I think it is a general that you can't tell peers a part.

@glinton
Copy link
Contributor

glinton commented Sep 28, 2018

Gotcha, as long as adding it doesn't cause problems for others, I think it can go in. If you've got a minute, and would like to add this, we love community PRs.

@glinton
Copy link
Contributor

glinton commented Sep 28, 2018

It has been brought to my attention that the -w flag is not always available.
Docs for reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins help wanted Request for community participation, code, contribution size/m 2-4 day effort
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants