DebianLinuxTutorials

How To Install OpenNMS on Debian 11

Install OpenNMS on Debian 11

In this tutorial, we will show you how to install OpenNMS on Debian 11. For those of you who didn’t know, OpenNMS is an open-source and enterprise-grade network monitoring and management solution. It is a network monitoring application that gathers critical information from local and network hosts using the SNPM protocol. It can be installed on Linux and Windows operating systems and provides a web-based interface to monitor network traffics through a web browser.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of the OpenNMS Network Monitoring Solution on a Debian 11 (Bullseye).

Prerequisites

  • A server running one of the following operating systems: Debian 11 (Bullseye).
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install OpenNMS on Debian 11 Bullseye

Step 1. Before we install any software, it’s important to make sure your system is up to date by running the following apt commands in the terminal:

sudo apt update
sudo apt upgrade

Step 2. Installing OpenJDK.

Run the following command below to install OpenJDK 11 on your Debian system:

sudo apt install openjdk-11-jdk

Verify the Java version:

java -version

Step 3. Installing OpenNMS on Debian 11.

By default, the OpenNMS is not available on the Debian 11 base repository. Now run the following command to add the OpenNMS repository to your system:

nano /etc/apt/sources.list.d/opennms.list

Add the following lines:

deb https://debian.opennms.org stable main
deb-src https://debian.opennms.org stable main

Next, import the GPG key:

wget -O - https://debian.opennms.org/OPENNMS-GPG-KEY | apt-key add -

After that, update the package index and install OpenNMS packages:

sudo apt update
sudo apt install opennms

Once you install OpenNMS, it automatically installs PostgreSQL. Start PostgreSQL and confirm its status as below:

sudo systemctl start postgresql
sudo systemctl status postgresql

Step 4. Create Database and User for OpenNMS.

Now create a database and user for OpenNMS. First, log in to PostgreSQL with the following command:

su - postgres
createuser opennms
psql -c "ALTER USER opennms WITH PASSWORD 'opennms';"
createdb -O opennms opennms
psql -c "ALTER USER postgres WITH PASSWORD 'your-strong-passwd';"
exit

Step 5. Configure OpenNMS.

Run the command below to set up the database access in the OpenNMS configuration file:

nano /usr/share/opennms/etc/opennms-datasources.xml

Change the following lines:

<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="your-strong-passwd" />

Save the changes in the file and close it.

Step 6. Initialize and Start OpenNMS.

To initialize OpenNMS, you need to integrate it with Java. So, run the following command to detect the Java environment:

/usr/share/opennms/bin/runjava -s

Next, initialize the database and detect system libraries:

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

Once the installation and setup are done, you can start and enable OpenNMS to run on system boot:

sudo systemctl start opennms
sudo systemctl enable opennms
sudo systemctl status opennms

Step 7. Configure Firewall.

Now open port 8980 in your firewall if you have a UFW firewall running on your system:

sudo ufw allow 8980/tcp
sudo ufw reload

Step 8. Accessing OpenNMS Web Interface.

Once successfully installed, open your web browser and access the OpenNMS web console using the URL http://your-server-ip-address:8980/opennms. You should see the OpenNMS login page:

Install OpenNMS on Debian 11 Bullseye

Congratulations! You have successfully installed OpenNMS. Thanks for using this tutorial for installing the latest version of OpenNMS open-source Open Network Management System on Debian 11 Bullseye. For additional help or useful information, we recommend you check the official OpenNMS website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button