There is probably a very simply solution for this, but I am extremely new to writing Perl. I want to pull the VMWare Tools status as part of a larger script that pulls info for each VM in our datacenter. Here's the code i have right now:
my $tools = $vm_view->guest->toolsStatus;
if (defined $tools) {
print "VMWare Tools Status: " . $tools . "\n";
}
This pulls info about VMWare Tools, but it returns something like this : "VMWare Tools Status: VirtualMachineToolsStatus=HASH(0x6fef2bc)"
How can I simply pull the status (toolsNotInstalled, toolsNotRunning, toolsOK, toolsOld)?
Thanks,
Jaime
Hi Jaime,
You simply need to use the below syntax to get the values for any Enum Constants.
my $tools = $vm_view->guest->toolsStatus->val;
Hope this helps.
~ Sidharth
Hi Jaime,
You simply need to use the below syntax to get the values for any Enum Constants.
my $tools = $vm_view->guest->toolsStatus->val;
Hope this helps.
~ Sidharth
Sidharth,
Thanks, that's exactly what I needed. I knew it had to be something simple.
Jaime