Configure OpenNMS Step By Step

Want to support HowtoForge? Become a subscriber!
 
Submitted by saad khan (Contact Author) (Forums) on Fri, 2006-07-28 14:54. :: Monitoring

OpenNMS

Introduction

OpenNMS is an opensource enterprise network management tool. It helps network administrators to monitor critical services on remote machines and collects the information of remote nodes by using SNMP. OpenNMS has a very active community, where you can register yourself to discuss your problems. Normally OpenNMS installation and configuration takes time, but I have tried to cover the installation and configuration part in a few steps.


OpenNMS provides the following features.

ICMP Auto Discovery
SNMP Capability Checking
ICMP polling for interface availability
HTTP, SMTP, DNS and FTP polling for service availability
Fully distributed client server architecture
JAVA Real-time console to allow moment-to-moment status of the network
XML using XSL style web access and reporting
Business View partitioning of the network using policies and rules
Graphical rule builder to allow graphical drag/drag relationships to be built
JAVA configuration panels
Redundant and overlapping pollers and master station
Repeating and One-time calendaring for scheduled downtime

The source code of OpenNMS is available for download from sourceforge.net. A production release (stable) and a development release (unstable), I have used 1.2.7 stable release in this howto. I have tested this configuration with Redhat/Fedora, Suse, Slackware, Debian and it works smoothly. I am assuming that readers already have Linux background. You can use the following configuration for other distributions too. Before you start OpenNMS installation, you need to install following packages:

jdk1.5*
tomcat 4.*
postgres 8.*
rrdtool1.2*

jdk1.5*

Download jdk1.5* from www.sun.com and unpack it with following command.

./jdk1.5*.bin

After unpacking, you will have a directory named jdk1.5*, Rename it to java directory and move it to /usr/lib.

Examples

mv jdk.* java

mv java /usr/lib/

Setup Environment variable for java home. Insert the following entries in /etc/profile.

JAVA_HOME="/usr/lib/java"
export JAVA_HOME

save the file then exit and run the command to read /etc/profile.

source /etc/profile

Tomcat 4.*

Download tomcat 4.* from tomcat.apache.org and extract it from archive zip/tar.gz.

Rename tomcat.* to tomcat and then move it to /opt folder.

mv tomcat.* /opt/tomcat

Setup Environment variable for tomcat home. Insert the following entries in /etc/profile.

CATALINA_HOME="/opt/tomcat"
export CATALINA_HOME

Save the file then exit and run the command to read /etc/profile.

source /etc/profile

Postgres 8.*

Download stable version of Postgresql from www.postgresql.org and extract it from archives bz2/tar.gz.

go into postgresql* directory and run the following script.

./configure --prefix=/opt/pgsql

In our installion, /opt/pgsql is the destination directory for postgresql installation.

Now start the installation of postgresql with following command.

make install

After this process, add a user to manage postgresql and define home directory /opt/pqsql/ for this user.

adduser postgres

You need to create a directory called "data" into /opt/pqsql, where you can store your data and assign it following permission.

mkdir /opt/pgsql/data
chown postgres /opt/pgsql/data

Switch user to postgres

su - postgres

Now you need to initialize your postgres databases.

$bin/initdb -D data/

Setup Environment variable for postgres home. Insert the following entries in /etc/profile.

POSTGRES_HOME="/opt/pgsql"
export POSTGRES_HOME

Save the file then exit and run the command to read /etc/profile.

source /etc/profile

Rrdtool-1.2*

You can download rrdtool from http://rrdtool.paracoda.com/download.en.html untar the files from tarball. And run the following commands.

tar xzvf rrdtool1.2*.tar.gz
cd rrdtool*
./configure --prefix=/usr/local/rrdtool ; make ; make install

When you run configure script, it may ask to install cgilib, if you don't have cgilib on your system, download cgilib from sourceforge.net and install it.

Then run the above commands again to install rrdtool.

Setup Environment variable for rrdtool home. Insert the following entries in /etc/profile.

RRDTOOL_HOME="/usr/local/rrdtool"
export RRDTOOL_HOME

Save the file then exit and run the command to read /etc/profile.

source /etc/profile

OpenNMS-1.2.*

Now we will install OpenNMS.

Download OpenNMS 1.2.* source code from www.opennms.org (i had used 1.2.7 version during configuration). untar it.

tar xzvf opennms-source-1.2.*.tar.gz

Rename opennms-1.2.* to opennms directory.

mv opennms-1.2.* opennms

Go into OpenNMS directory and create a file named build.properties.

Add following lines in the build.properties file.

install.dir=/opt/opennms
build.postgresql.include.dir=/opt/pgsql/include/server

Save the file and exit

Now you can run following command to install opennms

sh build.sh install

If installation process returns errors and asks to define the path for rrdtool, then you will have to put following entries in the build.properties file.

build.rrdtool.include.dir="add here include directory path for rrdtool without double quotes"
build.rrdtool.lib.dir="add here lib directory path for rrdtool without double quotes"
build.rrdtool.bin="add here binary path for rrdtool without double quotes"

Save the file and exit

Run the following command again

sh build.sh install

It will take time to complete installation process.

Setup Environment variable for OpenNMS home. Insert the following entries in /etc/profile.

OPENNMS_HOME="/opt/opennms"
export OPENNMS_HOME

Save the file then exit and run the command to read /etc/profile

source /etc/profile

Checking perl modules

Go into /opt/opennms/bin directory and run all *.pl scripts with perl command to check for the missing modules. if any of these *.pl scripts returns a error for missing module then install its module with cpan.

Configure OpenNMS

Run the following commands to configure OpenNMS.

$OPENNMS_HOME/bin/runjava -s #This command will search jre
$OPENNMS_HOME/bin/runjava -S "path to JRE without quotes" #Define your path for jre

Now run following command to create OpenNMS database and make sure postgres service is running.

$OPENNMS_HOME/bin/install -disU #This command will setup postgresql database for opennms

$OPENNMS_HOME/bin/install -y -w $CATALINA_HOME/webapps -W \ $CATALINA_HOME/server/lib #This command will setup the web application

Configure auto discovery

Go into following directory, open the discovery-configuration.xml with vi and add your ip range in begin and end tags.

cd $OPENNMS_HOME/etc/
vi discovery-configuration.xml

Save the file and exit

Final Steps

Run the following commands to start services.

sudo -u postgres /opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l /opt/pgsql/logfile\ start
$CATALINA_HOME/bin/startup.sh
$OPENNMS_HOME/bin/opennms start

Now you can login to main page of OpenNMS in your browser.

http://machine-ip:8080/opennms

Use user name "admin" and password "admin" to logging to main page.


Written by Saad Khan


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by SKoti (not registered) on Wed, 2013-10-30 11:10.

Do you have articles setting up OpenNMS version 1.12.1 using "Source" Package?

 

Submitted by BG (not registered) on Wed, 2009-10-14 15:12.

Yet another article about how to build (or configure, in your terms) OpenNMS. The 'official' documentation was OK in the first place.

How about an article that explains how to configure OpenNMS, i.e. how to set individual triggers and notification methods for each interface. Such 'official' documentation doesn't exist after all !

Submitted by Anonymous (not registered) on Tue, 2008-10-07 16:24.
I think Zabbix is better in terms of easy of installation and also features.
Submitted by Anonymous (not registered) on Fri, 2008-09-19 23:58.

Hi ,

Can any one suggest me from which site I can downlaod opnsnmp tar ball.

Thanks,

Siva

Submitted by Ranger Rick (registered user) on Thu, 2008-07-03 20:17.

These instructions are pretty out of date, and a ton of work has gone into packaging OpenNMS for most major distributions.

 Please do yourself a favor and check out the OpenNMS web site at http://www.opennms.org/ and see if the download instructions are appropriate for your distribution before attempting to build from source.

 Also keep in mind that while 1.5.9x is still technically unstable, it is at least as stable as the 1.2.x series, and is recommended for new installs.

Submitted by Anonymous (not registered) on Thu, 2006-08-03 14:32.

Thank you for the writeup, very informative. 

How well does OpenNMS perform in a largish environment? I am currently monitoring 38793  data sources on 315 hosts stored in 13285 rrd files using cacti. The poller runs every minute and averages 25 second run time. I was also curious how OpenNMS compared in ease of maintenance and administration.

 Regards,

William 

Submitted by magneto (registered user) on Thu, 2006-08-03 21:37.


According to http://www.opennms.org/index.php/FAQ-About, it claims that, they have people using openNMS to monitore 80,000 devices, and have a look at following link, its a old report, but can be useful for you.

http://www.linuxplanet.com/linuxplanet/reports/5807/3/

it says, openNMS can monitor up to 20,000 devices from a single instance.

Submitted by Anonymous (not registered) on Fri, 2006-07-28 20:34.

This is great tutorial. I believe it should be on homepage

Please add your diggs


Submitted by Anonymous (not registered) on Thu, 2006-08-03 13:31.

A link to the OpenNMS website would be nice ;)

http://www.opennms.org  from what I can see :)