Friday, January 09, 2009

Installing OpenNMS on Debian-Based Distributions

These instructions cover installation for most Debian-Based distributions (Debian, Ubuntu, etc.)

Add the OpenNMS Repository to Your sources.list

First, you need to tell apt-get how to find OpenNMS. Add the following contents to your /etc/apt/sources.lists file:

 deb http://debian.opennms.org stable main
deb-src http://debian.opennms.org stable main

(If you wish the latest development version of OpenNMS, which may include features not available in the current stable release, use unstable instead of stable.)

 deb http://debian.opennms.org unstable main
deb-src http://debian.opennms.org unstable main

Add the OpenNMS PGP Key to APT

The official OpenNMS packages are signed with a GPG / PGP key. The fingerprint for the official release key is:

 22EE DDA6 8698 B02F B2EC  50B7 062B 8A68 4C4C BBD9

You will need to tell APT about the key:

 wget -O - http://debian.opennms.org/OPENNMS-GPG-KEY | sudo apt-key add -

On Debian 4.0 (etch) and Ubuntu 7.10 (gutsy) or newer

As Sun Java has been put under the GPL it's sufficient to type "apt-get install opennms" since Debian 4.0 (etch) or Ubuntu 7.10 (gutsy); the dependencies will be fulfilled automatically.

On older Debian and Ubuntu releases

Installing on older Debian or Ubuntu releases involves additional steps to get a Sun Java 5 or Java 6 JDK. Instructions are available online, but if possible, save yourself the trouble and use a newer release that includes Sun Java in the default repositories.

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=/usr/share/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'

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 install iplike-pgsql83

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 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

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.

1 comment:

sheau said...

replica bags seoul gucci replica handbags s9f51g6g86 replica bags by joy go right here s9l83r8m33 louis vuitton fake replica bags wholesale in divisoria replica bags ebay replica hermes bag k8a81d2i45 replica nappy bags