Skip to content

Commit

Permalink
Fix exec plugin panic with single binary
Browse files Browse the repository at this point in the history
fixes #1330
  • Loading branch information
sparrc committed Jun 10, 2016
1 parent 75e6cb9 commit 008ed17
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## v1.0 beta 2 [unreleased]

### Features

### Bugfixes

- [#1330](https://github.com/influxdata/telegraf/issues/1330): Fix exec plugin panic when using single binary
- [#1336](https://github.com/influxdata/telegraf/issues/1336): Fixed incorrect prometheus metrics source selection

## v1.0 beta 1 [2016-06-07]

### Release Notes
Expand Down Expand Up @@ -50,7 +59,6 @@ time before a new metric is included by the plugin.
- [#1316](https://github.com/influxdata/telegraf/pull/1316): Removed leaked "database" tag on redis metrics. Thanks @PierreF!
- [#1323](https://github.com/influxdata/telegraf/issues/1323): Processes plugin: fix potential error with /proc/net/stat directory.
- [#1322](https://github.com/influxdata/telegraf/issues/1322): Fix rare RHEL 5.2 panic in gopsutil diskio gathering function.
- [#1336](https://github.com/influxdata/telegraf/issues/1336): Fixed incorrect prometheus metrics source selection

## v0.13.1 [2016-05-24]

Expand Down
8 changes: 6 additions & 2 deletions plugins/inputs/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,12 @@ func (e *Exec) Gather(acc telegraf.Accumulator) error {
// There were matches, so we'll append each match together with
// the arguments to the commands slice
for _, match := range matches {
commands = append(
commands, strings.Join([]string{match, cmdAndArgs[1]}, " "))
if len(cmdAndArgs) == 1 {
commands = append(commands, match)
} else {
commands = append(commands,
strings.Join([]string{match, cmdAndArgs[1]}, " "))
}
}
}
}
Expand Down

0 comments on commit 008ed17

Please sign in to comment.