Setup OpenNMS Horizon on openSUSE Leap 15.2

The recommendation for production environments is Debian/Ubuntu or CentOS/RHEL. Nevertheless, it is possible to install it on openSUSE Leap 15.2 with the instructions provided in this guide.

Installing OpenJDK 11 JDK

sudo zypper install java-11-openjdk-devel

Installing PostgreSQL server

sudo zypper install postgresql-server
sudo systemctl enable --now postgresql

Create a PostgreSQL user for OpenNMS Horizon, as password I have set opennms

sudo -i -u postgres createuser -P opennms
Enter password for new role:
Enter it again:

Create a database for OpenNMS Horizon

sudo -i -u postgres createdb -O opennms opennms

Set a Postgres root user password

sudo -i -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres-root-password';"

Edit the Postgres host-based authentication file

sudo vi /var/lib/pgsql/data/pg_hba.conf

Set password hashing from ident to md5 for localhost connections

host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

Restart PostgreSQL to apply the changes

sudo systemctl restart postgresql

Install insserv compatibility package

sudo zypper install insserv-compat

Add OpenNMS RPM repository

sudo zypper addrepo https://yum.opennms.org/stable/common/ opennms

You have to trust the following GPG key

Building repository 'openSUSE-Leap-15.2-1' cache ...........................................................................[done]

New repository or package signing key received:

  Repository:       opennms
  Key Name:         OpenNMS Signing Key 2012 (1024-bit) <opennms@opennms.org>
  Key Fingerprint:  79564AEB 7CC6C014 88E7C647 57801F6F 5B9EFD43
  Key Created:      Mon Jan 26 21:40:16 2015
  Key Expires:      (does not expire)
  Subkey:           2C1CAE48E7D60480 2012-01-22 [does not expire]
  Rpm Name:         gpg-pubkey-5b9efd43-54c6a630


Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): a

Install JICMP and JICMP6

sudo zypper install https://yum.opennms.org/stable/centos8/jicmp/jicmp-2.0.5-1.el7.centos.x86_64.rpm
sudo zypper install https://yum.opennms.org/stable/centos8/jicmp6/jicmp6-2.0.4-1.el7.centos.x86_64.rpm

Install OpenNMS Horizon

sudo zypper install opennms

Set OpenJDK 11 environment

cd /opt/opennms/bin
./runjava -s

The output should look like the following:

runjava: Looking for an appropriate JVM...
runjava: Checking for an appropriate JVM in JAVA_HOME...
runjava: Skipping... JAVA_HOME not set.
runjava: Checking JVM in the PATH: "/etc/alternatives/java"...
runjava: Did not find an appropriate JVM in the PATH: "/etc/alternatives/java"
runjava: Searching for a good JVM...
runjava: /opt/opennms/bin/find-java.sh failed to find a valid JDK. Falling back to the old algorithm.
runjava: Found a good JVM in "/usr/lib64/jvm/java/bin/java".
runjava: Value of "/usr/lib64/jvm/java/bin/java" stored in configuration file.

Configure PostgreSQL access

sudo vi /opt/opennms/etc/opennms-datasources.xml

Set credentials for the opennms database and for postgres admin user

<jdbc-data-source name="opennms"
                  database-name="opennms"
                  class-name="org.postgresql.Driver"
                  url="jdbc:postgresql://localhost:5432/opennms"
                  user-name="opennms"
                  password="opennms" />

<jdbc-data-source name="opennms-admin"
                  database-name="template1"
                  class-name="org.postgresql.Driver"
                  url="jdbc:postgresql://localhost:5432/template1"
                  user-name="postgres"
                  password="postgres-root-password" />

Initialize OpenNMS Horizon database

cd /opt/opennms/bin
sudo ./install -dis

Start OpenNMS Horizon and enable startup on system boot

sudo systemctl enable --now opennms

:tipping_hand_woman: When you get the error message:

Synchronizing state of opennms.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable opennms
/sbin/insserv: No such file or directory

the insserv-compat is missing and you have skipped this step in this guide above.

Configure firewall for access to the web interface

sudo firewall-cmd --zone=public --add-port=8980/tcp --permanent

Optional: If you want to receive SNMP Traps and Syslog messages

sudo firewall-cmd --zone=public --add-port=162/udp --permanent
sudo firewall-cmd --zone=public --add-port=514/udp --permanent

Reload the firewall with

sudo firewall-cmd --reload

Login to the web interface http://your-server-ip:8980/opennms with admin/admin.

gl & hf


:woman_facepalming: You can fix me, Iā€™m a wiki post.

2 Likes