Skip to content

Lightweight server monitoring with historical data, docker stats, and alerts.

fix(agent): don't read host CPU and memory totals from a Docker VM (#2272)

Aditya Raj Singh7c60f0280220
diff --git a/agent/system.go b/agent/system.go
index f4441390e..1df167ee9 100644
--- a/agent/system.go
+++ b/agent/system.go
@@ -32,7 +32,11 @@ func (a *Agent) refreshSystemDetails() {
if a.dockerManager != nil {
a.systemDetails.Podman = a.dockerManager.IsPodman()
- hostInfo, _ = a.dockerManager.GetHostInfo()
+ // Docker's host info describes the machine its daemon runs on. On macOS and
+ // Windows that is a Linux VM, so its CPU and memory totals are not this host's.
+ if runtime.GOOS != "darwin" && runtime.GOOS != "windows" {
+ hostInfo, _ = a.dockerManager.GetHostInfo()
+ }
}
a.systemDetails.Hostname, _ = os.Hostname()