As an example of using a common ASL script for Network Protocol Manager for BGP, you could use the custom-end-post.asl script to create BGP Route Reflector (RR) system redundancy groups after the initial discovery completes. Currently, SystemRedundancyGroup objects cannot automatically be discovered and instantiated by Network Protocol Manager.

Examples of adding code to the custom-end-system.asl and custom-end-post.asl scripts to create an RR SystemRedundancyGroup object are given in Figure 10 on page 49 and Figure 12 on page 51. The ASL code in Figure 10 on page 49 directs Network Protocol Manager to assign an RR role to each discovered Juniper device that is running a BGP service. The ASL code in Figure 12 on page 51 directs Network Protocol Manager to:

  1. Create an instance of the SystemRedundancyGroup class.

  2. Insert the RR routers participating in the redundancy group into the ComposedOf relationship of the redundancy group.

    /*
    .
    .
    .
     * RCS $Id: custom-end-system.asl,v 1.3.6.1 2007/02/22 20:14:44 bail Exp $
     *
     * This asl file is used at the end of probing of each device.
     */
    default AgentName  = "";
    default debug = FALSE;
    default detailDebug = FALSE;
    default objectName = "";
    default elementName = "";
    default elementType = "";
    default changed = "FALSE";
    default result = "FAIL";
    default discoveryError = "";
    agentObj = object(elementName);
    objectName = elementName;
    if (agentObj->isNull()) {
        stop();
    }
    nodeObj = agentObj->getSystem();
    if (nodeObj->isNull()) {
        stop();
    }
    factory = object(getInstances("ICIM_ObjectFactory")[0]);
    topo_manager = object(getInstances("ICF_TopologyManager")[0]);
    default DEBUG = FALSE;
    me = this->ReadsRulesFrom->fileName.": ";
    blanks = "    ";
    /*
     * Add additional initialization here.
     */ 
    /*
     * Add convenience patterns here.
     */
    /*****************************************************************************/
    START {
        /*
         * Add Parsing rules here.
         */
        .. eol
    } do {
        /*
         * Add processing rules here.
         */
        if (DEBUG) {
            print("Executing rule set ".me);
        }
        changed = "TRUE"; 
        result = "SUCCESS"; 
        objectName = elementName;
        if (nodeObj->Vendor == "JUNIPER") {
            Srvc = nodeObj->HostsServices;
            foreach svc (Srvc) {
                if (svc->isInstanceOf("BGPService")) {
             bgpeps = svc->AccessedVia;
      bgpep = bgpeps[0];
      if (sizeof(bgpep) == 0) {
          return;
      }
                    bgpep->IsRouteReflector = TRUE ;
                }
            }
       }
    }
    /*
     * Addition EOF or DEFAULT here if necessary.
     */
    /**********************************************************/
    /*
     * Local Variables:
     * mode: C++
     * End:
     */
    /*
    .
    .
    .
     * RCS $Id: custom-end-post.asl,v 1.3 2005/05/27 18:43:37 sv1 Exp $
     *
     * This asl file is used at the end of discovery post processing.
     */
    factory = object(getInstances("ICIM_ObjectFactory")[0]);
    topo_manager = object(getInstances("ICF_TopologyManager")[0]);
    default DEBUG = FALSE;
    me = this->ReadsRulesFrom->fileName.": ";
    blanks = "    ";
    /*
     * Add additional initialization here.
     */ 
    /*
     * Add convenience patterns here.
     */
    /*****************************************************************************/
    START {
        .. eol
    } do {
        /*
         * Add processing rules here.
         */
        if (DEBUG) {
            print("Executing rule set ".me);
        }
        SRG = create("SystemRedundancyGroup","BGP-RR-Group");
        foreach bgpSys (getInstances("BGPService")) {
     bgpSys = object(bgpSys);
     if (bgpSys->IsRouteReflector == TRUE) {
         SRG->ComposedOf += bgpSys->HostedBy;
     }
        }
    }
    /*
     * Addition EOF or DEFAULT here if necessary.
     */
    /**********************************************************/
    /*
     * Local Variables:
     * mode: C++
     * End:
     */
    

    Analysis and monitoring of the RR system redundancy group occur automatically when the redundancy group is created and its RR members are inserted into the group. The state of the redundancy group is based on the status of its RR members.