21 C
Texas

How to Install OpenNMS on Centos / RHEL 8.

What is OpenNMS?

OpenNMS is a free & open source highly configurable, scaleable, extensible and cross-platform network Monitoring and network management platform. It is built using Java.

Features:

  • Device & Application Monitoring
  • Event-driven Architecture.
  • It supports the collection of performance from Industry standard agents via SNMP,JMX,WMI,NPRE,NSCLient++ & XMP simply through configuration.
  • Provides easy integration to extend service polling, performance & data collection framework.
  • Different modes like maual, detected or ReST API driven interfaces.

OpenNMS Requirements:

Operating System: Red Hat Enterprise Linux 8 or Centos 8.
Minimal Hardware: 2 CPU, 2 GB RAM, 20 GB Disk.

In this tutorial, we will learn how to install & setup the latest OpenNMS Horizon network service monitoring software in Centos / RHEL 8.

Step 1: Install Java & Setting Java_Home

yum install java-11-openjdk
- Advertisement -

Check installed version

java -version

Add this line to set Java Environment to all users at boot time.

export JAVA_HOME=/usr/lib/jvm/java-11

Step 2: Installing OpenNms Horizon

For installing OpenNMS Horizon, add the following yum repository & then import GPG key.

yum -y install https://yum.opennms.org/repofiles/opennms-repo-stable-rhel8.noarch.rpm
rpm --import https://yum.opennms.org/OPENNMS-GPG-KEY

Now, Install opennms meta package together alognwith all its built-in dependencies like jicmp6, opennms-webapp-jettty, postgresql and many more.

yum -y install opennms

Confirm that packages are successfully installed.

cd /opt/opennms

Step 3: Initializing & Setup PostgreSQL

Initialize the PostgreSQL database

postgresql-setup initdb

Start & enable PostgreSQL services and check status for confirmation.

systemctl start postgresql
systemctl enable postgresql
systemctl status postgresql

Switch to PostgreSQL user account to create access to PostgreSQL. After it create opennms database user with a password & create an opennms database.

su - postgres
createuser -P opennms
createdb -O opennms opennms

Setup password for Postgres super user.

psq; -c "ALTER USER postgres WITH PASSWORD 'admin123';"
exit

Modify the access policy for PostgreSQL in the /var/lib/pgsql/data/pg_hba.conf config file.

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

Change the authentication method to md5 by finding given lines to allow OpenNMS Horizon accessing database over LAN with a MD5 hashed password.

host           all            all           127.0.0.1/32           md5
host all all ::1/128 md5

Reload postgresql to take effect of configuration.

systemctl reload postgresql

Now, configure the db access in OpenNMS Horizon by opening following file.

vim /opt/opennms/etc/opennms-datasources.xml. 

And set up Credentials.

Step 4: Initialize & Start OpenNMS Horizon

Now, you need to integrate the default version of JAVA with OpenNMS. Run the following command to detect environment and persist in the /opt/opennms/etc/java.conf file.

/opt/opennms/bin/runjava -s

On next step, you need to run the OpenNMS installer which will initialize the db and detect system libararies persisted in /opt/opennms/etc/libararies.properties.

/opt/opennms/bin/install -dis

Start OpenNMS service via systemd for the mean time, enable it to auto-start at system boot.

systemctl start opennms
systemctl enable opennms
systemctl status opennms

Allow 8990 port to access Web Console.

firewall-cmd --permanent --add-port=8980/tcp
firewall-cmd --reload

Step 5: Access OpenNMS Web Console & Login

Go to your browser and type any of the following command to access the web console.

http://SERVER_IP:8980/opennms
OR
http://FDQN-OF-YOUR-SERVER:8980/opennms

Provide authentication details as default username admin & password admin.

This is not secure so you should change your password. To do so, go to main navigation menu on admin.

Under Account Self-Service, click Change Password”.
Enter the old, set new and click “Submit”. Afterwards, logout and login with your new user details for security.

That’s it You’ve done installing OpenNMS, if have any queries regarding this tutorial feel free to ask!

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

2 COMMENTS

  1. Some typo errors
    psq; -c “ALTER USER postgres WITH PASSWORD ‘admin123’;”
    should be
    psql -c “ALTER USER postgres WITH PASSWORD ‘admin123’;”

    vi var/lib/pgsql/data/pg_hba.conf
    should be
    vi /var/lib/pgsql/data/pg_hba.conf

    vim /opt/opennms/etc/opennms-datasources.xml.
    should be
    vim /opt/opennms/etc/opennms-datasources.xml

    HTH

    Marco

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article