Login
New User

Welcome to destr0yr's asylum
Monday, October 06 2008 @ 07:58 AM PDT

Linux: OpenNMS 1.3.2 on CentOS 4.4

LinuxNote:Some visitors have reported errors following these steps. Please see the comments at the bottom of the page before proceeding. I would recommend testing this in a Virtual Environment using any Virtualization software such as SWSoft's Virtuozzo, Microsoft Virtual Server 2003 R2 SP1, VMWare, etc. You have been warned!

The following describes my successful installation of the following applications on a CentOS 4.4 virtual environment running under Virtuozzo 3.0.0:

JRE 1.5.0 Update 11
JDK 1.5.0 Update 11
Tomcat 5.5.20
Postgresql 7.4.16
rrdtool 1.2.18
OpenNMS 1.3.2
Install Java: Head on over to http://java.sun.com and download JRE & JDK 5.  You'll need at least JDK 5.0 & JRE 5.0 Update 6 (I assume earlier and later versions work - I just happened to use these).

Download the files to any directory you like.  I personally prefer /usr/local/src/

# mkdir /usr/local/java
# cd /usr/local/src
# cp jdk-1_5_0_11-linux-i586.bin /usr/local/java
# cp jre-1_5_0_11-linux-i586.bin /usr/local/java
# cd /usr/local/java // (UPDATE!)
# chmod +x j*.bin
# ./jdk-1_5_0_11-linux-i586.bin
...
Creating jdk1.5.0_11/jre/lib/jsse.jar
Creating jdk1.5.0_11/jre/lib/charsets.jar
Creating jdk1.5.0_11/jre/lib/ext/localedata.jar
Creating jdk1.5.0_11/jre/lib/plugin.jar
Creating jdk1.5.0_11/jre/lib/javaws.jar
Creating jdk1.5.0_11/jre/lib/deploy.jar

Done.
# ./jre-1_5_0_11-linux-i586.bin
    linking: jre1.5.0_11/javaws/javaws  -> ../bin/javaws
Creating jre1.5.0_11/lib/rt.jar
Creating jre1.5.0_11/lib/jsse.jar
Creating jre1.5.0_11/lib/charsets.jar
Creating jre1.5.0_11/lib/ext/localedata.jar
Creating jre1.5.0_11/lib/plugin.jar
Creating jre1.5.0_11/lib/javaws.jar
Creating jre1.5.0_11/lib/deploy.jar

Done.
# chown -R root:root jdk1.5.0_11
# chown -R root:root jre1.5.0_11 // I had a typo here.
# ln -s jdk1.5.0_11 j2sdk
# ln -s jre1.5.0_11 j2jre // I hade a typo here too!

Here's what the directory looks like:

[root@opennms java]# pwd
/usr/local/java
[root@opennms java]# ls -FGg
total 65216
lrwxrwxrwx  1       11 Apr 20 12:35 j2jre -> jre1.5.0_11/
lrwxrwxrwx  1       11 Apr 20 12:34 j2sdk -> jdk1.5.0_11/
-rwxr-xr-x  1 49574613 Apr 20 12:22 jdk-1_5_0_11-linux-i586.bin*
drwxr-xr-x  9     4096 Dec 15 04:36 jdk1.5.0_11/
-rwxr-xr-x  1 17115102 Apr 20 12:22 jre-1_5_0_11-linux-i586.bin*
drwxr-xr-x  7     4096 Dec 15 04:34 jre1.5.0_11/

Continuing on...
# rm *.bin
# vi /etc/profile

In /etc/profile, look for:

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC


Between it (above "export" and below "fi"), add:

if ! echo ${PATH} | grep -q /usr/local/java/j2sdk/bin ; then
export PATH=/usr/local/java/j2sdk/bin:${PATH}
fi
if ! echo ${PATH} | grep -q /usr/local/java/j2re/bin ; then
export PATH=/usr/java/local/j2re/bin:${PATH}
fi
export JAVA_HOME=/usr/local/java/j2sdk
export CLASSPATH=.:/usr/local/java/j2sdk/lib/tools.jar:/usr/local/java/j2re/lib/rt.jar


Exit the system and log back in, or source /etc/profile, and verify that java can be found and the correct version is reported:

# source /etc/profile
# java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)


Install Tomcat:

# cd /usr/local/src
# groupadd -g 220 tomcat
# useradd -u 220 -g tomcat -c "Tomcat" -r -d /usr/local/tomcat -s "/sbin/nologin" tomcat


OpenNMS 1.3.2 requires Tomcat 5.5 (or better). Do not attempt to use earlier versions!

# wget http://apache.mirrors.northco.net/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat-5.5.20.tar.gz
# tar xfvz apache-tomcat-5.5.20.tar.gz -C /usr/local
# cd /usr/local
# chown -R tomcat:tomcat /usr/local/apache-tomcat-5.5.20
# ln -s apache-tomcat-5.5.20 tomcat

Edit your iptables config, /etc/sysconfig/iptables, to allow port 8080. Restart iptables (service itpables restart) for the settings to take affect.

# vi /etc/profile

Look for:

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC


Above it, add:

CATALINA_HOME=/usr/local/tomcat

Save and exit the file, now run:

# source /etc/profile
# echo $CATALINA_HOME
/usr/local/tomcat

Make sure that the path is returned when you execute "echo $CATALINA_HOME" before continuing.

Now create a startup script. Edit /etc/rc.d/init.d/tomcat and add:

#!/bin/sh
#
# Startup script for the Jakarta Tomcat Java Servlets and JSP server
#
# chkconfig: - 85 15
# description: Jakarta Tomcat Java Servlets and JSP server
# processname: tomcat
# pidfile: /var/run/tomcat.pid # config:

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0# Set Tomcat environment.
export JAVA_HOME=/usr/local/java/j2sdk
export CLASSPATH=.:/usr/local/java/j2sdk/lib/tools.jar:/usr/local/java/j2re/lib/rt.jar
export CATALINA_HOME=/usr/local/tomcat
export CATALINA_OPTS="-Dbuild.compiler.emacs=true"
export PATH=/usr/local/java/j2sdk/bin:/usr/local/local/j2re/bin:$PATH

[ -f /usr/local/tomcat/bin/startup.sh ] || exit 0 [ -f /usr/local/tomcat/bin/shutdown.sh ] || exit 0

export PATH=$PATH:/usr/bin:/usr/local/bin

# See how we were called.
case "$1" in
start)
# Start daemon.
echo -n "Starting Tomcat: "
/usr/local/tomcat/bin/startup.sh
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/tomcat ;;
stop)
# Stop daemons.
echo -n "Shutting down Tomcat: "
/usr/local/tomcat/bin/shutdown.sh
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/tomcat ;;
restart)
$0 stop
$0 start
;;
condrestart)
[ -e /var/lock/subsys/tomcat ] && $0 restart ;;
status)
status tomcat
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac

exit 0

Make the script executable, add tomcat to startup and actually start it:

# chown root:root /etc/rc.d/init.d/tomcat
# chmod 755 /etc/rc.d/init.d/tomcat
# chkconfig --add tomcat
# chkconfig tomcat on
# service tomcat start
Starting Tomcat: Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:       /usr/local/java/j2sdk

Browse to http://localhost:8080. (or the your IP:8080).  You should see:
"If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!"

If not, something broke.  Stop here.  Do not pass go!  Check your error logs (ie. catalina.out) for errors!

Get RPMForge (Dag!)

# wget http://dag.wieers.com/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
# rpm -Uvh rpmforge*

Note: rpmforge is required to install RRDTool.

Install RRDTool

# yum -y install rrdtool

Install & Configure Postgresql

# yum -y install postgresql-server
# service postgresql start
Initializing database:                                     [  OK  ]
Starting postgresql service:                               [  OK  ]
# chkconfig postgresql on
# vi /var/lib/pgsql/data/postgresql.conf

Look for the following and make the changes as required:

tcpip_socket = true
shared_buffers = 1024
max_connections = 256

Now edit /var/lib/pgsql/data/pg_hba.conf:

# vi /var/lib/pgsql/data/pg_hba.conf

Change the following:

host all all 127.0.0.1 255.255.255.255 trust # (this line is commented, simply remove the comment)
local all all trust

Save & exit both files. Restart postgresql:

# service postgresql restart

Download & install OpenNMS 1.3.2

# cd /usr/local/src
# wget http://easynews.dl.sourceforge.net/sourceforge/opennms/opennms-1.3.2-3_centos4.i386.rpm
# wget http://easynews.dl.sourceforge.net/sourceforge/opennms/opennms-docs-1.3.2-3_centos4.i386.rpm
# wget http://easynews.dl.sourceforge.net/sourceforge/opennms/opennms-webapp-1.3.2-3_centos4.i386.rpm
# rpm -i opennms-1.3.2-3_centos4.i386.rpm
warning: opennms-1.3.2-3_centos4.i386.rpm: V3 DSA signature: NOKEY, key ID 4c4cbbd9
- 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.
# rpm -i opennms-docs-1.3.2-3_centos4.i386.rpm
# rpm -i opennms-webapp-1.3.2-3_centos4.i386.rpm
# cd /opt/opennms/bin
# ./runjava -s
runjava: Looking for an appropriate JRE...
runjava: Checking for an appropriate JRE in JAVA_HOME...
runjava: found: "/usr/local/java/j2sdk/bin/java" is an appropriate JRE
runjava: value of "/usr/local/java/j2sdk/bin/java" stored in configuration file

# ./install -dis
...
  - checking table "qrtz_blob_triggers"... CREATED
  - checking table "qrtz_trigger_listeners"...
  - checking table "qrtz_trigger_listeners"... CREATED
  - checking table "qrtz_calendars"...
  - checking table "qrtz_calendars"... CREATED
  - checking table "qrtz_paused_trigger_grps"...
  - checking table "qrtz_paused_trigger_grps"... CREATED
  - checking table "qrtz_fired_triggers"...
  - checking table "qrtz_fired_triggers"... CREATED
  - checking table "qrtz_scheduler_state"...
  - checking table "qrtz_scheduler_state"... CREATED
  - checking table "qrtz_locks"...
  - checking table "qrtz_locks"... CREATED
- creating tables... DONE
- inserting initial table data for "distPoller"... OK
- inserting initial table data for "qrtz_locks"... OK
- checking for stale iplike references... CLEAN
- checking for stale eventtime.so references... CLEAN
- adding iplike database function... OK

Installer completed successfully!

# ./install -y -w $CATALINA_HOME/conf/Catalina/localhost
==============================================================================
OpenNMS Installer Version $Id: Installer.java 4833 2006-10-18 19:07:16Z djgregor $
==============================================================================

Configures PostgreSQL tables, users, and other miscellaneous settings.

* using 'opennms' as the PostgreSQL user for OpenNMS
* using 'opennms' as the PostgreSQL password for OpenNMS
* using 'opennms' as the PostgreSQL database name for OpenNMS
- using Tomcat context directory... /usr/local/tomcat/conf/Catalina/localhost
- using OpenNMS servlet directory... /opt/opennms/webapps/opennms
- Checking for old opennms webapp directory in /usr/local/tomcat/conf/Catalina/localhost/opennms... OK
- Checking for old opennms context in /usr/local/tomcat/conf/Catalina/localhost/../conf/server.xml... DID NOT CHECK (file does not exist)
- Install OpenNMS webapp...
  - creating link to /usr/local/tomcat/conf/Catalina/localhost/opennms.xml... DONE
- Installing OpenNMS webapp... DONE

Installer completed successfully!

Notes: --nodeps may be required if tomcat is found not to be installed (RPM dep.)
$CATALINA_HOME is the base directory of your Tomcat installation

If you do not see "Installer completed successfully!", something is broken!

# cd /opt/opennms/etc
# vi discovery-configuration.xml
(edit the <begin> and <end> IP's to 127.0.0.1 for now)
# service tomcat restart
Shutting down Tomcat: Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:       /usr/local/java/j2sdk

Starting Tomcat: Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:       /usr/local/java/j2sdk

# /opt/opennms/bin/opennms start
Starting OpenNMS:                                          [  OK  ]
# chkconfig opennms on
# /opt/opennms/bin/opennms -v status
opennms is running

Browse to: http://localhost:8080/opennms/
Login with admin/admin and change your password immediately.
Configuring SNMP # yum -y install net-snmp-utils
# cd /etc/snmp
# mv snmpd.conf snmpd.conf.old
# vi snmpd.conf
Add: rocommunity
# chkconfig snmpd on
# service snmpd start
# snmpwalk -v 1 -c localhost system



This method is not limited to virtual servers and should work on dedicated servers as well as other virtual applications such as Microsoft Virtual Server 2005 R2 & VMware.

This post is, largely, just a re-write of Todd Reed's post over at http://lists.centos.org/pipermail/centos/2005-October/054306.html. I've only updated the versions and added a command or two where needed.

Also a shout out to djgregor at irc.freenode.net in #opennms for helping with my PEBKAC.
Finally, I recommend all users read docs for 1.3.2: http://www.opennms.org/documentation/InstallUnStable.html

Story Options

Trackback

Trackback URL for this entry: http://www.destr0yr.com/trackback.php/Linux-OpenNMS_1.3.2_on_CentOS_4.4

No trackback comments for this entry.
Linux: OpenNMS 1.3.2 on CentOS 4.4 | 8 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Linux: OpenNMS 1.3.2 on CentOS 4.4
Authored by: Anonymous on Friday, March 30 2007 @ 02:50 PM PDT
You have an error in your instructions:

This:
cd /etc/opennms/etc
# vi discovery-configuration.xml

Should be this:
cd /opt/opennms/etc
# vi discovery-configuration.xml


Also, following your instructions verbatim I get the following error when running ./install -dis :

Exception in thread "main" org.postgresql.util.PSQLException: ERROR: failed to re-find parent key in "pg_attribute_relid_attnam_index" for split pages 28/29
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1525)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1309)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:340)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:332)
at org.opennms.netmgt.dao.db.InstallerDb.createTables(InstallerDb.java:624)
at org.opennms.install.Installer.install(Installer.java:208)
at org.opennms.install.Installer.main(Installer.java:729)



And a opennms won't start, any help would be appreciated since you've got me closer than any of the other instructions I've followed:

/opt/opennms/bin/opennms start
/opt/opennms/bin/opennms: OpenNMS not configured.
/opt/opennms/etc/configured does not exist.
You need to run the installer to setup the database -- see the
install guide for details.
Linux: OpenNMS 1.3.2 on CentOS 4.4
Authored by: Anonymous on Friday, April 13 2007 @ 12:31 PM PDT
Thank you for creating and maintaining this website.
Linux: OpenNMS 1.3.2 on CentOS 4.4
Authored by: Anonymous on Thursday, April 19 2007 @ 06:43 PM PDT
Thanks destr0yr for your site.
I got most of the setup going on centos 4.4 install on my laptop.

When I get to the step


Browse to: http://localhost:8080/opennms/

I get an error
---------------------------------------------------------------------------------
HTTP Status 404 - /opennms/

type Status report

message /opennms/

description The requested resource (/opennms/) is not available.
Apache Tomcat/5.5.20

-----------------------------------------------------

Any help would be much appreicated.
Linux: OpenNMS 1.3.2 on CentOS 4.4
Authored by: Anonymous on Thursday, June 21 2007 @ 03:34 AM PDT
I also get:

---------------------------------------------------------------------------------
HTTP Status 404 - /opennms/

type Status report

message /opennms/

description The requested resource (/opennms/) is not available.
Apache Tomcat/5.5.20