4.19 Inventory

Use this Knowledge Script to monitor if hosts and virtual machines are added, moved, or removed from vCenter, track configuration changes to hosts and virtual machines in vCenter, and monitor virtual machines that migrate to different hosts or move to different datastores, resource pools, or virtual appliances.

If an inventory change occurs, you can set the script to run a discovery, which allows the AppManager console to display the most current inventory of virtual machines and hosts in vCenter.

The Inventory script monitors changes in hosts, virtual machines, and container objects such as clusters, folders, datacenters, resource pools, and virtual applications (vApps). To ensure that the module updates objects such as datastores and datastore clusters that are not monitored by the Inventory script in the TreeView, schedule the Discovery_VirtualCenter Knowledge Script to run on a daily basis instead of just once. Running the Inventory script in conjunction with the Discovery_VirtualCenter script set to run daily ensures that the TreeView remains current.

If you are using AppManager 7.x and want to enable the inventory discovery options, use the VirtualMachineInventory Knowledge Script instead of this script. Because of the asynchronous nature of the VirtualCenter_Inventory script, an Inventory discovery could potentially run every time the script detects that a batch of changes have occurred on a host or virtual machine, which may result in inaccurate monitoring data for an environment that is frequently updated.

With AppManager 7.x, use the VirtualMachineInventory job to control the discovery options, and let the Inventory job handle event generation:

  • For the Inventory script, set the Perform a discovery operation if... parameters to No, and set the Raise event if... parameters to Yes as needed.

  • For the VirtualMachineInventory script, set the Raise event when virtual machines... parameters to No, and set the Rediscover if virtual machines... parameters to Yes as needed.

NOTE:

  • The VirtualCenter_Inventory Knowledge Script is supported on vCenter 4.0 or later.

  • The first time you run this script, you might experience a short delay as the script gathers inventory data for the job. Subsequent jobs will start more quickly after the first VirtualCenter_Inventory job finishes its initial configuration.

  • If you restart vCenter or the vCenter service while you are running the VirtualCenter_Inventory script with one or more of its discovery parameters selected, such as Perform a discovery operation if a host is added?, the VirtualCenter_Inventory discovery process will fail.

  • If you are running a VirtualCenter_Inventory job that has discovery enabled, the script might miss some inventory changes because the Inventory job was restarted. Changes will be lost because the cache was cleared. In this situation, after the job restarts, monitoring takes a few minutes to start again. To monitor new changes in the TreeView, use this script as a monitoring policy.

This script monitors host and virtual machine objects, as well as their child objects.

This script monitors the following host details:

  1. The model, such as PowerEdge R710

  2. The vendor, such as Dell

  3. The product name, such as VMware ESXi

  4. The product version, such as 5.0.0

  5. The product build, such as 469512

  6. Whether vMotion is enabled or disabled

  7. The number of CPUs or CPU cores

  8. The total speed of the host, in MHz

  9. The number and size of all physical disks

  10. The configured memory, in MB

  11. The number of physical network interface cards, or NICs, including their MAC addresses and drivers

This script monitors the following virtual machine details:

  1. Guest operating system name, such as Microsoft Windows 2003 Server (32-bit)

  2. Location of the VM files on the datastore

  3. Whether or not the VM is a template

  4. The number of vCPUs

  5. The configured memory, in MB

  6. The number, name, size, and type of all vDisks

  7. The number, name, and MAC address of all vNICs

4.19.1 Resource Objects

  • vCenter servers

  • Hosts

  • Virtual machines

4.19.2 Default Schedule

The default interval for this script is Asynchronous. After you start the Knowledge Script, its job status appears as Running.

4.19.3 Setting Parameter Values

Set the following parameters as needed:

Parameter

How to Set It

General Settings

Job Failure Notification

Event severity when AppManager failed to log in

Set the event severity level, from 1 to 40, to indicate the importance of an event in which AppManager failed to log in to vCenter. The default is 5.

Event severity when Inventory job fails unexpectedly

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the Inventory job fails unexpectedly. The default is 5.

Event severity when filter settings contain conflicts

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the filter settings contain conflicts. The default is 15.

Event severity when Inventory job has delayed start

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the Inventory job experiences a delayed start. The default is 25.

Additional Settings

Raise event if changed object was already removed from vCenter?

Select Yes to raise an event if a changed object was already removed from vCenter. The default is unselected.

Event Details

Event detail format

Select either HTML Table or Plain Text as the format for event detail. The default is HTML Table.

Discovery Options

Important If you are using this module with AppManager 7.x, the following Perform a discovery operation if... parameters should remain unselected. Use the VirtualMachineInventory script to enable discovery options with AppManager 7.x.

Host Options

Perform a discovery operation if a host is added?

Select Yes to run a discovery operation to update the inventory whenever a host is added to vCenter. The default is unselected.

Perform a discovery operation if a host is removed?

Select Yes to run a discovery operation to update the inventory whenever a host is removed from vCenter. The default is unselected.

Perform a discovery operation if host details are changed?

Select Yes to run a discovery operation to update the inventory whenever the details for a host are changed in vCenter. The default is unselected.

Perform a discovery operation if a host is moved?

Select Yes to run a discovery operation to update the inventory whenever a host is moved in vCenter. The default is unselected.

Virtual Machine Options

Perform a discovery operation if a virtual machine is added?

Select Yes to run a discovery operation to update the inventory whenever a virtual machine is added to vCenter. The default is unselected.

Perform a discovery operation if a virtual machine is removed?

Select Yes to run a discovery operation to update the inventory whenever a virtual machine is removed from vCenter. The default is unselected.

Perform a discovery operation if a virtual machine is renamed?

Select Yes to run a discovery operation to update the inventory whenever a virtual machine is renamed in vCenter. The default is unselected.

Perform a discovery operation if a virtual machine is migrated?

Select Yes to run a discovery operation to update the inventory whenever a virtual machine is migrated in vCenter. The default is unselected.

Perform a discovery operation if a virtual machine is moved?

Select Yes to run a discovery operation to update the inventory whenever a virtual machine is moved in vCenter. The default is unselected.

Perform a discovery operation if virtual machine details are changed?

Select Yes to run a discovery operation to update the inventory whenever the details for a virtual machine, such as increasing memory for a virtual machine, are changed in vCenter. The default is unselected.

Raise event if Discovery succeeds?

Select Yes to raise an event if the discovery operation launched by the Inventory job succeeds. The default is Yes.

Event severity if Discovery succeeds

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the discovery operation launched by the Inventory job succeeds. The default is 25.

Raise event if Discovery fails?

Select Yes to raise an event if the discovery operation launched by the Inventory job fails. The default is Yes.

Event severity if Discovery fails

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the discovery operation launched by the Inventory job succeeds. The default is 5.

Monitor Hosts

Event Notification

Important If you are using this module with AppManager 7.x and you want to monitor events, use the following event parameters instead of the event parameters in the VirtualMachineInventory script.

Raise event if host is added?

Select Yes to raise an event when a host is added. The default is Yes.

NOTE:This script raises an event whenever a host is added, ignoring the options you selected on the Objects tab. In addition, filters do not apply to added hosts.

Event severity when host is added

Set the event severity level, from 1 to 40, to indicate the importance of an event in which a host is added. The default is 25.

Raise event if host is removed?

Select Yes to raise an event when a host is removed from vCenter. The default is Yes.

Event severity when host is removed

Set the event severity level, from 1 to 40, to indicate the importance of an event in which a host is removed from vCenter. The default is 15.

Raise event if host is moved?

Select Yes to raise an event when a host is moved in vCenter. The default is Yes.

Event severity when host is moved

Set the event severity level, from 1 to 40, to indicate the importance of an event in which a host is moved in vCenter. The default is 25.

Raise event if host details change?

Select Yes to raise an event when the details for a host are changed in vCenter. The default is Yes.

Event severity when host details change

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the details for a host are changed in vCenter. The default is 25.

Monitor Virtual Machines

Event Notification

Important If you are using this module with AppManager 7.x and you want to monitor events, use the following event parameters instead of the event parameters in the VirtualMachineInventory script.

Raise event if virtual machine is added?

Select Yes to raise an event when a virtual machine is added in vCenter. The default is Yes.

NOTE:This script raises an event whenever a virtual machine is added, ignoring the options you selected on the Objects tab. In addition, filters do not apply to added virtual machines.

Event severity when virtual machine is added

Set the event severity level, from 1 to 40, to indicate the importance of an event in which a virtual machine is added in vCenter. The default is 25.

Raise event if virtual machine is removed?

Select Yes to raise an event when a virtual machine is removed from vCenter. The default is Yes.

Event severity when virtual machine is removed

Set the event severity level, from 1 to 40, to indicate the importance of an event in which a virtual machine is removed from vCenter. The default is 15.

Raise event if virtual machine is renamed?

Select Yes to raise an event when a virtual machine is renamed. The default is Yes.

Event severity when virtual machine is renamed

Set the event severity level, from 1 to 40, to indicate the importance of an event in which a virtual machine is renamed. The default is 25.

Raise event if virtual machine is moved?

Select Yes to raise an event when a virtual machine is moved in vCenter. The default is Yes.

Event severity when virtual machine is moved

Set the event severity level, from 1 to 40, to indicate the importance of an event in which a virtual machine is moved in vCenter. The default is 25.

Raise event if virtual machine is migrated?

Select Yes to raise an event when a virtual machine is migrated in vCenter. The default is Yes.

Event severity when virtual machine is migrated

Set the event severity level, from 1 to 40, to indicate the importance of an event in which a virtual machine is migrated in vCenter. The default is 25.

Raise event if virtual machine details change?

Select Yes to raise an event when virtual machine details change. The default is Yes.

Event severity when virtual machine details change

Set the event severity level, from 1 to 40, to indicate the importance of an event in which virtual machine details change. The default is 25.