Trapd environment variables are not effective in containers

Description

I have tried adding environment variables like below into the docker-compose.yaml file.

environment: - OPENNMS_TRAPD_ADDRESS=127.0.0.1 - OPENNMS_TRAPD_PORT=10162 - OPENNMS_TRAPD_NEWSUSPECTONTRAP=true - OPENNMS_TRAPD_INCLUDERAWMESSAGE=true - OPENNMS_TRAPD_THREADS=1 - OPENNMS_TRAPD_QUEUESIZE=12000 - OPENNMS_TRAPD_BATCHSIZE=1200 - OPENNMS_TRAPD_BATCHINTERVAL=300

The result in /usr/share/opennms/etc/trapd-configuration.xml is only the address and the port are changed. The others are untouched.

I also tried variable mapping by way of confd. For example, in horizon-config.yaml

--- postgres: host: database port: 5432 user: postgres password: postgres opennms: dbname: opennms dbuser: opennms dbpass: opennms timeseries: strategy: rrd rrd: storebyforeignsource: true strategyclass: org.opennms.netmgt.rrd.rrdtool.MultithreadedJniRrdStrategy library: jrrd2: /usr/lib64/libjrrd2.so trapd: address: 127.0.0.1 port: 10162 newsuspectontrap: true includerawmessage: true threads: 1 queuesize: 12000 batchsize: 1200 batchinterval: 300

The result is only the address and the port are changed. The others are still the default values.

Container logs attached.

What’s the point of overriding trapd-configuration.xml with confd? This has caused issue in persisting the changes made in the container directly as with every boot the trapd configuration is overridden by confd. Also, it’s introducing extra complications as each snmp v3 device that’s sending traps to opennms needs to be added there. How do we control this from confd? In helm chart, the only way to do this by creating a overlay file load it as configmap. If the file gets over the 1MB file size limit for helm, then it would break. We need to incorporate this into the change proposed by https://opennms.atlassian.net/browse/NMS-15822

Environment

container. Horizon 32.0.1, Meridian 2023.1.6

Acceptance / Success Criteria

None

Attachments

1
  • 10 Aug 2023, 07:29 PM

Activity

Show:

JianYet September 26, 2023 at 9:31 PM
Edited

FYI, the confd is broken because the leading / is missing in the path such as opennms/trapd/newsuspectontrap, opennms/trapd/includerawmessage etc. As far as I can tell. Actually, re: https://opennms.atlassian.net/browse/NMS-16141 there’s a commit for it.

Details

Assignee

Reporter

HB Grooming Date

HB Backlog Status

Sprint

Fix versions

Affects versions

Priority

PagerDuty

Created August 10, 2023 at 7:26 PM
Updated October 4, 2023 at 2:08 PM

Flag notifications