Closed dominikduennebacke closed 5 years ago
No. Checked it but it doesn't make so much sense to most people but it makes a lot of work. Information about which machines are running on a ESX host is a host object. Information about the tools is a check belonging to the virtual machine. Different object in API. To fulfill your request I have to
I am trying to get a list of all VMs in my data center that have an alert (red) or warning (yellow) status. Basically this would require the script to check for the status attribute (Normal, Warning, Alert) of a VM which it currently only does when querying a VM directly by providing the name parameter (VM status = Overall status in output):
./check_vmware_esx.pl -f /etc/vsphere-auth -D vcenter.domain.tld --name vmname1 -S runtime --timeout 60
Since I want to avoid querying all my VMs one-by-one, ideally the data center or ESX host query should provide the status attribute. Querying the VMs of a data center with listvms parameter currently only considers the state attribute (Powered on, Powered Off, Suspended):
./check_vmware_esx.pl -f /etc/vsphere-auth -D vcenter.domain.tld -S runtime -s listvms --timeout 60
So perhaps there could be listvmsdetail parameter which provides detailed information about all VMs such as state, status and tools. Along with that there could be multiple subselect such as