Strings with URL arguments are truncated in the eventdescr field

Description

Events whose description contains a URL with arguments that themselves contain URL-encoded characters, have that URL truncated in an unexpected way.

This does not affect event parameters, and does not respect CDATA tags in the event description.

Steps to reproduce:

1. Send an event, via eventd XML or ReST:

2. Find the event in the OpenNMS web UI, and compare the Description field to what was sent.

3. Find the events.eventdescr and event_parameters.value in the OpenNMS database, and compare them with each other and with what was sent.

Expected result:
The full URL should appear in the event description, both in the web UI and in the database

Actual result:
The URL is truncated in the event description in both the web UI and the database, but the event parameter's value is not truncated.
The truncated form is https://www.opennms.org/ReportSection?filter=FOO_BAR_BAZ2027.

Acceptance / Success Criteria

The documentation describes the send-event.pl utility in detail and will also mention the need to escape percentage sign with percentage sign in the event description.

Lucidchart Diagrams

Activity

Show:

Bonnie Robinson September 15, 2021 at 1:48 PM

Documented the send-event.pl script.

https://github.com/OpenNMS/opennms/pull/3644

Christian Pape September 3, 2021 at 6:08 AM

So, I would suggest to transform this issue to a documentation issue to describe the send-event.pl utility in detail.

Will Keaney September 1, 2021 at 8:31 PM

Thanks, Christian! Escaping the % character by doubling it works for me as well.

Christian Pape August 24, 2021 at 11:50 AM

Doesn't look like an error to me. The percentage sign is used for parameter replacement in the event's description. So, in order to get a percentage sign in the description it needs to be escaped by an additional percentage sign. But of course, I doubt that this were mentioned anywhere in the documentation. This command seems to work fine:

See here: https://github.com/OpenNMS/opennms/blob/bc44978fb624d3e5f8a17c29832be0985db2598c/features/events/daemon/src/main/java/org/opennms/netmgt/eventd/processor/expandable/EventTemplate.java#L96

Fixed

Details

Assignee

Reporter

Components

Sprint

Affects versions

Priority

PagerDuty

Created July 2, 2021 at 6:39 PM
Updated September 16, 2021 at 1:37 PM
Resolved September 16, 2021 at 1:33 PM