Skip to content

Commit

Permalink
Fix service start type mapping in windows/service metricset (elastic#…
Browse files Browse the repository at this point in the history
…19551)

* fit service start type

* test

* changelog

(cherry picked from commit 194be7f)
  • Loading branch information
narph committed Jul 14, 2020
1 parent e05c5ea commit 72c4134
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Remove dedot for tag values in aws module. {issue}19112[19112] {pull}19221[19221]
- Set tags correctly if the dimension value is ARN {issue}19111[19111] {pull}19433[19433]
- Fix bug incorrect parsing of float numbers as integers in Couchbase module {issue}18949[18949] {pull}19055[19055]
- Fix mapping of service start type in the service metricset, windows module. {pull}19551[19551]
- Fix config example in the perfmon configuration files. {pull}19539[19539]
- Add missing info about the rest of the azure metricsets in the documentation. {pull}19601[19601]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func TestReadService(t *testing.T) {
assert.Equal(t, w.ProcessId, s["pid"],
"PID of service %v does not match", w.DisplayName)
}
assert.NotEmpty(t, s["start_type"])
// For some services DisplayName and Name are the same. It seems to be a bug from the wmi query.
if w.DisplayName != w.Name {
assert.Equal(t, w.DisplayName, s["display_name"],
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/module/windows/service/service_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const (
ConfigPreshutdownInfo ConfigInformation = 7
ConfigRequiredPrivilegesInfo ConfigInformation = 6
ConfigServiceSidInfo ConfigInformation = 5
)

const (
StartTypeBoot ServiceStartType = iota
StartTypeSystem
StartTypeAutomatic
Expand Down

0 comments on commit 72c4134

Please sign in to comment.