Other Install instructions

From OpenNMS
Jump to: navigation, search

Gentoo Installation

An overlay is available for use with layman. This will take a prebuilt tarball and install into /opt/opennms.

The quick notes on how to install:

First emerge the database:

  • run "emerge -q =postgresql-server-9.1*" to get PgSQL in, then config and start it before moving on. OpenNMS does not run with 9.2 yet.

When configuring PostgreSQL, remember to check /etc/conf.d/postgresql-9.1 for the PG_INITDB_OPTS, and make sure it include UTF8-support.

  • run "emerge --config dev-db/postgresql-server"
  • run "/etc/init.d/postgresql-9.1 start"

Then emerge layman and Oracle's JDK:

  • run "emerge -q sun-jdk && env-update && source /etc/profile" to get the JDK in place.

Then install and configure the Gentoo overlay:

  • run "emerge -q layman" to install layman and related tools.
  • add reference to layman in make.conf, add the line "source /var/lib/layman/make.conf"
  • add http://rsync.boxed.no/overlays/boxed-main.xml to /etc/layman/layman.cfg in the overlays section.
  • run "layman -f" to update the overlays cache.
  • run "layman -a boxed-nms" to add the OpenNMS overlay to your machine.
  • add "layman -S" to crontab once a week to check for new ebuilds.

And finally install OpenNMS:

  • run "emerge -q opennms" to see that it has picked up the ebuild.

After installing both PostgreSQL and OpenNMS its only left to configure is:

  • Tell OpenNMS to configure your database: "/opt/opennms/bin/install -dis"

And then it should automagically just work: "/etc/init.d/opennms start"

By default OpenNMS listens on port 8980 with HTTP, and should be reachable as http://127.0.0.1:8980/opennms/index.jsp. If you want to tidy this up, read on.

After checking that it runs, add them to the boot scripts by running:

  • rc-update add postgresql-9.1 default
  • rc-update add opennms default

Cut-n-paste for the brave

(This is not up to date, but will be shortly)

If you are in a rush and have an empty, unused machine to install on, with at least 2G free space on /opt this should get the most important bits done in a hurry:

[ `equery -q l laymann | wc -l` -gt 0 ] || echo "'emerge -q layman' first" && exit

cat >> /tmp/layman.cfg.diff <<EOF
--- /etc/layman/layman.cfg.orig 2010-10-13 02:22:26.000000000 +0200
+++ /etc/layman/layman.cfg      2010-10-13 02:23:22.000000000 +0200
@@ -32,6 +32,7 @@
 #            file:///var/lib/layman/my-list.xml

 overlays  : http://www.gentoo.org/proj/en/overlays/repositories.xml
+            http://rsync.boxed.no/overlays/boxed-nms.xml

 #-----------------------------------------------------------
 # Proxy support
EOF

cat >> /etc/make.conf <<EOF
ACCEPT_LICENSE="Oracle-BCLA-JavaSE"
EOF

patch -p0 < /tmp/layman.cfg.diff
layman -f
layman -a boxed-nms

emerge -q sun-jdk =postgresql-server-9.1 && env-update && source /etc/profile

cat >> /tmp/p.diff <<EOF
--- /etc/conf.d/postgresql-9.1.orig     2010-10-13 04:09:56.000000000 +0200
+++ /etc/conf.d/postgresql-9.1  2010-10-13 04:10:04.000000000 +0200
@@ -2,7 +2,7 @@
--- /etc/conf.d/postgresql-9.1.orig     2011-07-10 03:37:36.000000000 +0200
+++ /etc/conf.d/postgresql-9.1  2011-07-10 03:37:41.000000000 +0200
@@ -60,4 +60,4 @@

 # Additional options to pass to initdb.
 # See 'man initdb' for available options.
-#PG_INITDB_OPTS="--locale=en_US.UTF-8"
+PG_INITDB_OPTS="--locale=en_US.UTF-8"
EOF

patch -p0 < /tmp/p.diff
echo Y | emerge --config dev-db/postgresql-server
/etc/init.d/postgresql-* start

emerge -q opennms
/opt/opennms/bin/install -dis
/etc/init.d/opennms start

...and this should have you everything done in 10 minutes.

OpenNMS and Apache

Apache can run as a frontend for OpenNMS, this allows you to have the machines seperate, limit access to the OpenNMS server, have Apache in a DMZ and use SSL, etc.

For apache 2.0 and 2.2 there is support for AJP proxy in mod_proxy_ajp. Enabling support for proxying, and making sure mod_proxy also loads mod_proxy_ajp should be enough, and then add this code to the relvant part of a vhost:

        # OpenNMS
        RewriteRule ^/$  https://web.mycorp.com/opennms/ [R,L]
        <Location /opennms/>
                DirectoryIndex  index.jsp

                ProxyPass       ajp://opennms.mycorp.com:8981/opennms/
        </Location>

You also need to enable AJP support in OpenNMS, in $OPENNMS/etc/opennms.properties. Make sure that this line is not commented out:

org.opennms.netmgt.jetty.ajp-port = 8981

and if Apache is on an different box than OpenNMS, make sure that OpenNMS' Jetty server is not only listening on the loopback IP:

org.opennms.netmgt.jetty.host = 0.0.0.0

0.0.0.0 binds to all available adapters, 1.2.3.4 would only bind to the external IP, and not loopback. It seems you cannot specify multiple IPs.

Due to how chunks of data are handled in the AJP connection large pages and forms may cause issues with Apache, and odd NPE's, so this variable for mod_proxy_ajp must be set, usually in the same vhost:

ProxyIOBufferSize 8192

For Apache 2.2.15 and up it seems 8192 "works", for versions prior it seems 32768 "works". Documentation on this topic at apache.org is foggy at best.


The rest of this page is a placeholder for non-build-related installation instructions that were removed from Building OpenNMS.

Basic setup

This part is not subject of this howto ... but you need to set up at least a few things to get OpenNMS running.

I recommend starting off with these two files, see the FAQ-Configuration for more help:

vi <opennms.home>/etc/discovery-configuration.xml
vi <opennms.home>/etc/snmp-config.xml
touch <opennms.home>/etc/include

Setting up the OpenNMS webapp

OpenNMS versions later than 1.3.7 have a built in web application server. Once you have opennms started you can simply browse to http://localhost:8980/opennms and see the webapp front end.

You can also install the webapp in a Tomcat server

OpenNMS 1.3.2 requires Tomcat 5.5, so install it on your system. If you can't find a prepackaged version of Tomcat, you can download it from the Apache Tomcat web site, and it will work fine, but it won't have little niceties like a start/stop script for /etc/init.d (you could try jsvc).

Remove old OpenNMS server libraries

First remove any existing links to OpenNMS JARs. With the new authentication system they are not needed. The following command will remove all links in the tomcat's server/lib directory:

find <tomcat.home>/server/lib -type l -exec rm -f {} \;

Note: the type argument is a lowercase L

Setup the webapp itself

To setup the webapp itself you must install the context file for opennms.

<opennms.home>/bin/install -y \
    -w <tomcat.home>/conf/Catalina/localhost

View the webapp!!!

Now you may start Tomcat and visit http://localhost:8080/opennms/ to view the webapp! Login as "admin" with the password "admin".

Slackware 12.0 guide

### Install Slackware 12
### (Instructions found elseware)
### this is based off a full install

#### this install requires a basic understanding of linux, how to modify text files, move/copy files, etc...
#### I try to be as pedantic as possible, but I know there are some areas that without being able to find your way
#### around a linux filesystem you can get lost

########################################################################
## bits and pieces were put together from www.opennms.org wiki and documentation
## found here: http://www.opennms.org/documentation/InstallUnStable.html
## and here: http://www.opennms.org/index.php/Building_OpenNMS
#############################################################################

########################################################################
### All steps executed below as root (except when specified otherwise)
### this may not be safe, but it worked for my install. I'm sure there
### are steps that are more safely executed as a non-root user
########################################################################

##############################################################################################################
############################################################################
### Download and install JAVA JDK <--!!!make sure its JDK NOT JRE
############################################################################
##############################################################################################################


#############################################################################
### this is the url that leads you there http://java.sun.com/javase/downloads/index_jdk5.jsp
### I don't care for it, I like direct download links but they have some
### licensing dealy you need to go through

### depending on how you obtained it you may need to make the file executable
chmod +x jdk-1_5_0_12-linux-i586.bin

### execute the file
./jdk-1_5_0_12-linux-i586.bin

### when prompted agree to the license (or don't and stop following all instructions here)

### move the extracted files to /usr/local
mv jdk1.5.0_12 /usr/local

### tell your current path where to find the java you want it to use
### I like to add this statement to my /etc/profile
export PATH=/usr/local/jdk1.5.0_12/bin:$PATH

### set your JAVA_HOME environmental variable
### so that everyone knows where to look for it
### I like to add this statement to my /etc/profile
export JAVA_HOME=/usr/local/jdk1.5.0_12


### remove the link to you java libraries (if you have one)
rm /usr/lib/java

### create a new symbolic link to you're new java installation
ln -s /usr/local/jdk1.5.0_12 /usr/local/java



##############################################################################################################
#################################################################################
### Download and install apache Tomcat v5.5
#################################################################################
##############################################################################################################

#################################################################################
### this is the url that leads you there http://tomcat.apache.org/download-55.cgi
### I downloaded mine directly from http://mirrors.crazeekennee.com/apache/tomcat/tomcat-5/v5.5.23/bin/apache-tomcat-5.5.23.tar.gz
##################################################################################

### move the file you downloaded to the /usr/local directory
mv apache-tomcat-5.5.23.tar.gz /usr/local

### change to your /usr/local directory
cd /usr/local

### uncompress the tarball/gzip
tar -zxvf apache-tomcat-5.5.23.tar.gz 

### change to the binary directory for tomcat
cd apache-tomcat-5.5.23/bin

### start up tomcat
./startup.sh

#######################################################################################
### Load up the ip address of the host on port 8080 to see if tomcat is working right
### http://<your servers ip address>:8080
#######################################################################################


##############################################################################################################
#################################################################################
### Download and install RRDTOOl (OPTIONAL, you should only need to do this if you NEED rrdtool format files, JRobin format seems to work just fine)
#################################################################################
##############################################################################################################

#################################################################################
### this is the url that leads you there http://oss.oetiker.ch/rrdtool/pub/?M=D
### I downloaded mine directly from http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.23.tar.gz

### uncompress the tarball/gzip
tar -zxvf rrdtool-1.2.23.tar.gz

### change to the directory you just extracted the source into
cd rrdtool-1.2.23

### compile and install
./configure --enable-shared --prefix=/usr/local/rrdtool
make
make install

##########################################
### tell the rest of the world where to find the rrdtool libaries
### add the line /usr/local/rrdtool/lib to the file /etc/ld.so.conf

### run ldconfig (to update grab the configuration you just loaded into /etc/ld.so.conf
ldconfig

### add rrdtool to your path
### I like to add this line to my /etc/profile
export PATH=/usr/local/rrdtool/bin:$PATH





##############################################################################################################
#################################################################################
### Download and install Postgresql
#################################################################################
##############################################################################################################

#################################################################################
### this is the url that leads you there http://www.postgresql.org/download/
### I downloaded mine directly from http://ftp8.us.postgresql.org/postgresql/latest/postgresql-8.2.4.tar.gz

### uncompress the tarball/gzip
tar -zxvf postgresql-8.2.4.tar.gz

## change to the directory you just extracted the source into
cd postgresql-8.2.4

### compile and install
./configure
make
make install

### make a directory to store your data in
mkdir /usr/local/pgsql/data

### make the postgres user who will own the database
useradd -d /home/postgres -s /bin/bash postgres

### set the password for the postgres user (will prompt you for the password)
passwd postgres

### set the ownership for the data directory
chown postgres:users /usr/local/pgsql/data

### set your path so your shell can find the utilites for postgresql
### I like to add this to my /etc/profile NOTE, YOU WILL NEED TO DO ADD THIS TO YOUR /etc/profile NOW or run this statement again after you log in as postgres a few steps down
export PATH=/usr/local/pgsql/bin:$PATH

##########################################
### tell the rest of the world where to find the postgresql libaries
### add the line /usr/local/pgsql/lib to the file /etc/ld.so.conf

### run ldconfig (to update grab the configuration you just loaded into /etc/ld.so.conf
ldconfig

############################################
### log in as user postgres
############################################

### initialize your database directory
initdb -D /usr/local/pgsql/data

############################################
## edit the /usr/local/pgsql/data/postgresql.conf file 
## change the entry max_connections to max_connections = 256

### start your postgresql database server
pg_ctl -D /usr/local/pgsql/data -o -i -l /usr/local/pgsql/data/pg_logfile start

############################################
### go back to being root user
############################################

##############################################################################################################
#################################################################################
### Download and install jicmp
#################################################################################
##############################################################################################################

#################################################################################
### this is the url that leads you there http://sourceforge.net/project/showfiles.php?group_id=4141
### I downloaded mine directly from http://easynews.dl.sourceforge.net/sourceforge/opennms/jicmp-1.0.1.tar.gz

### uncompress the tarball/gzip
tar -zxvf jicmp-1.0.1.tar.gz

## change to the directory you just extracted the source into
cd jicmp-1.0.1

### compile and install
./configure
make
make install


##############################################################################################################
#################################################################################
### Download and install jrrd
#################################################################################
##############################################################################################################

#################################################################################
### this is the url that leads you there http://sourceforge.net/project/showfiles.php?group_id=4141
### I downloaded mine directly from http://umn.dl.sourceforge.net/sourceforge/opennms/jrrd-1.0.1.tar.gz

### uncompress the tarball/gzip
tar -zxvf jrrd-1.0.1.tar.gz

## change to the directory you just extracted the source into
cd jrrd-1.0.1

### compile and install
./configure
make
make install



##############################################################################################################
#################################################################################
### Download and install iplike
#################################################################################
##############################################################################################################

#################################################################################
### this is the url that leads you there http://sourceforge.net/project/showfiles.php?group_id=4141
### I downloaded mine directly from http://easynews.dl.sourceforge.net/sourceforge/opennms/iplike-1.0.6.tar.gz

### uncompress the tarball/gzip
tar -zxvf iplike-1.0.6.tar.gz

## change to the directory you just extracted the source into
cd iplike-1.0.6

### compile and install
./configure
make
make install


##############################################################################################################
#################################################################################
### Download and install opennms 
#################################################################################
##############################################################################################################

#################################################################################
### this is the url that leads you there http://sourceforge.net/project/showfiles.php?group_id=4141
### I downloaded mine directly from http://easynews.dl.sourceforge.net/sourceforge/opennms/opennms-source-1.3.6-1.tar.gz

### uncompress the tarball/gzip
tar -zxvf opennms-source-1.3.6-1.tar.gz

### copy the maven files to the /usr/local
cp -R opennms-1.3.6-1/source/maven /usr/local

### set the maven binary directory in your path so the opennms compile/install procedure can find it
### I like to add this to my /etc/profile
export PATH=/usr/local/maven/bin:$PATH

### change to the source directory for opennms
cd opennms-1.3.6-1/source/


### something may overwrite your JAVA_HOME so lets export it again (haven't figured this one out)
export JAVA_HOME=/usr/local/jdk1.5.0_12

### compile your opennms
### NOTE: occasionally i've saw this step fail, usually indicating some sort of build failure
### I'm not sure why/how this happens, but I've found that deleting the contents of the directory /.m2/repository
### and running your build command again will solve it *shrugs*

./build.sh -Dopennms.home=/usr/local/opennms install assembly:attached

### make the directory you are going to install opennms into
mkdir /usr/local/opennms

### copy the tarball/gzip you created to the correct location
cp opennms-1.3.6-1/source/target/opennms-1.3.6.tar.gz /usr/local/opennms

### move to that location
cd /usr/local/opennms

### uncompress your tarball/gzip
tar -zxvf opennms-1.3.6.tar.gz

### change a few file permissions to make things work
chmod +x bin/*
chmod +x contrib/*
chmod -x contrib/*.README
chmod -x contrib/opennms.mib

### tell opennms which java to use
bin/runjava -s

### install opennms
bin/install -disU -l /usr/local/lib

### install the web application
bin/install -y -w /usr/local/apache-tomcat-5.5.23/conf/Catalina/localhost -l /usr/local/lib

### set opennms to use rrdtool
### opennms uses jrobin by default, it's said to have better performance
### THIS IS NOT A NECESSARY STEP, I ONLY DO IT BECAUSE I HAVE APPLICATIONS
### ALREADY WRITTEN THAT KNOW HOW TO USE THE rrdtool FORMAT, AND AT THE MOMENT
### I DON'T FEEL THE NEED TO LEARN AND REWRITE THEM IN JAVA

###Find the lines in rrd-configuration.properties that look like the following

#org.opennms.rrd.strategyClass=org.opennms.netmgt.rrd.rrdtool.JniRrdStrategy
#org.opennms.rrd.interfaceJar=/usr/share/java/jrrd.jar
#opennms.library.jrrd=/usr/lib/libjrrd.jnilib

### change the lines to read like the following

org.opennms.rrd.strategyClass=org.opennms.netmgt.rrd.rrdtool.JniRrdStrategy
org.opennms.rrd.interfaceJar=/usr/local/share/java/jrrd.jar
opennms.library.jrrd=/usr/local/lib/libjrrd.so



############################################################
### start opennms as follows
############################################################
/usr/local/opennms/bin/opennms start