From 4c7faecf1b561eec45f0a89220defe322333257e Mon Sep 17 00:00:00 2001 From: Crazy <17147265+wwng2333@users.noreply.github.com> Date: Tue, 19 Dec 2023 23:35:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=86=E5=88=AB=E8=BF=90?= =?UTF-8?q?=E8=A1=8Ckvm=E8=99=9A=E6=8B=9F=E6=9C=BA=E7=9A=84=E7=8B=AC?= =?UTF-8?q?=E6=9C=8D=E4=B8=BA=E8=99=9A=E6=8B=9F=E6=9C=BA=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix distinguish kvm host as guset * Fix spelling errors * Update .gitignore * update contributors[no ci] --------- Co-authored-by: github-actions[bot] --- .gitignore | 2 +- README.md | 3 +++ pkg/monitor/monitor.go | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 09404fce..95a7ed08 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .DS_Store /agent -*.pprof \ No newline at end of file +*.pprof diff --git a/README.md b/README.md index d272a2cd..d4282d6a 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ Agent of Nezha Monitoring naiba + + Crazy + zhangnew diff --git a/pkg/monitor/monitor.go b/pkg/monitor/monitor.go index aea759c0..69001845 100644 --- a/pkg/monitor/monitor.go +++ b/pkg/monitor/monitor.go @@ -46,7 +46,7 @@ func GetHost(agentConfig *model.AgentConfig) *model.Host { if err != nil { println("host.Info error:", err) } else { - if hi.VirtualizationSystem != "" { + if hi.VirtualizationRole == "guest" { cpuType = "Virtual" } else { cpuType = "Physical"