diff --git a/pkg/monitor/monitor.go b/pkg/monitor/monitor.go index 9801f9b..35d11ee 100644 --- a/pkg/monitor/monitor.go +++ b/pkg/monitor/monitor.go @@ -65,7 +65,7 @@ func GetHost(agentConfig *model.AgentConfig) *model.Host { count, err := cpu.Counts(false) if err != nil { println("cpu.Counts error:", err) - } else { + } else if len(ci) > 0 { ret.CPU = append(ret.CPU, fmt.Sprintf("%s %d %s Core", ci[0].ModelName, count, cpuType)) }