修复识别运行kvm虚拟机的独服为虚拟机 (#6)

* fix distinguish kvm host as guset

* Fix spelling errors

* Update .gitignore

* update contributors[no ci]

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Crazy 2023-12-19 23:35:42 +08:00 committed by GitHub
parent abf3a7150b
commit 4c7faecf1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -7,6 +7,9 @@ Agent of Nezha Monitoring
<!--GAMFC_DELIMITER--><a href="https://github.com/naiba" title="naiba"> <!--GAMFC_DELIMITER--><a href="https://github.com/naiba" title="naiba">
<img src="https://avatars.githubusercontent.com/u/29243953?v=4" width="50;" alt="naiba"/> <img src="https://avatars.githubusercontent.com/u/29243953?v=4" width="50;" alt="naiba"/>
</a> </a>
<a href="https://github.com/wwng2333" title="Crazy">
<img src="https://avatars.githubusercontent.com/u/17147265?v=4" width="50;" alt="Crazy"/>
</a>
<a href="https://github.com/zhangnew" title="zhangnew"> <a href="https://github.com/zhangnew" title="zhangnew">
<img src="https://avatars.githubusercontent.com/u/9146834?v=4" width="50;" alt="zhangnew"/> <img src="https://avatars.githubusercontent.com/u/9146834?v=4" width="50;" alt="zhangnew"/>
</a> </a>

View File

@ -46,7 +46,7 @@ func GetHost(agentConfig *model.AgentConfig) *model.Host {
if err != nil { if err != nil {
println("host.Info error:", err) println("host.Info error:", err)
} else { } else {
if hi.VirtualizationSystem != "" { if hi.VirtualizationRole == "guest" {
cpuType = "Virtual" cpuType = "Virtual"
} else { } else {
cpuType = "Physical" cpuType = "Physical"