Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
telegraf-nftables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2035-04-24.
Why is this scheduled?
Show more breadcrumbs
vqgroup
telegraf-nftables
Commits
a251adb8
Commit
a251adb8
authored
8 years ago
by
Cameron Sparr
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix type conflict on windows ping plugin (#2462)
closes #1433
parent
9e810ac4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+7
-0
7 additions, 0 deletions
CHANGELOG.md
plugins/inputs/ping/ping_windows.go
+6
-6
6 additions, 6 deletions
plugins/inputs/ping/ping_windows.go
plugins/inputs/ping/ping_windows_test.go
+3
-3
3 additions, 3 deletions
plugins/inputs/ping/ping_windows_test.go
with
16 additions
and
9 deletions
CHANGELOG.md
+
7
−
0
View file @
a251adb8
...
...
@@ -2,6 +2,12 @@
### Release Notes
-
Users of the windows
`ping`
plugin will need to drop or migrate their
measurements in order to continue using the plugin. The reason for this is that
the windows plugin was outputting a different type than the linux plugin. This
made it impossible to use the
`ping`
plugin for both windows and linux
machines.
-
Ceph: the
`ceph_pgmap_state`
metric content has been modified to use a unique field
`count`
, with each state expressed as a
`state`
tag.
Telegraf < 1.3:
...
...
@@ -65,6 +71,7 @@ be deprecated eventually.
-
[
#2390
](
https://github.com/influxdata/telegraf/issues/2390
)
: Empty tag value causes error on InfluxDB output.
-
[
#2380
](
https://github.com/influxdata/telegraf/issues/2380
)
: buffer_size field value is negative number from "internal" plugin.
-
[
#2414
](
https://github.com/influxdata/telegraf/issues/2414
)
: Missing error handling in the MySQL plugin leads to segmentation violation.
-
[
#2462
](
https://github.com/influxdata/telegraf/pull/2462
)
: Fix type conflict in windows ping plugin.
-
[
#2178
](
https://github.com/influxdata/telegraf/issues/2178
)
: logparser: regexp with lookahead.
-
[
#2466
](
https://github.com/influxdata/telegraf/issues/2466
)
: Telegraf can crash in LoadDirectory on 0600 files.
...
...
This diff is collapsed.
Click to expand it.
plugins/inputs/ping/ping_windows.go
+
6
−
6
View file @
a251adb8
...
...
@@ -40,10 +40,10 @@ func (s *Ping) Description() string {
const
sampleConfig
=
`
## urls to ping
urls = ["www.google.com"] # required
## number of pings to send per collection (ping -n <COUNT>)
count = 4 # required
## Ping timeout, in seconds. 0 means default timeout (ping -w <TIMEOUT>)
Timeout = 0
`
...
...
@@ -64,7 +64,7 @@ func hostPinger(timeout float64, args ...string) (string, error) {
}
// processPingOutput takes in a string output from the ping command
// based on linux implementation but using regex ( multilanguage support )
( shouldn't affect the performance of the program )
// based on linux implementation but using regex ( multilanguage support )
// It returns (<transmitted packets>, <received reply>, <received packet>, <average response>, <min response>, <max response>)
func
processPingOutput
(
out
string
)
(
int
,
int
,
int
,
int
,
int
,
int
,
error
)
{
// So find a line contain 3 numbers except reply lines
...
...
@@ -189,13 +189,13 @@ func (p *Ping) Gather(acc telegraf.Accumulator) error {
"percent_reply_loss"
:
lossReply
,
}
if
avg
>
0
{
fields
[
"average_response_ms"
]
=
avg
fields
[
"average_response_ms"
]
=
float64
(
avg
)
}
if
min
>
0
{
fields
[
"minimum_response_ms"
]
=
min
fields
[
"minimum_response_ms"
]
=
float64
(
min
)
}
if
max
>
0
{
fields
[
"maximum_response_ms"
]
=
max
fields
[
"maximum_response_ms"
]
=
float64
(
max
)
}
acc
.
AddFields
(
"ping"
,
fields
,
tags
)
}(
url
)
...
...
This diff is collapsed.
Click to expand it.
plugins/inputs/ping/ping_windows_test.go
+
3
−
3
View file @
a251adb8
...
...
@@ -77,9 +77,9 @@ func TestPingGather(t *testing.T) {
"reply_received"
:
4
,
"percent_packet_loss"
:
0.0
,
"percent_reply_loss"
:
0.0
,
"average_response_ms"
:
50
,
"minimum_response_ms"
:
50
,
"maximum_response_ms"
:
52
,
"average_response_ms"
:
50
.0
,
"minimum_response_ms"
:
50
.0
,
"maximum_response_ms"
:
52
.0
,
}
acc
.
AssertContainsTaggedFields
(
t
,
"ping"
,
fields
,
tags
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment