Smarts IP Suite: How to set EXPLICITLY_MANAGED for numerous devices with same vendor and type.
search cancel

Smarts IP Suite: How to set EXPLICITLY_MANAGED for numerous devices with same vendor and type.

book

Article ID: 303978

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:


Smarts IP Suite: How to set EXPLICITLY_MANAGED for numerous devices with same vendor and type.
How do I use a script to set the ports' managed status for a large number of devices instead of doing it manually?


Ports' status is UNKNOWN after discovery
User scenario:
  • By default, ports are in unmanaged state.
  • Upon discovery, ports' status is UNKNOWN for a large set of devices.
  • User manually sets the ports as EXPLICITLY_MANAGED and hits Reconfigure.
  • After Rediscovering the device, the ports are now UP/UP.

How can a user do it for all of these device type (same vendor)?



Environment

VMware Smart Assurance - SMARTS

Resolution

  1. Create a file called managePorts.asl.
     
  2. Copy the below content to it.

    NOTE: The below script is an example for a device with system OID .1.3.6.1.4.1.9.1.958. Change the system OID to your requirement.

    START {
    }
    do {
     devicelist = getInstances("UnitaryComputerSystem");
     count = 0;
     print("Explicitly Managing all ports corresponding to System Object OID .1.3.6.1.4.1.9.1.958");
     foreach device (devicelist) {
      devRef = object(device);
      if (glob(devRef->SystemObjectID,".1.3.6.1.4.1.9.1.958")) {
       portList = devRef->getPorts();
       foreach portObj (portList) {
        portObj = object(portObj);
        portObj->ManagedState = "EXPLICITLY_MANAGED";
       }
      }
     }
     stop();
    }

  3. Save the file in your IP/smarts/bin directory and execute it as given in the following step.
     
  4. Execute this script from your <BASE DIR>/IP/smarts/bin by giving the command:

    sm_adapter -s <am-pm-domain_name> managePorts.asl