Event Troubleshooting

Debugging

When debugging events, it may be helpful to lower the minimum severity at which eventd will log from the default level of WARN. To change this setting, edit ${OPENNMS_HOME}/etc/log4j2.xml and locate the following line:

<KeyValuePair key="eventd" value="WARN" />

Changes to log42.xml will take effect within 60 seconds with no further action needed. At the DEBUG level, eventd will log a verbose description of every event it handles to ${OPENNMS_HOME}/logs/eventd.log. On busy systems, this setting may create so much noise as to be impractical. In these cases, you can get terse event summaries by setting eventd to log at level INFO and setting logEventSummaries="yes" in ${OPENNMS_HOME}/etc/eventd-configuration.xml.

Manually send events

You can manually create and send an event to trigger processes inside of Meridian through the UI or using the send-event.pl utility. In most cases, you would do this to reload daemon configuration without having to restart Meridian.

To manually send an event in the UI, follow these steps:

  1. In Meridian click the Gears Icon  Event Management  Manually Send an Event.

  2. Select the event from the Event list.

  3. Specify additional information, including the UUID, Node ID, parameters, severity, and so on, and click Send Event.

  4. Choose Status  Events to view the event.

send-event.pl utility

In addition to manually adding events, you can also use the send-event.pl utility as an automation tool to trigger events as part of continuous integration scripts or other automated processes.

For example:

  • Create a new suspect event every time you add a new resource.

  • Clear out alarms.

  • Open a ticket in your integrated ticketing system.

  • Send a notification reminder to order new ink cartridges when your printer is out of toner.

Format: ${OPENNMS_HOME}/bin/send-event.pl <uei> [host:port] [options]

The host:port defines the hostname and port to send the event; by default, it points to the local host.

Find UEIs and their associated parameters in the ${OPENNMS_HOME}/etc/eventd-configuration.xml file. See also Event daemon configuration.

Table 1. send-event.pl parameters
Name/Alias Description

Required

uei

The unique event identifier (UEI) indicates the type of event. View UEIs in the eventd-configuration.xml file. You can also define your own UEIs.

Optional

-d (--description)

A description for the event browser.

-f (--ifindex)

ifIndex of the associated service.

-h (--help)

Help message for the script. (The content from this table.)

-i (--interface)

IP address of associated interface.

-l (--logmsg)

A short log message for the event browser (secure field by default).

-n (--nodeid)

Database ID of associated node (or use foreignSource, foreignId parameters).

-p (-parameter)

Parameter in key=value form. For example, -p 'url http://www.opennms.com/'

-s (--service)

Name of the associated service.

-x (--severity)

Severity of the event:
1=Indeterminate
2=Cleared
3=Normal
4=Warning
5=Minor
6=Major
7=Critical

-t (--timezone)

The time zone you are in.

-v (--verbose)

Print raw XML that is generated.

-V (--version)

Print version and exit successfully.

Note that parameter descriptions use the percentage sign (%) as a delimiter to mark a replacement variable (see Replacement tokens). 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'

Example

Send an event to reload the eventd configuration.

$\{OPENNMS_HOME}/bin/send-event.pl -p 'daemonName Eventd' uei.opennms.org/internal/reloadDaemonConfig

Karaf Shell

Use the opennms:show-event-config command to render the event definition for one or more event UEIs (matching a substring) to XML. This command is useful for displaying event definitions that may not be easily accessible on disk, or verifying that particular events were actually loaded.

opennms:show-event-config -u uei.opennms.org/alarms