Novell Operations Center ( NOC)- Controlling Adapters from a Formula Script

Novell Operations Center (NOC)

Controlling Adapters from a Formula Script

In Novell Operations Center (NOC) connections to outside data sources are made through Adapters.  It might be that the customer would like to have a backup Adapter to a given data source but not want to buy a license for more than one Adapter of a given type.  There is a way to solve this issue.  Since an Adapter can be defined (and NOT started) even if no license exists, it is possible to define the second Adapter, configure it as Stopped and then using a Formula Script (really just Java Script with additional functions) control when the second Adapter will start.

Below is a small Formula Script that shows how to access the NOC Adapter list and either stop or start an Adapter:

var adapters = formula.server.adapters();
for( var i=0;i<adapters.length;i++) {
var AdapterName = new java.lang.String(adapters[i].key());
adapterStatus = adapters[i].manageStatus();
if( adapterStatus == “stopped” ) {
adapters[i].manageStart();
formula.log.info(“……Adapter Name: ” + AdapterName + ” Started”);
} else {
adapters[i].manageStop();
formula.log.info(“……Adapter Name: ” + AdapterName + ” Stopped”);
}
//
//  Found the Backup Netcool Adapter – So Start it
//
if (AdapterName.indexOf(“Netcool Backup”) > 0)
adapters[i].manageStart();
}

 

Questions, comments or concerns? Feel free to reach out to us below or at IDMWORKS