Install and Configure OpenNMS on Ubuntu 22.04 - OrcaCore (2024)

This tutorial intends to teach you to Install and Configure OpenNMS Horizon on Ubuntu 22.04.

OpenNMS (Network Management System) is a free and open-source initiative-grade network monitoring and management platform. It is written in Java and is issued under the GNU (General Public License).

There are two types of OpenNMSMeridian and Horizon. When we need stability and long-term support, choose Meridian, which is best for enterprises and businesses. Horizon is used where innovation occurs frequently. It is best for IT-ecosystem, and new technologies monitoring.

You can follow the steps below to Install OpenNMS Horizon on Ubuntu 22.04.

what you read in this post?

  • Steps To Install and Configure OpenNMS on Ubuntu 22.04
    • Install Java on Ubuntu 22.04
      • Set Java Environment Variables
    • Set up OpenNMS Horizon on Ubuntu 22.04
      • Import OpenNMS GPG Key
      • Add OpenNMS Repository
      • Install OpenNMS on Ubuntu
    • Configure PostgreSQL for OpenNMS on Ubuntu 22.04
      • Create OpenNMS Database and User
      • Define database credentials in OpenNMS Config File
    • Manage OpenNMS Service on Ubuntu 22.04
    • Configure Firewall For OpenNMS
    • Access OpenNMS Web Interface
    • How To Monitor Systems with OpenNMS
    • Conclusion

Steps To Install and Configure OpenNMS on Ubuntu 22.04

To complete this guide, you must log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can follow our guide on Initial Server Setup with Ubuntu 22.04.

Install Java on Ubuntu 22.04

Because OpenNMS is written in Java, you must install Java on your server. First, run the system update:

sudo apt update

Now use the command below to install Java on Ubuntu 22.04:

sudo apt install default-jdk -y

Verify your Java installation by checking its version:

java -version
Outputopenjdk version "11.0.17" 2022-10-18OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu222.04)OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu222.04, mixed mode, sharing)

Set Java Environment Variables

At this point, you need to set the Java home path by using the command below:

sudo export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64

Then, source the /etc/profile file:

sudo source /etc/profile

Set up OpenNMS Horizon on Ubuntu 22.04

The OpenNMS packages aren’t available in the default Ubuntu repository. So you need to add it manually.

Import OpenNMS GPG Key

At this point, you need to use the following command to import the OpenNMS GPG key:

sudo apt-key adv --fetch-keys https://debian.opennms.org/OPENNMS-GPG-KEY

Add OpenNMS Repository

Then, you need to add the OpenNMS repo to your server by using the command below:

sudo add-apt-repository -s 'deb https://debian.opennms.org stable main'

Install OpenNMS on Ubuntu

Now you can easily use the command below to install OpenNMS:

sudo apt -y install opennms

This will install all the dependencies on your server. You need to choose an internet site and set a mail address.

Configure PostgreSQL for OpenNMS on Ubuntu 22.04

When your dependencies and OpenNMS are installed on your server, you need to configure PostgreSQL.

First, verify your PostgreSQL is active and running on Ubuntu 22.04:

sudo systemctl status postgresql
Output● postgresql.service - PostgreSQL RDBMS Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor pr> Active: active (exited) since Sat 2023-02-25 09:33:55 UTC; 22s ago Process: 9700 ExecStart=/bin/true (code=exited, status=0/SUCCESS) Main PID: 9700 (code=exited, status=0/SUCCESS) CPU: 2ms...

Next, switch to your PostgreSQL user:

sudo -i -u postgres

Create OpenNMS Database and User

At this point, use the following command to create an OpenNMS user:

createuser -P opennms
Enter password for new role: Enter it again: 

Then, create the OpenNMS database on Ubuntu 22.04 by using the command below:

createdb -O opennms opennms

Next, protect the default user with a password:

psql -c "ALTER USER postgres WITH PASSWORD 'StrongPassword';"
OutputALTER ROLE

Exit the PostgreSQL shell:

[postgres@localhost ~]$ exit

Define database credentials in OpenNMS Config File

At this point, you need to define the database credentials in the OpenNMS config file. Open the file with your favorite text editor, here we use the vi editor:

sudo vi /usr/share/opennms/etc/opennms-datasources.xml

Find the lines below and define your database credentials:

<jdbc-data-source name="opennms" database-name="opennms" class-name="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/opennms" user-name="opennms" password="opennms-user-password" /><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-password" /></datasource-configuration>

When you are done, save and close the file.

Manage OpenNMS Service on Ubuntu 22.04

First, you need to initialize OpenNMS by adding the Java settings:

sudo /usr/share/opennms/bin/runjava -s
Outputrunjava: Looking for an appropriate JVM...runjava: Checking for an appropriate JVM in JAVA_HOME...runjava: Found: "/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java" is an appropriate JVM.runjava: Value of "/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java" stored in configuration file.

Next, initialize the database and detect system libraries inthe/usr/share/opennms/bin/installdirectory:

sudo /usr/share/opennms/bin/install -dis

At this point, you can use the following commands to start and enable your OpenNMS service:

# sudo systemctl start opennms# sudo systemctl enable opennms

Verify your OpenNMS service is active and running on Ubuntu 22.04:

sudo systemctl status opennms
Output● opennms.service - OpenNMS server Loaded: loaded (/lib/systemd/system/opennms.service; enabled; vendor prese> Active: active (running) since Sat 2023-02-25 09:43:51 UTC; 10s ago Main PID: 11550 (java) Tasks: 45 (limit: 4575) Memory: 380.1M CPU: 34.763s CGroup: /system.slice/opennms.service ├─11549 bash /usr/share/opennms/bin/opennms -s start └─11550 /usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java --add-modu...

Configure Firewall For OpenNMS

Here we assumed that you have enabled UFW. By default, OpenNMS is listening on port8980. You have to allow this port through the firewall using the following command:

sudo ufw allow 8980/tcp

Reload the firewall to apply the changes:

sudo ufw reload

Access OpenNMS Web Interface

At this point, you can access OpenNMS Horizon through the Web interface on Ubuntu 22.04 by typing your server’s IP address in your web browser followed by8980/opennms:

http://IP_Address:8980/opennms

You will see the OpenNMS horizon login screen. Enteradminas the username and password and clickLogin.

Install and Configure OpenNMS on Ubuntu 22.04 - OrcaCore (1)

Then, you should see the OpenNMS Horizon dashboard on Ubuntu 22.04.

Install and Configure OpenNMS on Ubuntu 22.04 - OrcaCore (2)

You can now change the password to a preferred one by navigating toadmin → Change Password.

Install and Configure OpenNMS on Ubuntu 22.04 - OrcaCore (3)
Install and Configure OpenNMS on Ubuntu 22.04 - OrcaCore (4)

How To Monitor Systems with OpenNMS

To be able to monitor systems, you need to add them to OpenNMS. Begin by clicking on the “+“ icon as shown below.

Install and Configure OpenNMS on Ubuntu 22.04 - OrcaCore (5)

Enter the required details such asrequisition,IP Address, andNode Label, and clickProvision.

Install and Configure OpenNMS on Ubuntu 22.04 - OrcaCore (6)

After the node has been added, it will appear underInfoNodes.

You can now view graphs and create alerts for the device.

Install and Configure OpenNMS on Ubuntu 22.04 - OrcaCore (7)

For more information, you can visitOpenNMS Documentation.

Conclusion

At this point, you have learned to Install and Configure OpenNMS Horizon on Ubuntu 22.04.

Hope you enjoy it. You may be like these articles on the Orcacore website:

Set up OpenJDK 19 on Ubuntu 22.04

Install Nginx with Brotli Compression on Ubuntu 22.04

Install and Configure OpenNMS on Ubuntu 22.04 - OrcaCore (2024)
Top Articles
Latest Posts
Article information

Author: Kieth Sipes

Last Updated:

Views: 5463

Rating: 4.7 / 5 (47 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Kieth Sipes

Birthday: 2001-04-14

Address: Suite 492 62479 Champlin Loop, South Catrice, MS 57271

Phone: +9663362133320

Job: District Sales Analyst

Hobby: Digital arts, Dance, Ghost hunting, Worldbuilding, Kayaking, Table tennis, 3D printing

Introduction: My name is Kieth Sipes, I am a zany, rich, courageous, powerful, faithful, jolly, excited person who loves writing and wants to share my knowledge and understanding with you.