Developing Javascript Actions - Novell SENTINEL RAPID DEPLOYMENT 6.1 - 12-2009 User Manual

Table of Contents

Advertisement

15.3.5 Developing JavaScript Actions

The information below is very basic development information about developing JavaScript actions.
For more information, see
wiki/index.php?title=Develop_to_Sentinel).
"Creating a JavaScript Action" on page 356
"Debugging JavaScript Actions" on page 357
Creating a JavaScript Action
JavaScript actions take advantage of the functionality and flexibility of the JavaScript language and
can be used to execute actions using Sentinel system methods to do things such as:
Start/stop the Collectors
Add/remove from dynamic lists
Get a current event
Get a correlated event
Get a correlation event collection
Get an incident
Execute actions by using Integrators
The code sample below starts or stops a Collector based on the information in the correlated event.
importPackage(java.lang);
var CollectorName = "TC_5";
var evt = scriptEnv.getCurrentEvent();
var collNm = evt.getPort();
var outfile = new java.io.PrintWriter(new java.io.FileWriter("/opt/jaya/
strtcoll.txt", true));
if(collNm && collNm.equals(CollectorName))
{
var collist = ESM.collectorsForName(collNm);
if (collist.size() > 0)
{
var coll = collist.get(0);
outfile.println("Stopping " + CollectorName);
coll.stop();
Thread.sleep(60000);
outfile.println("starting " +CollectorName);
coll.start();
}
}
else
{
outfile.println("JSTest collector does not exist");
}
outfile.close();
356 Sentinel 6.1 Rapid Deployment User Guide
Novell Developer Community web site (http://developer.novell.com/

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sentinel rapid deployment 6.1

Table of Contents