5.22.8.3 Customizing Threshold Event generation

 


  1. Threshold event generation - Default mechanism

  2. Customization


 

Default mechanism

 

The default way in which Threshold events are generated and handled by Performance module is listed below:

  1. Collected data is constantly monitored and associated thresholds evaluated every time data is collected for a PolledData.

  2. When the collected value violates the Threshold rule, a Threshold event is generated.

  3. The Threshold event is generated by GenerateEvent class. This event is then stored in Event database.

  4. Then onwards this event is taken care of by the Fault module.

Note: The class GenerateEvent has implemented the interface PollToFaultIfc and defined the functionality for the method genInputEvent () . In this method, the event object is constructed and stored in Event database, according to the default mechanism.

 

PollToFaultIfc interface acts as a medium of communication between Performance module and Fault module. Whenever a threshold rule is violated, genInputEvent() method of the implementation class is called which in turn handles event generation.

 

Find below the default implementation code:

 

class GenerateEvent implements PollToFaultIfc

{

...

...

 

public void genInputEvent(int sev, String msg, String agent, String oid, String category, String instance)

{

if (SeverityInfo.getInstance().contains(sev))

{

InputEvent inp=new InputEvent(category,

msg,com.adventnet.nms.eventui.Devent.severityStr(sev,agent

+"."+oid+instance,agent,agent);

}

try {

eventapi.addEvent(inp);

}

catch(Exception e)

{

NmsClientUtil.err(NmsClientUtil.GetString("Unable to add an event"));

}

}

}

 

Customization

 

You can customize the default way of threshold generation and handling when you have requirements as follows:

  1. You want to send a mail to the Network Administrator when a Threshold event is generated.

  2. You want to stop data collection for the ManagedObject when threshold rule is violated.

  3. You want to execute Policies.

  4. You want to generate report on threshold rule violation, etc.

To customize,

  1. Write a class implementing the interface PollToFaultIfc.

  2. Define the functionality for the method genInputEvent() inside your class.

  3. Specify your class name in nmsinterfaces.conf file available under <Web NMS Home>/conf directory, as follows:

<NMS_INTERFACES_CONF>

 

<INTERFACES pollToFault = "com.adventnet.nms.poll.myclass" >

 

</NMS_INTERFACES_CONF>



Copyright © 2011, ZOHO Corp. All Rights Reserved.