NAME

hostinfo.pl - Display the Processor, Network and Memory attributes of the hosts.


SYNOPSIS

 hostinfo.pl [options]


DESCRIPTION

This VI Perl command-line utility provides a query tool that lists various hosts and attributes for a host or set of hosts.


OPTIONS

GENERAL OPTIONS

datacenter

Optional. Name of the datacenter. When datacenter is specified, the hosts will be searched in this specified datacenter also.

fileoutput

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.

folder

Optional. Name of a folder. When folder is specified, only hosts in the specified folder are listed.

maintenancemode

Optional. Filters host based on maintenancemode. The flag to indicate whether or not the host is in maintenance mode.

vmotion

Optional. Filters host based on VMotion enabled or disabled. The flag to indicate whether or not VMotion is enabled on this host.

FIELDS OPTIONS

hostname

Optional. Display property hostname.

portnumber

Optional. Display property portnumber. It lists the port number.

boottime

Optional. Display property bootTime. BootTime displays the time when the host was booted in dateTime format.

cpumodel

Optional Display property cpumodel. It provides the cpu model identification.

cpuspeed

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.

cpuusage

Optional. Display property cpuusage. It specifies the aggregated CPU usage across all cores on the host in MHz.

filesystem

Optional. Display property filesystem. It describes the file system volume information for the host, listing the supported file system volume types.

host_status

Optional. Display property host_status. It gives the overall alarm status of the host.

maintenancemode

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.

memorysize

Optional. Display property memorysize. It provides the physical memory size in bytes.

memoryusage

Optional. Display property memoryusage. It gives the physical memory usage on the host in MB.

networkadapters

Optional. Display property networkadapters. It gives the number of network adapters.

rebootrequired

Optional. Display property reebootrequired. Indicates whether or not the host requires a reboot due to a configuration change.

software

Optional. Display property software. It gives the complete product name, including the version information

vmotion

Optional. Display property vmotion. It indicates whether VMotion is enabled or disabled for the host.


EXAMPLES

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


SUPPORTED PLATFORMS

This script works with VMware VirtualCenter 2.0 or later.

This script works with VMware ESX Server 3.0 or later.