|
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 |
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")); } } } |
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.
To customize,
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:
|
<NMS_INTERFACES_CONF>
<INTERFACES pollToFault = "com.adventnet.nms.poll.myclass" >
</NMS_INTERFACES_CONF> |
|