Building and Remotely Debugging OpenNMS

Quick notes on building OpenNMS from source, starting the assembled distribution, and attaching a remote Java debugger.

Prerequisites

  1. Use a machine with at least 8 GB of memory.
  2. Install Java 17.
  3. Ensure that external dependency repositories are reachable.
  4. Use a PostgreSQL version supported by the OpenNMS release.

Build and start

Clone OpenNMS, then run:

1
2
3
4
5
6
7
8
ulimit -n 65535
sudo apt install bzip2
./clean.pl
./compile.pl -DskipTests
./assemble.pl -p dir
./target/opennms-33.1.4/bin/runjava -s
./target/opennms-33.1.4/bin/install -dis
./target/opennms-33.1.4/bin/opennms -vt start

If assembly tests fail, retry with:

1
./assemble.pl -p dir -DskipTests

Do not place a custom Maven repository inside the source checkout, because the assembly process may include it in the generated source archive.

Remote debugging

Configure the OpenNMS JVM to listen for a debugger on port 8001, then attach with IntelliJ IDEA. Keep the debug port private and use an SSH tunnel when debugging a remote host.

The web console uses port 8980 by default.

Script permissions

If the startup scripts report a missing user or insufficient permissions, review the RUNAS setting in runjava, install, and opennms. In a temporary test environment, the value can be supplied explicitly:

1
export RUNAS=root

Production environments should use a dedicated service user with only the required permissions.

Built with Hugo
Theme Stack designed by Jimmy