Threshold event generation - Default mechanism
The default way in which Threshold events are generated and handled by Performance module is listed below:
Collected data is constantly monitored and associated thresholds evaluated every time data is collected for a PolledData.
When the collected value violates the Threshold rule, a Threshold event is generated.
The Threshold event is generated by GenerateEvent class. This event is then stored in Event database.
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)
InputEvent inp=new InputEvent(category,
NmsClientUtil.err(NmsClientUtil.GetString("Unable to add an event"));
You can customize the default way of threshold generation and handling when you have requirements as follows:
You want to send a mail to the Network Administrator when a Threshold event is generated.
You want to stop data collection for the ManagedObject when threshold rule is violated.
You want to execute Policies.
You want to generate report on threshold rule violation, etc.
Write a class implementing the interface PollToFaultIfc.
Define the functionality for the method genInputEvent() inside your class.
Specify your class name in nmsinterfaces.conf file available under <Web NMS Home>/conf directory, as follows:
<INTERFACES pollToFault = "com.adventnet.nms.poll.myclass" >