Smarts IP: Can you use DMCTL to create a new polling group or add criteria to existing and new polling groups?
search cancel

Smarts IP: Can you use DMCTL to create a new polling group or add criteria to existing and new polling groups?

book

Article ID: 327725

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:


Can you create a new polling group in Smarts IP using DMCTL?
Can you use Smarts DMCTL to add criteria to existing and new polling groups?



Environment

VMware Smart Assurance - SMARTS

Resolution

No, you cannot do these tasks using DMCTL. However, you can use a Smarts Adapter Scripting Language (ASL) script to achieve this functionality. The ASL code at the end of this Fix statement allows you to do the following:

  1. Create a new polling group called TEST.
  2. Create an instance of Connectivity Poller - External Poller for TEST.
  3. Adds a criteria that all switches starting with JMC are added to the group as members

IMPORTANT! This code is provided as is, and is not GA code that can be used as a template to modify polling groups.

Using the ASL code
To use the ASL code in the following section, use Smarts sm_edit and copy the code into a new file called ic-create-polling-group.asl. This file can then be saved to any location and run with the command:

./sm_adapter -b <broker> -s <server> ic-create-polling-group.asl

ASL code

/* J+ */
/* ic-create-polling-group.asl
 *
 * Copyright 1998-2006 by EMC Corporation ("EMC").
 * All rights reserved.
 *
 * UNPUBLISHED CONFIDENTIAL AND PROPRIETARY PROPERTY OF EMC.  The copyright
 * notice above does not evidence any actual or intended publication of this
 * software.  Disclosure and dissemination are pursuant to separate
 * agreements. Unauthorized use, distribution or dissemination are strictly
 * prohibited.
 * To Run the script
 * ./sm_adapter -b <broker> -s <server> ic-create-polling-group.asl
 */


pollingGroup = object("SelectiveConfiguration","CFG-Polling Groups");
START {
}
do {
 
 /* Create new polling group Object */

  newPollingGroupObj = pollingGroup->makeConfiguration("TEST") ? IGNORE;
  searchpattern = "ICF_ConfigurationSelector::S-CFG-Polling Groups/TEST";
   foreach icfConfSelName (pollingGroup->Selects) {
   icfConfSelObj = object(icfConfSelName);
   configpattern = "CFG-Polling Groups/TEST";
   configClass = object("Configuration", configpattern);
  
     if (glob(searchpattern,icfConfSelName)) {
           provSettingName = "SET-CFG-Polling Groups/TEST/Connectivity_ExternalPolling_Setting";
 
 /* Create Connectivity External Polling Setting for TEST Polling Group */

           provSettingObj = create("Connectivity_ExternalPolling_Setting", provSettingName);
           configClass->ComposedOf += provSettingObj;
           criter = icfConfSelObj->criteria;
                icfConfSelObj->criteria = list();
                subcriteria  =  list("Model", "JMC");
                icfConfSelObj->criteria += subcriteria;
                subcriteria2 =  list("Type", "SWITCH");
         icfConfSelObj->criteria += subcriteria2;

 /* To ADD more criteria , create list like above and attach the list to icfConfSelObj->criteria */

                icfConfSelObj->Priority = 0;
       stop();  
     }
   }
}