Forum Discussion

Slim's avatar
Slim
Icon for Neophyte rankNeophyte
4 years ago

How to determine if Linux resource is physical or virtual

On Windows hosts, the system.model property is populated and allows me to see if a resource is physical or virtual and this allows me to apply queries accordingly e.g. all virtual machines, all VMWare v Hyper-V etc. How do i get the same on a Linux resource? We currently collect data via SNMP from our Linux resources. Is there an OID i can look for or something similar?

tia

  • Anonymous's avatar
    Anonymous

    There are a couple methods that could probably work on most every Linux distro. Neither work via SNMP as far as I'm aware, without some additional modification. Luckily, it wouldn't take much to create a PropertySource that can determine this and set a custom property. The PropertySource would use SSH. I whipped this together this morning. Give it a shot. It sets a property called "auto.chassis". It'll be "vm" for a virtual linux machine. It'll be "desktop" or something else for a non-virtual machine.