Set up OpenNMS on Ubuntu 20.04: Best Network Monitoring
In this guide, we want to teach you to Set up OpenNMS on Ubuntu 20.04. OpenNMS is an open-source network monitoring platform that helps you visualize and monitor everything on your local and distributed networks. OpenNMS offers comprehensive fault, performance, and traffic monitoring with alarm generation in one place. Highly customizable and scalable, OpenNMS integrates with your core business applications and workflows. This makes it a powerful solution for businesses of all sizes seeking robust network oversight. Effectively managing your network is critical, and Set up OpenNMS on Ubuntu 20.04 is a great step towards achieving that.
In this guide on the Orcacore website, we will teach you how to install OpenNMS using Docker.
Steps To Set up OpenNMS on Ubuntu 20.04 with Docker
To install OpenNMS Horizon, 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 20.04.
Then, you must have Docker and Docker Compose installed on your server. To do these, you can follow these guides:
Install and Use Docker on Ubuntu 20.04
Install and Use Docker Compose on Ubuntu 20.04
When you are done, follow the steps below.
1. Install OpenNMS Horizon on Ubuntu 20.04
First, you need to create a project directory for OpenNMS and switch to it with the commands below:
# mkdir opennms
# cd opennms
Then, you need to create a new docker-compose.yml file to install OpenNMS. You can use your favorite text editor, here we use vi:
sudo vi docker-compose.yml
Add the following content to the file: You can visit the GitHub OpenNMS release page to get the latest version.
version: '3'
volumes:
data-postgres: {}
data-opennms: {}
services:
database:
image: postgres:15
container_name: database
environment:
- TZ=Europe/Berlin
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- data-postgres:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 30s
retries: 3
horizon:
image: opennms/horizon:31.0.5
container_name: horizon
environment:
- TZ=Europe/Berlin
- POSTGRES_HOST=database
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- OPENNMS_DBNAME=opennms
- OPENNMS_DBUSER=opennms
- OPENNMS_DBPASS=opennms
volumes:
- data-opennms:/opt/opennms/share/rrd
- ./overlay:/opt/opennms-overlay
command: ["-s"]
ports:
- "8980:8980/tcp"
- "8101:8101/tcp"
- "61616:61616/tcp"
healthcheck:
test: [ "CMD", "curl", "-f", "-I", "http://localhost:8980/opennms/login.jsp" ]
interval: 1m
timeout: 5s
retries: 3
When you are done, save and close the file.
Next, download and build the container for OpenNMS on Ubuntu 20.04 with the following command:
sudo docker-compose up -d
Verify the running container with the command below:
sudo docker ps -a
**Output**
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1235780ed100 postgres:15 "docker-entrypoint.s…" 13 seconds ago Up 11 seconds (healthy) 5432/tcp database
ff248fd47ee7 opennms/horizon:31.0.5 "/entrypoint.sh -s" 13 seconds ago Up 11 seconds (health: starting) 0.0.0.0:8101->8101/tcp, :::8101->8101/tcp, 1162/udp, 0.0.0.0:8980->8980/tcp, :::8980->8980/tcp, 10514/udp, 0.0.0.0:61616->61616/tcp, :::61616->61616/tcp horizon
2. Access OpenNMS Web Interface
At this point, you can access OpenNMS Horizon through the Web interface on Ubuntu 20.04 by typing your server’s IP address in your web browser followed by 8980:
http://IP_Address:8980
You will see the OpenNMS horizon login screen. Enter admin as the username and password and click Login.

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

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


3. How To Monitor Systems with OpenNMS
To be able to monitor systems, you need to add them to OpenNMS on Ubuntu 20.04. Begin by clicking on the “+” icon as shown below.

Enter the required details such as requisition, IP Address, and Node Label, and click Provision.

After the node has been added, it will appear under Info → Nodes.
You can now view graphs and create alerts for the device.

For more information, you can visit OpenNMS Documentation.
Conclusion
OpenNMS Horizon is a powerful, open-source network monitoring platform with comprehensive monitoring capabilities. At this point, you have learned to Install OpenNMS Horizon on Ubuntu 20.04. The ability to effectively Set up OpenNMS on Ubuntu 20.04 provides valuable insights into your network’s performance.
Hope you enjoy it. Also, you may like to read the following articles:
Install Netdata ubuntu 20.04
Reset Forgotten Ubuntu 20 Password
PHP 7.4 Ubuntu 20.04
Vagrant Installation Ubuntu 20.04
Podman Install Ubuntu 20.04
Official 7-Zip for Linux on Ubuntu 20.04
How to use telnet in Ubuntu 20
Sysdig Ubuntu 20.04
Install Chrome on Ubuntu 20.04
Install Git Ubuntu 20.04
Alternative Solutions for Network Monitoring on Ubuntu 20.04
While Docker provides a convenient and isolated environment for running OpenNMS, there are alternative methods for deploying network monitoring solutions on Ubuntu 20.04. Here are two different approaches:
1. Installing OpenNMS Directly on Ubuntu 20.04 (Without Docker)
This method involves installing OpenNMS and its dependencies directly onto the Ubuntu 20.04 operating system. This approach offers tighter integration with the host system but requires careful management of dependencies and potential conflicts.
Steps:
-
Install Java: OpenNMS requires Java. Install the OpenJDK:
sudo apt update sudo apt install openjdk-11-jdk
Verify the installation:
java -version
-
Install PostgreSQL: OpenNMS uses PostgreSQL as its database backend. Install it and configure a user:
sudo apt install postgresql postgresql-contrib sudo su - postgres psql CREATE USER opennms WITH PASSWORD 'opennms'; ALTER ROLE opennms WITH SUPERUSER; q exit
-
Download and Install OpenNMS: Download the latest OpenNMS Horizon release from the OpenNMS website or using
wget
:wget https://repo.opennms.org/opennms-repo.deb sudo dpkg -i opennms-repo.deb sudo apt update sudo apt install opennms
-
Initialize the Database: Initialize the OpenNMS database:
sudo /usr/share/opennms/bin/install -dis
-
Start OpenNMS: Start the OpenNMS service:
sudo systemctl start opennms sudo systemctl enable opennms
-
Access the Web Interface: Access the OpenNMS web interface through your browser at
http://<IP_Address>:8980
. The default credentials areadmin/admin
.
Advantages:
- Tighter integration with the OS, potentially leading to better performance in some scenarios.
- No overhead from containerization.
Disadvantages:
- More complex dependency management.
- Potential conflicts with other applications on the system.
- More difficult to upgrade or downgrade OpenNMS.
2. Using Prometheus and Grafana for Network Monitoring
Prometheus and Grafana are powerful open-source tools commonly used for monitoring systems and applications. While not a direct replacement for OpenNMS, they can provide comprehensive network monitoring capabilities.
Steps:
-
Install Prometheus:
sudo apt update sudo apt install prometheus
Configure Prometheus to scrape network metrics by editing the
/etc/prometheus/prometheus.yml
file. You’ll need to define scrape jobs that target network devices or exporters. -
Install Grafana:
sudo apt update sudo apt install grafana
Start and enable Grafana:
sudo systemctl start grafana-server sudo systemctl enable grafana-server
-
Install Network Exporters: Prometheus relies on exporters to collect metrics from network devices. Common exporters include:
- node_exporter: Collects system metrics from Linux servers.
- snmp_exporter: Collects metrics from SNMP-enabled devices (routers, switches, etc.).
For example, to install
node_exporter
:sudo apt install prometheus-node-exporter
Configure the exporters to expose metrics on specific ports.
-
Configure Prometheus to Scrape Exporters: Add the exporters as scrape targets in the
prometheus.yml
file. For example:scrape_configs: - job_name: 'node_exporter' static_configs: - targets: ['localhost:9100'] # Replace with the actual address and port of the node_exporter - job_name: 'snmp_exporter' static_configs: - targets: ['192.168.1.100:9116'] # Replace with the actual address and port of the snmp_exporter
-
Import Grafana Dashboards: Grafana allows you to create dashboards to visualize the collected metrics. You can find pre-built dashboards for network monitoring on the Grafana website or create your own. Data source should be set to Prometheus.
Example SNMP Exporter Configuration (snmp.yml):
modules:
if_mib:
walk:
- ifDescr
- ifName
- ifAlias
- ifOperStatus
- ifAdminStatus
- ifMtu
get:
- ifInOctets
- ifOutOctets
- ifInErrors
- ifOutErrors
oidCondition: ifType
oidConditionMode: equals
oidConditionValue: 6
This example collects basic interface information and traffic statistics from SNMP-enabled devices.
Advantages:
- Highly scalable and performant.
- Rich visualization capabilities with Grafana.
- Flexible and customizable.
- Widely used and well-documented.
Disadvantages:
- Requires more configuration and setup than OpenNMS.
- Steeper learning curve.
- May require writing custom exporters for specific network devices.
- Relies on SNMP and other protocols for data collection, which may not be supported by all devices.
Conclusion:
While the original article focuses on setting up OpenNMS with Docker, directly installing OpenNMS or utilizing Prometheus and Grafana offer viable alternatives for network monitoring on Ubuntu 20.04. The choice depends on your specific needs, technical expertise, and the complexity of your network environment. Set up OpenNMS on Ubuntu 20.04 or choosing one of the mentioned alternative are all beneficial approaches.