hostinfo.pl - Display the Processor, Network and Memory attributes of the hosts.
hostinfo.pl [options]
This VI Perl command-line utility provides a query tool that lists various hosts and attributes for a host or set of hosts.
Optional. Name of the datacenter. When datacenter is specified, the hosts will be searched in this specified datacenter also.
Optional. An xml filename or path of an xml filename to which the output will be written to. If fileoutput not used, the output will be displayed.
Optional. Name of a folder. When folder is specified, only hosts in the specified folder are listed.
Optional. Filters host based on maintenancemode. The flag to indicate whether or not the host is in maintenance mode.
Optional. Filters host based on VMotion enabled or disabled. The flag to indicate whether or not VMotion is enabled on this host.
Optional. Display property hostname.
Optional. Display property portnumber. It lists the port number.
Optional. Display property bootTime. BootTime displays the time when the host was booted in dateTime format.
Optional Display property cpumodel. It provides the cpu model identification.
Optional. Display property cpuspeed. The product of the speed of cpu cores and number of processors contained by a CPU package is approximately equal to the sum of the MHz for all the individual cores on the host. This product forms the cpuspeed.
Optional. Display property cpuusage. It specifies the aggregated CPU usage across all cores on the host in MHz.
Optional. Display property filesystem. It describes the file system volume information for the host, listing the supported file system volume types.
Optional. Display property host_status. It gives the overall alarm status of the host.
Optional. Display property maintenancemode. It indicates whether or not the host is in maintenance mode. It is set when the host has entered the maintenance mode.
Optional. Display property memorysize. It provides the physical memory size in bytes.
Optional. Display property memoryusage. It gives the physical memory usage on the host in MB.
Optional. Display property networkadapters. It gives the number of network adapters.
Optional. Display property reebootrequired. Indicates whether or not the host requires a reboot due to a configuration change.
Optional. Display property software. It gives the complete product name, including the version information
Optional. Display property vmotion. It indicates whether VMotion is enabled or disabled for the host.
List all hosts and all properties of the hosts that are part of ha datacenter.
hostinfo.pl --username administrator --password mypassword
--url https://<ipaddress>:<port>/sdk/webService
--datacenter ha
List all hosts that are part of ha datacenter and selected properties of the hosts, as specified in the fields
hostinfo.pl --username administrator --password mypassword
--url https://<ipaddress>:<port>/sdk/webService
--fields hostname,portnumber,boottime,cpumodel,cpuspeed,
cpuusage,filesystem,host_status,maintenancemode,
memorysize,memoryusage,networkadapters,
rebootrequired,software,vmotion
--datacenter ha
List all hosts and all the properties of the hosts. The results are displayed in the file mentioned in fileoutput.
hostinfo.pl --username administrator --password mypassword
--url https://<ipaddress>:<port>/sdk/webService
--fileoutput D:\Output\result.xml
Lists the properties of all the hosts having their maintenance mode and vmotion property as specified in maintenancemode and vmotion respectively.
hostinfo.pl --username administrator --password mypassword
--url https://<ipaddress>:<port>/sdk/webService --maintenancemode 0
--vmotion 1
Lists the properties of all the hosts part of the folder as specified in folder.
hostinfo.pl --username administrator --password mypassword
--url https://<ipaddress>:<port>/sdk/webService
--folder myfolder
This script works with VMware VirtualCenter 2.0 or later.
This script works with VMware ESX Server 3.0 or later.