Replacement Tokens

You can include various tokens in the description, log message, operator instruction, and automatic actions for each event. These tokens will be replaced by values from the current event when the text for the event is constructed. Not all events will have values for all tokens, and some refer specifically to information available only in events derived from SNMP traps.

Note that parameter descriptions use the percentage sign % as a delimiter to mark a replacement variable. If a literal % sign appears in your description, you must escape it with a %. For example,

'testUrl https://www.opennms.org/ReportSection?filter=FOO_BAR_BAZ%%20eq%%20%%27101%%27'

%eventid%

The event’s numeric database ID.

%uei%

The unique event identifier for the event.

%source%

The source of the event (which Horizon service daemon created it).

%descr%

The event description.

%logmsg%

The event logmsg.

%time%

The time of the event.

%shorttime%

The time of the event formatted using DateFormat.SHORT for a completely numeric date/time.

%dpname%

Formerly used for the ID of the Minion that the event was received on. This placeholder is deprecated and resolves to an empty String.

%nodeid%

The numeric node ID of the device that caused the event, if any.

%nodelabel%

The node label for the node given in %nodeid%, if available.

%nodelocation%

The node location for the node given in %nodeid%, if available.

%host%

The host at which the event was generated.

%interface%

The IP interface associated with the event, if any.

%foreignsource%

The requisition name for the node given in %nodeid, if available.

%foreignid%

The requisition ID for the node given in %nodeid, if available.

%ifindex%

The interface’s SNMP ifIndex.

%interfaceresolve%

Does a reverse lookup on the %interface% and returns its name, if available.

%service%

The service associated with the event, if any.

%severity%

The severity of the event.

%snmphost%

The host of the SNMP agent that generated the event.

%id%

The SNMP enterprise OID for the event.

%trapoid%

Full trap OID for the event.

%idtext%

The decoded (human-readable) SNMP Enterprise OID for the event.

%ifalias%

The interface’s SNMP ifAlias.

%generic%

The generic trap-type number for the event.

%specific%

The specific trap-type number for the event.

%community%

The community String for the trap.

%version%

The SNMP version of the trap.

%snmp%

The SNMP information associated with the event.

%operinstruct%

The operator instructions for the event.

%mouseovertext%

The mouse-over text for the event.

%tticketid%

The trouble ticket ID associated with the event, if available.

%primaryinterface%

The primary interface IP address for the node given in %nodeid%, if available.

The use of multiple Minions in one location can break the alarm life cycle for some Horizon features. To avoid this problem, replace the %dpname% with an empty String by setting org.opennms.netmgt.eventd.cleardpname=true in ${OPENNMS_HOME}/etc/opennms.properties.d/events.properties.

Asset tokens

A node may have additional asset records stored for it. You can access these records using the asset replacement token, which takes the form:

%asset[<token>]%

The value of the asset field named token, or "Unknown" if it does not exist.

Hardware tokens

A node may have additional hardware details stored for it. You can access these details using the hardware replacement token, which takes the form:

%hardware[<token>]%

The value of the token field from the node’s hardware inventory.

Parameter tokens

Many events carry additional information in their parameters (see Anatomy of an event). These parameters may start life as SNMP trap variable bindings (varbinds). You can access event parameters using the parm replacement token, which takes several forms:

%parm[all]%

Space-separated list of all parameter values in the form parmName1="parmValue1" parmName2="parmValue2" and so on.

%parm[values-all]%

Space-separated list of all parameter values (without their names) associated with the event.

%parm[names-all]%

Space-separated list of all parameter names (without their values) associated with the event.

%parm[<name>]%

Return the value of the parameter named <name> if it exists.

%parm[##]%

Return the total number of parameters as an integer.

%parm[#<num>]%

Return the value of parameter number <num> (one-indexed).

%parm[name-#<num>]%

Return the name of parameter number <num> (one-indexed).