-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(inputs.ntpq): Allow to specify
reach
output format (#11594)
- Loading branch information
Showing
16 changed files
with
130 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
# Get standard NTP query metrics, requires ntpq executable. | ||
[[inputs.ntpq]] | ||
## Servers to query with ntpq. | ||
## If no server is given, the local machine is queried. | ||
# servers = [] | ||
|
||
## If false, set the -n ntpq flag. Can reduce metric gather time. | ||
## DEPRECATED since 1.24.0: add '-n' to 'options' instead to skip DNS lookup | ||
# dns_lookup = true | ||
|
||
## Options to pass to the ntpq command. | ||
# options = "-p" | ||
|
||
## Servers to query with ntpq. | ||
## If no server is given, the local machine is queried. | ||
# servers = [] | ||
## Output format for the 'reach' field. | ||
## Available values are | ||
## octal -- output as is in octal representation e.g. 377 (default) | ||
## decimal -- convert value to decimal representation e.g. 371 -> 249 | ||
## count -- count the number of bits in the value. This represents | ||
## the number of successful reaches, e.g. 37 -> 5 | ||
## ratio -- output the ratio of successful attempts e.g. 37 -> 5/8 = 0.625 | ||
# reach_format = "octal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ntpq,remote=uschi5-ntp-002.,state_prefix=*,refid=10.177.80.46,stratum=2,type=u when=101i,poll=256i,reach=5i,delay=51.016,offset=233.010,jitter=17.462 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
remote refid st t when poll reach delay offset jitter | ||
============================================================================== | ||
*uschi5-ntp-002. 10.177.80.46 2 u 101 256 37 51.016 233.010 17.462 |
2 changes: 2 additions & 0 deletions
2
plugins/inputs/ntpq/testcases/single_reach_count/telegraf.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[[inputs.ntpq]] | ||
reach_format = "count" |
1 change: 1 addition & 0 deletions
1
plugins/inputs/ntpq/testcases/single_reach_decimal/expected.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ntpq,remote=uschi5-ntp-002.,state_prefix=*,refid=10.177.80.46,stratum=2,type=u when=101i,poll=256i,reach=31i,delay=51.016,offset=233.010,jitter=17.462 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
remote refid st t when poll reach delay offset jitter | ||
============================================================================== | ||
*uschi5-ntp-002. 10.177.80.46 2 u 101 256 37 51.016 233.010 17.462 |
2 changes: 2 additions & 0 deletions
2
plugins/inputs/ntpq/testcases/single_reach_decimal/telegraf.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[[inputs.ntpq]] | ||
reach_format = "decimal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ntpq,remote=uschi5-ntp-002.,state_prefix=*,refid=10.177.80.46,stratum=2,type=u when=101i,poll=256i,reach=37i,delay=51.016,offset=233.010,jitter=17.462 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
remote refid st t when poll reach delay offset jitter | ||
============================================================================== | ||
*uschi5-ntp-002. 10.177.80.46 2 u 101 256 37 51.016 233.010 17.462 |
2 changes: 2 additions & 0 deletions
2
plugins/inputs/ntpq/testcases/single_reach_octal/telegraf.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[[inputs.ntpq]] | ||
reach_format = "octal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ntpq,remote=uschi5-ntp-002.,state_prefix=*,refid=10.177.80.46,stratum=2,type=u when=101i,poll=256i,reach=0.625,delay=51.016,offset=233.010,jitter=17.462 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
remote refid st t when poll reach delay offset jitter | ||
============================================================================== | ||
*uschi5-ntp-002. 10.177.80.46 2 u 101 256 37 51.016 233.010 17.462 |
2 changes: 2 additions & 0 deletions
2
plugins/inputs/ntpq/testcases/single_reach_ratio/telegraf.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[[inputs.ntpq]] | ||
reach_format = "ratio" |