Skip to content

Commit

Permalink
fix check_os_version windows build version (fixes #134)
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Jul 12, 2024
1 parent ea923c6 commit a322443
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
This file documents the revision history for the SNClient+ agent.

next:
- fix check_os_version windows build version

0.25 Fri Jun 14 14:34:25 CEST 2024
- update node exporter to 1.8.1
- migrate v3 to github.com/shirou/gopsutil/v4
Expand Down
7 changes: 7 additions & 0 deletions pkg/snclient/check_os_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ func (l *CheckOSVersion) Check(ctx context.Context, _ *Agent, check *CheckData,
return nil, fmt.Errorf("failed to get platform information: %s", err.Error())
}

if runtime.GOOS == "windows" {
version, err = host.KernelVersionWithContext(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get build information: %s", err.Error())
}
}

check.listData = []map[string]string{{
"platform": platform,
"family": family,
Expand Down

0 comments on commit a322443

Please # to comment.