OpenNMS (Open Network Management System) is a free and open source, scalable, extensible, enterprise-grade and cross-platform Java-based network management platform was designed to monitor critical services on remote machines and gathers the information of remote hosts data by using SNMP and JMX (Java Management Extensions).
Read Also: Install OpenNMS Network Monitoring Tool in CentOS/RHEL 7
OpenNMS runs on Linux and Windows operating systems and comes with a web-based console for easily administering networks and applications, supported by a Postgres database management system in the backend.
OpenNMS Requirements
- Debian 9 or higher, Ubuntu 16.04 LTS or higher
- Installed OpenJDK 11 Development Kit
- 2 CPU, 2 GB RAM, 20 GB disk
In this article, we will explain how to install and setup the latest OpenNMS Horizon network service monitoring software in Debian and Ubuntu Linux distributions.
Step1: Installing Java – OpenJDK 11 in Ubuntu
First, install the most recent version of OpenJDK Java 11 using the following apt command.
$ sudo apt-get install openjdk-11-jdk
Next, verify the version of Java installed on your system.
$ java -version
![Install OpenNMS Network Monitoring in Debian and Ubuntu (1) Install OpenNMS Network Monitoring in Debian and Ubuntu (1)](https://i0.wp.com/www.tecmint.com/wp-content/uploads/2019/06/check-java-version.png)
Then set the Java environment variable for all users on boot time, by adding the following line in /etc/profile file.
export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64
save the file and run the following command to read /etc/profile file.
$ source /etc/profile
Step 2: Install OpenNMS Horizon in Ubuntu
To install OpenNMS Horizon, add the apt repository in /etc/apt/sources.list.d/opennms.list
and add GPG key, then update the APT cache using the following commands.
$ cat << EOF | sudo tee /etc/apt/sources.list.d/opennms.listdeb https://debian.opennms.org stable maindeb-src https://debian.opennms.org stable mainEOF$ wget -O - https://debian.opennms.org/OPENNMS-GPG-KEY | apt-key add -$ apt update
Next, install OpenNMS Horizon meta-packages (opennms-core and opennms-webapp-jetty) with all built-in dependencies (jicmp6 and jicmp, postgresql and postgresql-libs).
$ sudo apt install opennms
Then verify that the OpenNMS meta packages have been installed in the /usr/share/opennms
directory using the tree utility.
$ cd /usr/share/opennms$ tree -L 1
![Install OpenNMS Network Monitoring in Debian and Ubuntu (2) Install OpenNMS Network Monitoring in Debian and Ubuntu (2)](https://i0.wp.com/www.tecmint.com/wp-content/uploads/2019/06/view-opennms-installation-directory.png)
Note: It is recommended to disable the OpenNMS Horizon apt repository after installation to prevent upgrades while it is running:
$ sudo apt-mark hold libopennms-java libopennmsdeps-java opennms-common opennms-db
Step 3: Initialize and Setup PostgreSQL
On Debian and Ubuntu, immediately after installing the packages, the installer initializes Postgres database, starts the service and enables it to auto-start at system boot.
To check if the service is up and running, run the following command:
$ sudo systemctl status postgresql
![Install OpenNMS Network Monitoring in Debian and Ubuntu (3) Install OpenNMS Network Monitoring in Debian and Ubuntu (3)](https://i0.wp.com/www.tecmint.com/wp-content/uploads/2019/06/check-postgres-service-status.png)
Next, switch to the postgres user account and create an opennms database user with a password.
$ sudo su - postgres$ createuser -P opennms$ createdb -O opennms opennms
![Install OpenNMS Network Monitoring in Debian and Ubuntu (4) Install OpenNMS Network Monitoring in Debian and Ubuntu (4)](https://i0.wp.com/www.tecmint.com/wp-content/uploads/2019/06/create-opennms-db-and-dbuser.png)
Now secure the postgres default/superuser account by setting a password.
$ psql -c "ALTER USER postgres WITH PASSWORD 'YOUR-POSTGRES-PASSWORD';"
![Install OpenNMS Network Monitoring in Debian and Ubuntu (5) Install OpenNMS Network Monitoring in Debian and Ubuntu (5)](https://i0.wp.com/www.tecmint.com/wp-content/uploads/2019/06/set-postgres-superuser-passwd.png)
At this stage, you need to set up the database access in OpenNMS Horizon configuration file.
$ sudo vim /usr/share/opennms/etc/opennms-datasources.xml
Find the sections below and set credentials to access the PostgreSQL database:
<jdbc-data-source name="opennms" database-name="opennms" class-name="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/opennms" user-name="opennms-db-username" password="opennms-db-user-passwd” /><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-super-user-passwd" />
![Install OpenNMS Network Monitoring in Debian and Ubuntu (6) Install OpenNMS Network Monitoring in Debian and Ubuntu (6)](https://i0.wp.com/www.tecmint.com/wp-content/uploads/2019/06/configure-db-access.png)
Save the changes in the file and close it.
Step 4: Initialize and start OpenNMS Horizon
To initialize OpenNMS, you need to intergrate it with Java. So, run the following command to detect the Java environment and persist in /usr/share/opennms/etc/java.conf configuration file.
$ sudo /usr/share/opennms/bin/runjava -s
![Install OpenNMS Network Monitoring in Debian and Ubuntu (7) Install OpenNMS Network Monitoring in Debian and Ubuntu (7)](https://i0.wp.com/www.tecmint.com/wp-content/uploads/2019/06/Integrate-java-with-opennms-config.png)
Next, you need to initialize the database and detect system libraries persisted in /opt/opennms/etc/libraries.properties
by running the OpenNMS installer.
$ sudo /usr/share/opennms/bin/install -dis
![Install OpenNMS Network Monitoring in Debian and Ubuntu (8) Install OpenNMS Network Monitoring in Debian and Ubuntu (8)](https://i0.wp.com/www.tecmint.com/wp-content/uploads/2019/06/run-opennms-installer.png)
Now start OpenNMS service via systemd for now, then enable it to auto-start at system startup and check its status with these commands.
$ sudo systemctl start opennms$ sudo systemctl enable opennms$ sudo systemctl status opennms
![Install OpenNMS Network Monitoring in Debian and Ubuntu (9) Install OpenNMS Network Monitoring in Debian and Ubuntu (9)](https://i0.wp.com/www.tecmint.com/wp-content/uploads/2019/06/start-enable-and-view-opennms-status.png)
If you have a UFW firewall running on your system, you need to open the port 8980 in your firewall.
$ sudo ufw allow 8980/tcp$ sudo ufw reload
Step 5: Access OpenNMS Web Console and Login
Now open a web browser and point it to the following URL to access the OpenNMS web console.
http://SERVER_IP:8980/opennmsOR http://FDQN-OF-YOUR-SERVER:8980/opennms
After the login interface shows up as shown in the following image, use the default login credentials: username is admin and the password is admin.
![Install OpenNMS Network Monitoring in Debian and Ubuntu (10) Install OpenNMS Network Monitoring in Debian and Ubuntu (10)](https://i0.wp.com/www.tecmint.com/wp-content/uploads/2019/05/opennms-web-console-login-interface.png)
Once you have successfully logged on for the first time, you will access the admin dashboard.
![Install OpenNMS Network Monitoring in Debian and Ubuntu (11) Install OpenNMS Network Monitoring in Debian and Ubuntu (11)](https://i0.wp.com/www.tecmint.com/wp-content/uploads/2019/05/opennms-default-admin-dashboard.png)
Next, you need to change the default admin password by going to the main navigation menu, click “admin → Change Password, under User Account Self-Service, click “Change Password“.
Enter the current/default password, set a new password and confirm it, then Click “Submit“. Afterwards logout and login with your new password.
Finally, learn how to set up, configure, and maintain an OpenNMS Horizon via the web interface, add nodes and application by consulting the OpenNMS Administrators Guide.
Read Also: How to Add Hosts in OpenNMS Monitoring Server
OpenNMS is an enterprise-grade network and application monitoring tool. As usual, reach us through the feedback form below for any questions or comments about this article.