Bulk unmanage topology instances or class objects
search cancel

Bulk unmanage topology instances or class objects

book

Article ID: 331602

calendar_today

Updated On: 01-02-2025

Products

VMware Smart Assurance VMware Telco Cloud Service Assurance

Issue/Introduction

Updating multiple topology instances or class objects n the IP domain

Environment

Smarts 10.x
TCSA 2.x

Resolution

To bulk manage and unmanage in IP, you must use Adapter Scripting Language (ASL) script. There are two ways of doing this (automatic and manual/on-demand) using a custom ASL script as defined in the following sections.

Automatic post-processing
You can have the IP domain do it automatically by using custom post-processing ASL script during discovery. This can be done as follows:

  1. Open the custom-end-post.asl script using sm_edit:
    IP/smarts/bin/sm_edit rules/discovery/custom-end-post.asl
     
  2. Modify the script to make your customization under the following location:
    /*    
     * Add processing rules here.
    */
    --<your code here >--   

Manual/on-demand ASL script
You can create a standalone ASL file and invoke anytime the script with the following:

<BASEDIR>/sm_adapter -s <domain> <path>/<asl filename>

 

Your code should loop through the foreach command and look for the class name you want to make the change.  

foreach <instance> (getInstances("<class name>")) { .. }

 

The following is an ASL script code example of unmanaging an interface that belongs to a Router (Vendor=Cisco, Model=2811, FastEthernet):

foreach int (getInstances("Interface")) {
    intObj = object(int);
    if ( !intObj->isNull() && intObj->SystemType == "ROUTER" && intObj->SystemVendor == "CISCO") {
    // Unmanage certain Interfaces of Cisco Model 2811           
    if (intObj->SystemModel == "2811" && glob("FastEthernet*", intObj->Description)) {
        if (debug) {
            print("Manage (2811): ".intObj->DisplayName);
        }
        intObj->unmanage();
     }     
}