Tuesday, May 20, 2008

Install OpenNMS on Ubuntu 8.04 Hardy Heron

OpenNMS is the world's first enterprise grade network management platform developed under the open source model. It consists of a community supported open-source project as well as a commercial services, training, and support organization.

Do tou know how to install OpenNMS easily on Ubuntu??
Here is step-by step for the installation instruction.
It's very easy, simple, just follow it.


1. Add OpenNMS Repository on your /etc/apt/sources.list :
deb http://debian.opennms.org/ stable main
deb-src http://debian.opennms.org/ stable main

Or, if you want to install the newest and unstable version of OpenNMS, please put this on your /etc/apt/sources.list :

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

After this, run apt-get update to check the OpenNMS repository.

2. Add OpenNMS PGP Key to apt
OpenNMS Debian repository sign by PGP Key. APT must know the repository of OpenNMS by using :
wget -O - http://debian.opennms.org/OPENNMS-GPG-KEY | sudo apt-key add -

3. Install Sun JDK (in this case i use java6). Use command this :
sudo apt-get install sun-java6-jdk
After installed Java, check the version of Java :
$ java -version
If there is not stated "Java HotSpot", maybe this is not Sun JVM, so the default must be changed by using :
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
Choose the option for Sun JVM, enter by typing the number of option.
Add environment Java in /etc/environment :
JAVA_HOME="/usr/lib/jvm/java-6-sun"
JDK_HOME="/usr/lib/jvm/java-6-sun"
Restart /etc/environment by using command :
. ./etc/environment
Note! This comment must be run on #root.

4. Download OpenNMS
export SKIP_IPLIKE_INSTALL=1
sudo apt-get install opennms
Configure environment OpenNMS before continuing :
export OPENNMS_HOME=/usr/share/opennms

5. Install and Configure Tomcat
Install Tomcat terbaru (5.5) by using :
sudo apt-get install tomcat5.5 tomcat5.5-webapps tomcat5.5-admin
Change PortNumber “8180” to “8080” in file /etc/tomcat5.5/server.xml
Open file /etc/default/tomcat5.5, after that change some of the line :
TOMCAT5_USER=root
JAVA_HOME=/usr/lib/jvm/java-6-sun
And then Restart Tomcat.

6. Install and Configure Postgresql
Install postgresql by using commands :
sudo apt-get install postgresql-8.2 iplike-pgsql82
Open configuration file in /etc/postgresql/8.2/main/pg_hba.conf, and then add some line before "DO NOT DISABLE"
#TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
local all all trust
host all all 127.0.0.1 255.255.255.255 trust
host all all ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff trust
And then, open the configuration file on :
/etc/postgresql/8.2/main/postgresql.conf and then uncomment the line below :
listen_addresses = ‘localhost'
after that restart postgresql.

7. Initialitation OpenNMS and DataBase
To run installer of OpenNMS, use command below :
sudo $OPENNMS_HOME/bin/install -disU -l /usr/lib/jni:/usr/lib

8. Install install_iplike.sh
sudo /usr/sbin/install_iplike.sh

9. Configure Discovery Rule
In order to collect the data from your network, we must configure rule of discovery in /etc/opennms/discovery-configuration.xml
Enter the range of IP address that you want to monitor.

10. Configure webapp on Tomcat
sudo $OPENNMS_HOME/bin/install -l /usr/lib/jni/ -y -w /var/lib/tomcat5.5/conf/Catalina/localhost

11. Final Configuration
Restart Tomcat, PostgreSQL, dan start OpenNMS
$ sudo /etc/init.d/tomcat5.5 restart
$ sudo /etc/init.d/postgresql-8.2 restart
$ sudo /etc/init.d/opennms start

12. Open the browser to view OpenNMS WEB Interface.

To view it, use address http://(your_ip_address):8980/opennms.
Login by using username and password : admin

opennms-front.jpg