|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.eventd.EventExpander
This class is responsible for looking up the matching evenconf entry for an event and loading info from the eventconf match to the event. This class is also responsible for the event parm expansion
Notes on event parm expansion:
The list of elements that can have a %element% or %parms[*]% in their value are : descr, logmsg, operinstr, autoaction, operaction(/menu), tticket
The list of elements that can occur as a %element% are : uei, source, nodeid,
time, host, interface, snmphost, service, snmp, id, idtext, version,
specific, generic, community, severity, operinstr, mouseovertext,
parm[values-all], parm[names-all], parm[all], parm[
Expansions are made so that - %element% is replaced by the value of the element -i.e a 'xxx %uei%' would expand to 'xxx <eventuei>' - %parm[values-all]% is replaced by a space-separated list of all parm values -i.e a 'xxx %parm[values-all]%' would expand to 'xxx parmVal1 parmVal2 ..' - %parm[names-all]% is replaced by a space-separated list of all parm names -i.e a 'xxx %parm[names-all]%' would expand to 'xxx parmName1 parmName2 ..' - %parm[all]% is replaced by a space-separated list of all parmName="parmValue" -i.e a 'xxx %parm[all]%' would expand to 'xxx parmName1="parmVal1" parmName2="parmVal2" ..' - %parm[<name>]% is replaced by the value of the parameter named 'name', if present - %parm[#<num>]% is replaced by the value of the parameter number 'num', if present - %parm[##]% is replaced by the number of parameters
Field Summary | |
private static java.lang.String |
DEFAULT_EVENT_UEI
The default event UEI - if the event lookup into the 'event.conf' fails, the event is loaded with information from this default UEI |
private static java.lang.String |
DEFAULT_TRAP_UEI
The default trap UEI - if the trap lookup into the 'event.conf' fails, the trap event is loaded with information from this default UEI |
private static java.lang.String |
ENTERPRISE_PRE
The enterprise ID prefix - incoming events and the events in event.conf can have EIDs that have the partial EIDs as in '18.1.1.6' instead of '.1.3.6.1.4.1.18.1.1.6'. |
private static java.lang.String[] |
GENERIC_SNMP_UEIS
This is the list of Universal Event Identifiers (UEIs) that map to the generic types in a SNMPv1 trap. |
Constructor Summary | |
private |
EventExpander()
private constructor |
Method Summary | |
static void |
expandEvent(Event e)
This method is invoked to check and configure a received event. |
private static void |
expandParms(Autoaction[] autoactions,
Event event)
Expand parms in the event autoaction(s) |
private static void |
expandParms(Event event)
Expand the element values if they have parms in one of the following formats - %element% values are expanded to have the value of the element where 'element' is an element in the event DTD - %parm[values-all]% is expanded to a delimited list of all parmblock values - %parm[names-all]% is expanded to a list of all parm names - %parm[all]% is expanded to a full dump of all parmblocks - %parm[ |
private static void |
expandParms(Logmsg logmsg,
Event event)
Expand parms in the event logmsg |
private static void |
expandParms(Operaction[] operactions,
Event event)
Expand parms in the event operaction(s) |
private static void |
expandParms(Tticket tticket,
Event event)
Expand parms in the event tticket |
private static Event |
lookup(Event event)
This method is used to lookup the event configuration object based upon information in the passed information. |
private static Event |
lookup(Snmp snmpInfo)
This method is used to find the matching event configuration object by looking at the event's SNMP information. |
private static Autoacknowledge |
transform(Autoacknowledge src)
This method is used to transform an auto acknowledgement event configuration instance into an auto acknowledgement event instance. |
private static Autoaction |
transform(Autoaction src)
This method is used to transform an auto action event configuration instance into an auto action event instance. |
private static Correlation |
transform(Correlation src)
This method is used to transform a correlation event configuration instance into a correlation event instance. |
private static Forward |
transform(Forward src)
This method is used to transform a forward event configuration instance into a forward event instance. |
private static Logmsg |
transform(Logmsg src)
This method is used to transform a log message event configuration instance into a log message event instance. |
private static Mask |
transform(Mask src)
This method is used to transform an event configuration mask instance into an event mask instance. |
private static Operaction |
transform(Operaction src)
This method is used to transform an operator action event configuration instance into an operator action event instance. |
private static Script |
transform(Script src)
This method is used to transform a script event configuration instance into a script event instance. |
private static Snmp |
transform(Snmp src)
This method is used to transform an SNMP event configuration instance into an SNMP event instance. |
private static Tticket |
transform(Tticket src)
This method is used to transform a trouble ticket event configuration instance into a trouble ticket event instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String ENTERPRISE_PRE
private static final java.lang.String DEFAULT_EVENT_UEI
private static final java.lang.String DEFAULT_TRAP_UEI
private static final java.lang.String[] GENERIC_SNMP_UEIS
Constructor Detail |
private EventExpander()
Method Detail |
private static Mask transform(Mask src)
src
- The configuration source to transform.
private static Snmp transform(Snmp src)
src
- The configuration source to transform.
private static Logmsg transform(Logmsg src)
src
- The configuration source to transform.
private static Correlation transform(Correlation src)
src
- The configuration source to transform.
private static Autoaction transform(Autoaction src)
src
- The configuration source to transform.
private static Operaction transform(Operaction src)
src
- The configuration source to transform.
private static Autoacknowledge transform(Autoacknowledge src)
src
- The configuration source to transform.
private static Tticket transform(Tticket src)
src
- The configuration source to transform.
private static Forward transform(Forward src)
src
- The configuration source to transform.
private static Script transform(Script src)
src
- The configuration source to transform.
private static Event lookup(Snmp snmpInfo)
This method is used to find the matching event configuration object by looking at the event's SNMP information. In particular, the SNMP Enterprise Identifier is used first if it exist to find the matching record. If the enterprise identifier exists then it is compared as is, if that doesn't match then the enterprise prefix is stripped and the lookup is preformed again.
If the enterprise identifier is not found, but the event has generic and specific information then the appropriate generic UEI is used to find the appropriate record.
snmpInfo
- The SNMP event information.
java.lang.NullPointerException
- Thrown if the snmpInfo parameter that was passed is null.private static Event lookup(Event event)
This method is used to lookup the event configuration object based upon
information in the passed information. The
EventConfigurationManager
instance is
consulted to find a matching configured event. The lookup algorithm
favors SNMP information if avaialable, and then defaults to the event's
Universal Event Identfier.
event
- The event to find a configuration for.
java.lang.NullPointerException
- Thrown if the event parameter that was passed is null.private static void expandParms(Logmsg logmsg, Event event)
private static void expandParms(Autoaction[] autoactions, Event event)
private static void expandParms(Operaction[] operactions, Event event)
private static void expandParms(Tticket tticket, Event event)
private static void expandParms(Event event)
public static void expandEvent(Event e)
This method is invoked to check and configure a received event. The event configuration manager is consulted to find the appropriate configuration that is used to expand the event. In addition, the security parameters from the configuration manager is consulted to ensure that secure files are cleared out if necessary.
Any secure fields that exists in the incomming event are cleared during expansion.
e
- The event to expand if necesary.
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |