Installation:URPMI
Subscribe

From OpenNMS

Jump to: navigation, search

Installing on Mandriva Linux

These instructions cover installation on Mandriva Linux.

Binary packages are currently available for Mandriva 2007.1 and Mandriva 2008.0 on both i586 and x86_64.

Set Up URPMI

Add an Official Mirror

First, you need to make sure you've got the main Mandriva URPMI repositories enabled. The easiest way to do so is by filling out the form at Easy Urpmi.

For example, on Mandriva Linux 2007, you would do something like this:

 urpmi.addmedia main ftp://mirrors.usc.edu/pub/linux/distributions/mandrakelinux/official/2007.1/i586/media/main/release with media_info/hdlist.cz 
 urpmi.addmedia --update main_updates ftp://mirrors.usc.edu/pub/linux/distributions/mandrakelinux/official/2007.1/i586/media/main/updates with media_info/hdlist.cz

Add the OpenNMS Mandriva Mirror

First, add the OpenNMS stable repository:

 urpmi.addmedia --probe-hdlist opennms-stable http://yum.opennms.org/stable/mandriva2007

If you want OpenNMS stable snapshots, add the testing repository:

 urpmi.addmedia --probe-hdlist opennms-testing http://yum.opennms.org/testing/mandriva2007

If you want the latest unstable version, add the unstable as well:

 urpmi.addmedia --probe-hdlist opennms-unstable http://yum.opennms.org/unstable/mandriva2007

And if you want to install nightly snapshots, then add the snapshot one:

 urpmi.addmedia --probe-hdlist opennms-snapshot http://yum.opennms.org/snapshot/mandriva2007

(If you are using mandriva 2008, use "mandriva2008" instead.)

Determine What to Install

Since version 1.3.7, OpenNMS is packaged as five RPMs:

opennms-core
The core OpenNMS code, responsible for network discovery, polling, data collection, notification, and more.
opennms-docs
Documentation.
opennms-webapp-jetty
The OpenNMS web UI, pre-deployed to run in the built-in Jetty application server that is included in the opennms-core package
opennms-webapp-standalone
The OpenNMS web UI, designed to be deployed to Tomcat or another suitable servlet container. Optional; install only if you know that the Jetty version is not suitable for your environment.
opennms
A convenience package which installs everything you need for a functional OpenNMS installation on a single system.

It is recommended that you install the opennms package unless you need to do something advanced such as splitting the various components of OpenNMS across multiple servers.

Install OpenNMS

 [user@localhost i586]# urpmi opennms
 One of the following packages is needed:
  1- opennms-webapp-jetty-1.6.1-1.noarch: Embedded web interface for OpenNMS (to install)
  2- opennms-webapp-standalone-1.6.1-1.noarch: Standalone web interface for OpenNMS (to install)
 What is your choice? (1-2) 1
 To satisfy dependencies, the following packages are going to be installed:
 iplike-1.0.6-1.i586
 jdk-1.5.0_13-fcs.i586
 jicmp-1.0.5-1.i586
 opennms-1.6.1-1.noarch
 opennms-core-1.6.1-1.noarch
 opennms-webapp-jetty-1.6.1-1.noarch
 Proceed with the installation of the 6 packages? (217 MB) (Y/n) 
 
     http://yum.opennms.org/stable/mandriva2007/jdk-1_5_0_13-linux-i586.rpm
     http://yum.opennms.org/stable/mandriva2007/iplike-1.0.6-1.i586.rpm                                                                                                                                                              
     http://yum.opennms.org/stable/mandriva2007/jicmp-1.0.5-1.i586.rpm                                                                                                                                                               
     http://yum.opennms.org/unstable/mandriva2007/opennms-1.6.1-1.noarch.rpm                                                                                                                                                         
     http://yum.opennms.org/unstable/mandriva2007/opennms-core-1.6.1-1.noarch.rpm                                                                                                                                                    
     http://yum.opennms.org/unstable/mandriva2007/opennms-webapp-jetty-1.6.1-1.noarch.rpm                                                                                                                                            
 installing iplike-1.0.6-1.i586.rpm jicmp-1.0.5-1.i586.rpm jdk-1_5_0_13-linux-i586.rpm opennms-1.6.1-1.noarch.rpm opennms-core-1.6.1-1.noarch.rpm opennms-webapp-jetty-1.6.1-1.noarch.rpm from /var/cache/urpmi/rpms                 
 Preparing...                     ########################################
       1/6: jdk                   ########################################
       2/6: jicmp                 ########################################
       3/6: opennms-core          ########################################
 - moving *.sql.rpmnew files (if any)... done
 - checking for old update files... done
 
  *** Installation complete.  You must still run the installer and
  *** make a few other changes before you start OpenNMS.  See the
  *** install guide and release notes for details.
       4/6: opennms-webapp-jetty  ########################################
       5/6: iplike                ########################################
 - installing iplike into the template1 db... OK
 - installing iplike into the opennms db (if it exists)... failed
       6/6: opennms               ########################################

Configure OpenNMS

First, for the purposes of convenience, we are going to set the $OPENNMS_HOME environment variable before running any commands.

 export OPENNMS_HOME=/opt/opennms

(If you are not using a bourne-compatible shell, you may need to use different syntax.)

Configure Your Database

OpenNMS needs to be able to connect to PostgreSQL as the "postgres" user (by default) over a TCP/IP connection.

RedHat-based systems
/etc/init.d/postgresql start
/sbin/service postgresql start
pg_hba.conf and postgresql.conf are in /var/lib/pgsql/data
Debian-based systems
/etc/init.d/postgresql-X.X start
pg_hba.conf and postgresql.conf are in /etc/postgresql/X.X/main
Mac OS X (Fink)
/sw/bin/pgsql.sh start

Edit pg_hba.conf to Allow postgres to Authenticate

To allow the "postgres" user to connect, you will need to edit your database's pg_hba.conf file, which is usually created on installation or the first startup of PostgreSQL, depending on your distribution: By default, it will have something like this at the bottom:

 local   all         all                               ident sameuser
 host    all         all         127.0.0.1/32          ident sameuser
 host    all         all         ::1/128               ident sameuser

You will need to change "ident sameuser" to "trust":

 local   all         all                               trust
 host    all         all         127.0.0.1/32          trust
 host    all         all         ::1/128               trust

Edit postgresql.conf to Allow TCP/IP Connections

You may also need to change the postgresql.conf to allow TCP/IP connections, if it cannot do so already. On older PostgreSQL versions, this is enabled with the flag:

 tcpip_socket = true

On newer PostgreSQL versions, this is enabled with:

 # you can use "*" to listen on all addresses
 listen_addresses = 'localhost'

Also be sure that the max # of connections is configured to > than c3p0.maxPoolSize in $OPENNMS_HOME/etc/c3p0.properties (50 by default) +10.

 max_connections = 60

(Note: this may cause you to do some kernel tuning for max shared memory in the kernel (shmmax))

Restart the Database

Once you've made these changes, you need to restart your database.

Create the opennms Database

If not done, use "sudo -u postgres createdb -U postgres -E UNICODE opennms" to create the database in postgres.

Insert the IPLIKE Stored Procedure in the Database

If this is your first time installing OpenNMS or iplike, you should make sure that iplike is configured in your database. First you need to install the iplike package from OpenNMS package repositories.

For RPM-based distributions using YUM:

 yum install iplike

For DEB-based distributions using APT (use suffix pgsql74, pgsql81, pgsql82, or pgsql83 according to the version of PostgreSQL on your system):

 apt-get --reinstall install iplike-pgsql84

If the OpenNMS database is already configured, you are good to go. If not, you have to issue manually:

 install_iplike.sh

Tell OpenNMS Where to Find Java

OpenNMS needs to know where to find Java (Java 5 and Java 6 are both supported) to be able to start up. To tell it how to do so, you run $OPENNMS_HOME/bin/runjava like so:

 $OPENNMS_HOME/bin/runjava -s

This will search $JAVA_HOME and other common locations for your JDK. If you wish to use a specific JDK, you can run it with the -S flag instead:

 $OPENNMS_HOME/bin/runjava -S /usr/java/jdk1.5.0_12/bin/java

Add the JAVA_HOME in /etc/default/opennms

 JAVA_HOME=/usr

Initialize OpenNMS and the Database

Next, you need to run the OpenNMS installer, which will initialize the OpenNMS database, and do some other basic setup. Upon upgrade, you should run this command again to make sure your database schema and other things required at startup are up-to-date.

In most cases, you can just run:

 $OPENNMS_HOME/bin/install -dis

Sometimes you may need to tell OpenNMS where to find libjicmp.so; in that case, you can use the -l option (OpenNMS 1.3.5 and higher):

 # i386 example
 $OPENNMS_HOME/bin/install -dis -l /usr/lib/jni:/usr/lib
 # x86_64 example
 $OPENNMS_HOME/bin/install -dis -l /usr/lib64/jni:/usr/lib64

If you have an error durring the install process about language "plpgsql" does not exist, you can try :

createlang -U postgres plpgsql opennms

Start OpenNMS

You should have a basic OpenNMS installation ready now, so start it up:

 sudo /etc/init.d/opennms start

As of OpenNMS 1.3.7, by default, the web UI will come up using the embedded Jetty servlet container, on port 8980. Open your browser and point it at:

 http://yourhost:8980/opennms/

the user name and password are both "admin" to start.

Discover Your Network

Finding Hosts

First, OpenNMS needs to know which devices (or, "nodes") you want it to discover. To discover nodes, OpenNMS does a ping sweep on IP address ranges that you configure it to discover. If an IP address that OpenNMS is not already managing responds to a discovery ping, then OpenNMS will begin scanning that IP address for services, create a new node in its database, and begin monitoring the node's interfaces and services. A new install of OpenNMS will not perform any discovery until you add one or more address ranges to the discovery configuration. You do this by logging into the web UI as the admin user and navigating to the Admin menu and then clicking on 'Configure Discovery' under the Operations section.

In the Include Ranges section of the Home / Admin / Discovery / Modify Configuration page, click on the 'Add New' button. In the window that pops up, enter the beginning and ending IP addresses for the range that you wish to include for discovery. The default values for Retries and Timeout are usually appropriate. Click the 'Add' button, and the popup window will close and the new range will show up in the Include Ranges section. Click the 'Save and Restart Discovery' button to apply your changes. Discovery of the newly added range will begin within a few seconds; the ping requests and service scans are spread out over time to avoid flooding your network, so it will take some time for all nodes in your newly added range to be scanned and discovered.

For more detailed information on discovery configuration, including how to add IP addresses manually to the discovery configuration file, see Discovery.

Get Notifications When Problems Occur

To get started, we need to configure the main admin user to have a valid e-mail address.

  1. Log in as admin to the web UI
  2. Go to Admin in the menu bar
  3. Under the Operations section, set the Notification Status radio button to On and click the Update button
  4. Under the OpenNMS System section, go to Configure Users, Groups and Roles and then Configure Users
  5. click the icon under "Modify" for the admin user
  6. set the Email address, and click the Finish button

This should get OpenNMS configured to send the default notifications to the administrator e-mail address.

Notifications are extremely flexible and can be configured to do complex escalations, scheduled outages, and user management. Detailed instructions are available in the Notification Configuration How-To.

Version History/Availability