diff --git a/cmd/healthinfo_linux.go b/cmd/healthinfo_linux.go index 8db9de5e6..1871591b2 100644 --- a/cmd/healthinfo_linux.go +++ b/cmd/healthinfo_linux.go @@ -37,7 +37,10 @@ func getLocalOsInfo(ctx context.Context, r *http.Request) madmin.ServerOsInfo { addr = GetLocalPeer(globalEndpoints) } - info, err := host.InfoWithContext(ctx) + srvrOsInfo := madmin.ServerOsInfo{Addr: addr} + var err error + + srvrOsInfo.Info, err = host.InfoWithContext(ctx) if err != nil { return madmin.ServerOsInfo{ Addr: addr, @@ -45,23 +48,18 @@ func getLocalOsInfo(ctx context.Context, r *http.Request) madmin.ServerOsInfo { } } - sensors, err := host.SensorsTemperaturesWithContext(ctx) + srvrOsInfo.Sensors, err = host.SensorsTemperaturesWithContext(ctx) if err != nil { - return madmin.ServerOsInfo{ - Addr: addr, - Error: fmt.Sprintf("sensors-temp: %v", err), + // Set error only when it's not of WARNINGS type + if _, isWarning := err.(*host.Warnings); !isWarning { + srvrOsInfo.Error = fmt.Sprintf("sensors-temp: %v", err) } } // ignore user err, as it cannot be obtained reliably inside containers - users, _ := host.UsersWithContext(ctx) + srvrOsInfo.Users, _ = host.UsersWithContext(ctx) - return madmin.ServerOsInfo{ - Addr: addr, - Info: info, - Sensors: sensors, - Users: users, - } + return srvrOsInfo } func getLocalDiskHwInfo(ctx context.Context, r *http.Request) madmin.ServerDiskHwInfo {