Installation

Exclusive offer: get 50% off this eBook here
Instant OpenNMS Starter [Instant]

Instant OpenNMS Starter [Instant] — Save 50%

A short, fast, and focused guide on OpenNMS that delivers immediate results with this book and ebook

$14.99    $7.50
by Ghislain Hachey | September 2013 | Networking & Telephony Open Source

Instant OpenNMS Starter by Ghislain Hachey, explains OpenNMS. OpenNMS is an enterprise grade network management application platform built using the Java programming language under the open source model and is freely available under the GNU General Public License Version 3. OpenNMS can perform all functions of network management defined in the ITU's Principles for telecommunications network management including fault management, configuration management, accounting (or administration), performance management, and security management, often abbreviated as FCAPS.

There are always various ways to install software and the OpenNMS website provides several good tutorials at http://www.opennms.org/wiki/Tutorial for various operating systems. The following steps provide a less detailed albeit, slightly more advanced, and secure deployment procedure.

(For more resources related to this topic, see here.)

Step 1 – preparing for the deployment

OpenNMS is a large and complex piece of software and its deployment can be intimidating. Making sure we are prepared will save us a lot of trouble along the road. Here are some of the things needed before getting started:

Step 2 – setting up OpenNMS software repositories

OpenNMS conveniently makes available its software to several operating systems through their native software repository applications (for example, APT, YUM, and fink). The procedure for this will depend on your platform; instructions can be found at http://www.opennms.org/documentation/installguide.html#before-you-begin. Users of Windows can safely ignore this step as there is a standalone package providing a more Windows-like installation procedure.

Step 3 – installing the Java Development Kit (JDK)

Normally, Java software only needs the Java Runtime Environment (JRE) to be installed to run. But this will not be sufficient, you must install the JDK, either the OpenJDK implementation or Oracle's. The installation is straight forward and detailed at http://www.opennms.org/documentation/installguide.html#java. The default options are fine to get started.

If installing on Windows, both the 3 2-bit and 64-bit JDK are available on Oracle's website. Bear in mind that the JDK must match the OpenNMS standalone setup executable that you will run.

Step 4 – installing and configure PostgreSQL

PostgreSQL is usually available in Linux with excellent support from the operating systems' repositories. Otherwise, there are available binaries for other common operating systems. Here, instructions will diverge a little from OpenNMS's available documentation at http://www.opennms.org/documentation/installguide.html#postgresql, which are meant to get you started with as little fuss as possible at the expense of security.

Access controls will be configured using encrypted passwords (not using trust authentication as in the online tutorials). This can be achieved by editing the pg_hba.conf file; its location will vary depending on your platform. On CentOS 6 it is located in /var/lib/pgsql/data/ and on Debian 6 in /etc/postgresql/8.4/main/ (refer to your OS documentation).

Locate the following configuration lines and edit the authentication method to use md5 encrypted passwords as shown in the following code. You will need to reload or restart the service for changes to take effect:

# "local" is for Unix domain socket connections only
local all postgres md5
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5

The PostgreSQL defaults in postgresql.conf should be fine, but to take advantage of OpenNMS' ability to scale you will need to tune PostgreSQL further. A good starting point is going through http://www.opennms.org/documentation/installguide.html#postgresql-configure and http://www.opennms.org/documentation/installguide.html#performance-tuning.

To complete the database setup we will execute some SQL commands from the command line to do a number of initial tasks. The following code shows how to set a strong password for the PostgreSQL user postgres , create a database user called opennms with restricted privileges and a password of your choice, and create a database called opennms owned by our new opennms user (creating the database manually is not necessarily and would also be taken care of by the installer):

# su - postgres
$ psql -c "ALTER USER postgres WITH PASSWORD 'newpassword'" -d
template1
$ psql -c "CREATE USER opennms WITH LOGIN ENCRYPTED PASSWORD
'opennmspassword';"
$ psql -c "CREATE DATABASE opennms WITH OWNER=opennms ENCODING
'UNICODE';"

With a new database at our disposal we can now start importing functions and data into it. The next step is to install the iplike package that contains an optimized function to do lookups based on IP addresses. It is usually available in your OS software repository.

If you are on Windows, you do not have to do this explicitly. It is taken care automatically by the standalone OpenNMS package.

Once installed, you may have to run a script as shown in the following code to install the function in the opennms database:

# install_iplike.sh

If you are not using opennms (the default) as the database name you will have to edit the iplike script to change the database name manually. If you are using PostgreSQL 9.0 or later the procedural language is already installed by default, otherwise it needs to be installed in the opennms database with the following command:

# createlang -U postgres plpgsql opennms

If you are on Windows, you will be installing the OpenNMS standalone package. You do not need to worry about installing iplike or the plpgsql procedural language as both of them will be installed automatically.

Step 5 – installing OpenNMS

Before we go ahead with the OpenNMS installation, it is a good time to install the remaining optional dependencies jicmp and jrrd. On Windows those dependencies come with the standalone package and you do not need to do anything. On other OS it should be pulled in as a dependency when installing using APT, YUM, or fink.

We are now ready to install OpenNMS as detailed at http://www.opennms.org/documentation/installguide.html#installing; instructions are included for various platforms. Once installation of OpenNMS software is complete, either through the software repositories or using the standalone package for Windows, you must take care to properly configure it for database access.

Locate the file $OPENNMS_HOME/etc/opennms-datasources.xml and edit the data sources as shown in the following code:

<jdbc-data-source name="opennms"
database-name="opennms"
class-name="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/opennms"
user-name="opennms"
password="opennmspassword" />

<jdbc-data-source name="opennms-admin"
database-name="template1"
class-name="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/template1"
user-name="postgres"
password="newpassword" />

If everything was done correctly up to this point the OpenNMS installation can now be completed. First, optionally tell OpenNMS to find a suitable JRE (from your JDK) and then finalize the OpenNMS deployment using the install tool that comes with it. Essentially, the following two commands should be executed:

# $OPENNMS_HOME/bin/runjava -s
# $OPENNMS_HOME/bin/install -dis

If the installation was successful you should be able to start the OpenNMS service. The command for doing this will depend on your platform and method of installation:

On debian it is as simple as the following command:

# service opennms start

Red Hat systems like Fedora moved to the systemctl service manager, it would be something more like the following command:

# systemctl start opennms.service

On Windows you can do the following:

# cd C:\Program Files\OpenNMS\bin
# opennms.bat start

And that's it

Once started we can log in to OpenNMS with the credentials admin/admin using a browser pointed at http : //localhost:8980/opennms. If this is your first time installing a large Java system, there is a good chance it will not work the first time around. Don't give up, the scary errors are simply likely the result of one or two minor mistakes along the way. Repeat and verify each step all over again.

Summary

Installation helps you learn how to download and install OpenNMS with the minimum fuss and then set it up so that you can use it as soon as possible.

Resources for Article:


Further resources on this subject:


Instant OpenNMS Starter [Instant] A short, fast, and focused guide on OpenNMS that delivers immediate results with this book and ebook
Published: June 2013
eBook Price: $14.99
See more
Select your format and quantity:

About the Author :


Ghislain Hachey

Ghislain Hachey is an Electrical Engineer, with a Masters of Information Systems, and is a Technology Specialist by experience. He is Canadian, but has spent the past 10 years working in development in the South Pacific, advocating the use of free software. He worked at the grass roots level on pioneer projects with the goal of improving access to communication and education in remote, rural areas of the Solomon Islands. He then moved on to work in the private sector in Vanuatu, where he is largely responsible for the establishment of the first privately and locally owned small data center and also a distance and flexible learning institution.

He currently oversees all technical operations of Computer and Network Services (www.cns. com.vu), the leading Information Technology service provider operating in Vanuatu. Find him on his personal website www.ghachey.info or on LinkedIn.

Books From Packt


SolarWinds Orion Network Performance Monitor
SolarWinds Orion Network Performance Monitor

Oracle Solaris 11: First Look
Oracle Solaris 11: First Look

Instant Apache ServiceMix How-to [Instant]
Instant Apache ServiceMix How-to [Instant]

Apache Solr 4 Cookbook
Apache Solr 4 Cookbook

Instant Apache Solr for Indexing Data How-to [Instant]
Instant Apache Solr for Indexing Data How-to [Instant]

Instant Lucene.NET [Instant]
Instant Lucene.NET [Instant]

Instant Dependency Management with RequireJS How-to [Instant]
Instant Dependency Management with RequireJS How-to [Instant]

Apache Maven 3 Cookbook
Apache Maven 3 Cookbook


No votes yet

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
q
b
m
n
V
k
Enter the code without spaces and pay attention to upper/lower case.
Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software