6.1 Creating Alarms

Create an alarm for some of the supported adapters by using the createAlarm() method. Alarms are associated with a specific integration (adapter) and the properties vary according to the adapter. After getting a reference to the adapter from any element generated by the adapter under the Elements hierarchy, use this method to create an alarm against the adapter. The format is:

adapter.createAlarm( "Formula", Flds, Vals, null );

Where,

  • Formula: The class of the alarm.

  • Flds: An array of alarm fields.

  • Vals: An array that matches Flds and contains the alarm values.

  • null: The last parameter is always null.

For example:

var mgrElement =
formula.Root.findElement("script=Adapter%3A+NOC+-+Universal+Adapter/root=Elements");

var adapter = mgrElement.adapter;

formula.log.info("Adapter: " + adapter);
var fields = ["Summary","Class","Severity"];
var Vals = ["AlarmStorm detected for Class EMOS", "EMOS","Critical"];
adapter.createAlarm( "EMOS", fields, Vals, null );