As I am now managing a large VMWare infrastructure, been doing a lot of scripts .. here is one for anyone who wishes to use it
some script I have knocked up to audit a esx or esxi hosts to see what virtual machine is running
tested on 3.x and 4.x not on 5.x
you will need to install the vmware vsphere cli in order to run the script
run via command line
auditvm.pl --server <esxi/esx server> --username <username> --password <password> --entity VirtualMachine
will print out info esx/esxi host and what virtual machine is on it and if it is on or off
the results is written to a fiile audit.txt
Example of output
source code http://pastebin.com/riLqgjqC
some script I have knocked up to audit a esx or esxi hosts to see what virtual machine is running
tested on 3.x and 4.x not on 5.x
you will need to install the vmware vsphere cli in order to run the script
run via command line
auditvm.pl --server <esxi/esx server> --username <username> --password <password> --entity VirtualMachine
will print out info esx/esxi host and what virtual machine is on it and if it is on or off
the results is written to a fiile audit.txt
Example of output
VM Server Host Name: xxxxxxxxxxxxxxxxxxxxxxxxx
Server Product Name: VMware ESXi
ESX Version: 4.1.0
ESX Build: 260247
Server Type: embeddedEsx
Virtual Machine Summary
-------------------------------------------------
yyyyy is OFF.
zzzzz is ON
-------------------------------------------------
source code http://pastebin.com/riLqgjqC
Last edited: