OpenNMS on openSUSE 10.x
Novell Cool Solutions: Feature
By Fahim Siddiqui
Digg This -
Posted: 29 May 2007
OpenNMS is the world's first enterprise-grade network management system developed under the open source model. As with any complex and powerful system, getting it installed and configured can take a little effort. It is the purpose of this document to explain what is required to get OpenNMS installed on openSUSE 10.1 or 10.2.
This document is written using OpenSUSE v10.1.
Preparing for install
On OpenNMS source forge site: http://sourceforge.net/project/showfiles.php?group_id=4141&package_id=155187&release_id=465270 ; there are three downloadable files listed for SuSe 10 distro, namely:
Before you start to install, OpenNMS v1.2.9, make sure that you have the following packages installed. They are available on the CD/DVD media of SUSE 10.1.
Use Yast to install the following packages.
- All 'jakarta-commons-***' packages (to keep it simple)
- rrdtool-1.2.12-13.i586.rpm ; open-source network management tool
- postgresql-8.1.3-12.i586.rpm ; postgresql-server
- java-1_4_2-sun-188.8.131.52-8.i586.rpm ; Sun's Java 2 Platform, version 1.4.2
Apart from those available on CD/DVD Media, you need to download and install the following rpm's too from the website:
Download and Copy the rpms below inside the root/home folder and use "Right Click" button -> Install.
OpenSUSE 10.1 ships with Tomcat 5, which will not work with OpenNMS straighaway, before we perform a few tweaks. Tomcat 5 packages are not available on the CD/DVD media and needs to be downloaded from the following link:
The above three packages also should be installed, using Right Click on RPM package and choosing install. If a few dependencies remains to be put in place, search the SUSE's CD/DVD first and then hit upon the download link (given above).
If the rpm is a downloaded one rather than picked up from SUSE's own media, do not use 'Install with Yast' option rather always work with Right Click -> Install.
Once the three Tomcat packages have been put in place, it's time to start installation of OpenNMS.
But just to test whether your Tomcat is up and running you can do a:
# /etc/init.d/tomcat5 startBrowse locally to http://localhost:8080
You should see the picture of Tomcat. If not, try to google and sort out this problem first.
Hoping you saw the tomcat pic earlier in your browser windows, we will proceed with the installation of: opennms-1.2.9-1_suse10.i586.rpm (RightClick on rpm file -> Install)
Second, install, 'opennms-docs-1.2.9-1_suse10.i586.rpm'.
Third: (Open a terminal windows) # rpm -i opennms-webapp-1.2.9-1_suse10.i586.rpm --nodeps
Note: We choose to use 'command line' for opennms-webapp, because of current inability of OpenNMS to talk to Tomcat 5 directly.
If you try to do the Right-Click on this rpm (opennms-webapp), you might be confronted with a message, 'There are no installable providers of Tomcat >= 4.1.18 for opennms-webapp-1.2.9-1_suse10.i586 [Local packages]'
Now, it's time to tweak OpenNMS a bit to work with Tomcat 5.
Alt+F2 will open SuSe's text editor - Kate (You can use vi line editor too).
Browse to (/opt/OpenNMS/webapps/opennms.xml) and comment-out the "<Logger ... />" tag. The file should now look something like this: (Do a complete copy-paste of the proceeding lines, if you wish, overwriting all the contents of the opennms.xml).
<Context path="/opennms" docBase="/opt/OpenNMS/webapps/opennms" debug="0" reloadable="true"> <!-- <Logger className="org.opennms.web.log.Log4JLogger" homeDir="/opt/OpenNMS" /> --> <Realm className="org.opennms.web.authenticate.OpenNMSTomcatRealm" homeDir="/opt/OpenNMS" /> </Context>
Installing the PostgreSQL on SuSe 10.1
Once you have installed postgresql v 8.1 using YasT, it's time to configure this database settings.
Postgres configuration files: postgresql.conf and pg_hba.conf. These files are only created once Postgres has been started. Usually, startup scripts will be placed in /etc/init.d.
So, try to start and stop postgres server.
/etc/init.d/postgres start /etc/init.d/postgres stop
Now, you will have to customise the postgresql.conf file.
This file controls some basic parameters of Postgres. We need to change two of these parameters.
Find the line in the file that contains max_connections. It needs to read:
max_connections = 256
Find the line that contains shared_buffers. It needs to read:
shared_buffers = 1024
Also, you'll need to made a few edits to the pg_hba.conf file.
The pg_hba.conf file controls which machines and users can access the database on a given machine via TCP/IP.
Since that is how OpenNMS accesses the database (via localhost) it is necessary to modify this file to allow OpenNMS to work. The easiest thing to do is to just allow anyone from the localhost to access the database.
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD local all all trust host all all 127.0.0.1 255.255.255.255 trust
Make sure that no other lines are uncommented in this file.
You will need to again stop and restart Postgres after making these changes.
Configure Java for OpenNMS
OpenNMS needs to be configured to use an appropriate Java Runtime Environment (JRE). The OpenNMS tool runjava is used to set this up, and it can either search for a suitable JRE or you can tell it exactly which JRE to use. We will let it search by itself.
# /opt/OpenNMS/bin/runjava ?s
The output should resemble something like this:
runjava: Looking for an appropriate JRE... runjava: Checking for an appropriate JRE in JAVA_HOME... runjava: found: "/usr/lib/jvm/java/bin/java" is an appropriate JRE runjava: value of "/usr/lib/jvm/java/bin/java" stored in configuration file
Run the Installer to Setup the PostgreSQL Database
# /opt/OpenNMS/etc # /opt/OpenNMS/bin/install -disU
The output should resemble, as below:
===================================== OpenNMS Installer Version $Id: Installer.java 3056 2006-03-26 19:39:16Z djgregor $ ====================================== Configures PostgreSQL tables, users, and other miscellaneous settings. - checking database version... 8.1 - Full version string: PostgreSQL 8.1.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.0 (SUSE Linux) * 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 SQL directory... /opt/OpenNMS/etc . . /srv/www/tomcat5/base/server/lib/opennms_web.jar... DONE - Installing OpenNMS webapp... DONE Installer completed successfully!
Restart postgressql # /etc/init.d/postgresql stop # /etc/init.d/postgresql start
Finally, run the OpenNMS Installer to Setup the Web Application.
# /opt/OpenNMS/bin/install -y -w /srv/www/tomcat5/base/conf/Catalina/localhost -W /srv/www/tomcat5/base/server/lib
============================================= OpenNMS Installer Version $Id: Installer.java 3056 2006-03-26 19:39: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 Top-level web application directory... /srv/www/tomcat5/base/conf/Catalina/localhost - using Tomcat server library directory... /srv/www/tomcat5/base/server/lib - using OpenNMS webapps directory... /opt/OpenNMS/webapps - Checking for old opennms webapp directory in /srv/www/tomcat5/base/conf/Catalina/localhost/opennms... OK - Checking for old opennms context in /srv/www/tomcat5/base/conf/Catalina/localhost/../conf/server.xml... DID NOT CHECK (file does not exist) - Install OpenNMS webapp... - creating link to /srv/www/tomcat5/base/conf/Catalina/localhost/opennms.xml... DONE . ?<snipped for brevity> . - creating link to /srv/www/tomcat5/base/server/lib/opennms_web.jar... DONE - Installing OpenNMS webapp... DONE Installer completed successfully!
# /etc/init.d/postgresql stop # /etc/init.d/postgresql start Starting PostgreSQL done # /etc/init.d/tomcat5 stop # /etc/init.d/tomcat5 start Starting Tomcat (/srv/www/tomcat5/base/) done # /etc/init.d/opennms start Starting OpenNMS: done Launch Firefox, Opera or Mozilla http://localhost:8080/opennms Username: admin Password: admin
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com