This question already has an answer here:
I have a monitor that is running on all guests, Windows and Linux. I'd like to send back the Parent host of the guest with this monitor, How can I found out the VM host from within a ESXi VM?
Ideally I'm looking for a universal way to do this from both Windows and Linux, but if they are separate paths that okay. Using something from VMWare tools would be fine, but I'm not currently using anything running the vSphere API.