Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Commit 06511f0

Browse files
committed
fix(diagnostics): use gopsutil OS detection
1 parent c5e1175 commit 06511f0

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

cmd/patchmon-agent/commands/diagnostics.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,20 @@ func showDiagnostics() error {
3333

3434
// System Information
3535
fmt.Printf("System Information:\n")
36-
fmt.Printf(" OS: %s\n", runtime.GOOS)
37-
fmt.Printf(" Architecture: %s\n", runtime.GOARCH)
3836

3937
systemDetector := system.New(logger)
38+
39+
osType, osVersion, err := systemDetector.DetectOS()
40+
if err != nil {
41+
fmt.Printf(" OS: %s (detection failed: %v)\n", runtime.GOOS, err)
42+
osType = runtime.GOOS
43+
osVersion = "unknown"
44+
} else {
45+
fmt.Printf(" OS: %s %s\n", osType, osVersion)
46+
}
47+
48+
fmt.Printf(" Architecture: %s\n", runtime.GOARCH)
49+
4050
kernelVersion := systemDetector.GetKernelVersion()
4151
fmt.Printf(" Kernel: %s\n", kernelVersion)
4252

0 commit comments

Comments
 (0)