Smarts IP: How use ASL to list the Managed State of all objects of a given Class in Smarts IP
search cancel

Smarts IP: How use ASL to list the Managed State of all objects of a given Class in Smarts IP

book

Article ID: 303854

calendar_today

Updated On:

Products

VMware

Environment

VMware Smart Assurance - SMARTS

Resolution

How use ASL to list the Managed State of all objects of a given Class in Smarts IP



To list the Managed State of all objects of a given Class in Smarts IP using ASL, do the following:

  1. Create a file that contains the following ASL script:

    Note: The Interface class specified in the following script can be replaced with any valid class.  See the Smarts ICIM_v15_infra_chart.pdf for classes that can be queried:

    START {}
    do {
            list = getInstances("Interface");
            print(list);
                            foreach obj (list) {
                                            objRef = object(obj);
                                            manstate = (objRef->IsManaged);
                                    print("Object ".obj. " isManaged=" .manstate);
                                                                    }
                    stop();
    }


     
  2. Copy the ASL script file to the following directory:

    <BASEDIR>/IP/smarts/local/rules/utils

     
  3. Run the following command against the domain required, specifying the ASL script file created as in the following example:

    <BASEDIR>/IP/smarts/bin/sm_adapter -s <DOMAIN> utils/file.asl

  4. The output of this ASL script should display as follows:

    Object IF-11.1.1.1/33 isManaged=TRUE
    Object IF-192.168.5.51/192.168.5.51 isManaged=TRUE
    Object IF-11.1.1.12/11 isManaged=TRUE
    Object IF-11.1.1.70/100010 isManaged=FALSE