Install OpenNMS 1.2.9 on Debian Sarge 3.1 – 32 bit Platform

Last Updated on Friday, 20 June o 09:18 Written by admin Tuesday, 10 April o 05:01

OpenNMS is the world’s first enterprise grade network management platform developed under the open source model.

Step One
We need to edit the sources.list file to have the following.


deb http://debian.opennms.org/ /debian/opennms stable

Do an:

apt-get update

and

apt-get upgrade

on your system

If you have a cd that you want to add to the aptitude source, run this command:

apt-cdrom add

Step Two
We need to install necessary Files to prevent any dependency problems.
This is a large list but this has prevented a lot of issues when building from source, especially with Java.

apt-get install build-essential netbase libc6 initrd-tools libssl0.9.8 ssh flex libarchive-zip-perl libpcre3 libpopt-dev lynx ncftp nmap openssl unzip zip zlib1g-dev automake1.8 libtool bison liblockfile1 libgd2-noxpm gawk ledit oidentd xml-core libpg-perl libdbd-pg-perl libexpat1 libgetopt-mixed-perl update-inetd

apt-get install libgtk-perl curl libft-perl rrdtool fakeroot binutils-doc cpp-2.95-doc debian-keyring libgcj7-jar libgcj-common libgcj7-0 libgcj7-dev manpages-dev gdb gcc-2.95-doc glibc-doc diff-doc cvs gettext-doc libfreetype6-dev libgd-tools dbishell libio-socket-ssl-perl dfontmgr psfontmgr librrds-perl freetype1-tools libatk1.0-data libglib2.0-data ttf-thryomanes

apt-get install gs-gpl gs-esp gsfonts debconf-utils dh-make ant equivs ttf-baekmuk libdbd-mysql-perl libdbd-odbc-perl libgd2-noxpm-dev libgtkxmhtml-perl tetex-bin t1utils psutils libunicode-string-perl ant-doc devscripts-el cvs-buildpackage dupload dput gnuplot libtimedate-perl lintian linda mutt patchutils wdiff

apt-get install xfs libmyodbc libpaper-utils gs-gpl gs tetex-doc perl-tk dlocate libbsf-java liboro-java junit liblog4j1.2-java libregexp-java libbcel-java libcommons-logging-java libjdepend-java libgnumail-java libxml-commons-resolver1.1-java libcommons-net-java libjsch-java javacc gnus emacs-wiki mhc cjk-latex libauthen-pam-perl libio-pty-perl libmd5-perl unixodbc-bin webxml bzip2

We need to install Postgressql where the database will reside for OpenNMS

apt-get install postgresql postgresql-plpython-7.4 postgresql-plperl-7.4 postgresql-pltcl-7.4 odbc-postgresql libnet-snmp-perl

Set Environment variable for POSTGRES_HOME. Insert the following entries in /etc/profile.

POSTGRES_HOME="/etc/postgresql/7.4"
export POSTGRES_HOME

Now in your console type:

source /etc/profile

This is to read the profile file and make the POSTGRES_HOME variable work.

Customizing the postgresql.conf file in /etc/postgresql/7.4/main
This file controls some basic parameters of Postgres. We need to change three of these parameters.

1. Find the line in the file that contains tcpip_socket. It needs to read (this can be ignored on PostgreSQL 8.0 and later as this is the default):

* tcpip_socket = true
Make sure that there is no comment character (“#”) in front of that line (or the other two that you change).This will enable OpenNMS to talk to the database.

2. Find the line in the file that contains max_connections.It needs to read:

* max_connections = 256

3. Find the line that contains shared_buffers.It needs to read:

* shared_buffers = 1024

Customizing the pg_hba.conf file in /etc/postgresql/7.4/main
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 (do not add the last line if your system does not support IPv6):

#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

Make sure that no other lines are uncommented in this file.You will need to restart Postgres after making these changes.
Path to stop and start PGSQL >> /etc/init.d/postgresql-7.4 restart

Step Three
We will need to install Webmin to help manage the database and permissions for OpenNMS

wget http://prdownloads.sourceforge.net/webadmin/webmin_1.340_all.deb

We now need to install webmin

dpkg -i webmin_1.340_all.deb

Connect to webmin –> https://localhost:10000

Step Four
Install JAVA
You have two options here.
1. You can download the Java package with Lynx through your console.
2. Download the Java package with a Web Browser and copy the package to your /usr/src folder on your box.

Option 1

lynx http://java.sun.com/j2se/1.4.2/download.html

1.1 Navigate down the page using the pgdown key, or by pressing the down arrow about 53 times to the Download J2SE SDK link and select the link using the Enter key.Accept the cookie (press y) if it asks you too otherwise the browsing of this site wont work.
1.2 You might get an SSL error:Can’t find common name in certificate-Continue? (y) prompt during the next steps.Just hit the y key if you see this.
1.3 On the following page (Download Center) navigate using the pgdown key, or by pressing the down arrow about 14 times to the Continue link and select the link using the Enter key. This accepts the license agreement.
1.4 You might get an SSL error:Can’t find common name in certificate-Continue? (y) prompt during the next steps.Just hit the y key if you see this.
1.5 On the same page, having accepted Sun’s license agreement, navigate using the pgdown key, or by pressing the down arrow about 19 times to the Download Now! self-extracting file j2sdk-1_4_2_14-linux-i586.bin 34.68 MB link and select it using the Enter key.
1.6 Press d to download the binary file.Once the download is complete, navigate with the down arrow to the Save to disk link and press Enter twice to save the downloaded file to the local disk.Type q to exit.
1.7 The saved file name would look something like this: j2sdk-1_4_2_14-linux-i586.bin&File=j2sdk-1_4_2_14-linux-i586.bin
1.8 We now move the downloaded .bin into /usr/src.
We now want to rename the file and move it with this command:

mv j2sdk-1_4_2_14-linux-i586.bin&File=j2sdk-1_4_2_14-linux-i586.bin /usr/src/j2sdk-1_4_2_14-linux-i586.bin

Option 2
It is pretty much the same as option one, but you are only downloading the Java package with a web browser.

Building and installing a j2sdk1.4 package
Use the sun-jdk1.4-installer package and build script to build your own j2sdk1.4 package.
The java-common package is a dependency for the j2sdk1.4 package you will be creating, and since it will be installed by dpkg, apt will not be there to pull it in so install it first:

apt-get install java-common

Next, install the sun-jdk1.4-installer package:

apt-get install sun-jdk1.4-installer

Run the following command in the directory where you moved the Java file to”/usr/src” to build the package:

build-sun-jdk14 ./j2sdk-1_4_2_14-linux-i586.bin

where j2sdk-1_4_2_14-linux-i586.bin is the binary file you downloaded from Sun.
And finally install the package:

dpkg -i j2sdk1.4_1.4.2-1_i386.deb

where j2sdk1.4_1.4.2-1_i386.deb is the Debian package that was just created by build-sun-jdk14.

If all goes well you should see something similar to this.
Selecting previously deselected package j2sdk1.4.
(Reading database … 72490 files and directories currently installed.)
Unpacking j2sdk1.4 (from j2sdk1.4_1.4.2-1_i386.deb) …
Setting up j2sdk1.4 (1.4.2-1) …

Set Environment variable for JAVA_HOME. Insert the following entries in /etc/profile.

JAVA_HOME="/usr/lib/j2sdk1.4"
export JAVA_HOME

Now in your console type:

source /etc/profile

This is to read the profile file and make the JAVA_HOME variable work.

Step Five
Tomcat 4 Installation

It is pretty easy to install tomcat for Debian as all packages can be installed via aptitude.
We need these three package for Tomcat.
* Core
* Administration Web Application
* JDK 1.4 Compatability Package

apt-get install tomcat4 tomcat4-admin tomcat4-webapps

Set Environment variable for CATALINA_HOME. Insert the following entries in /etc/profile.

CATALINA_HOME="/usr/share/tomcat4"
export CATALINA_HOME

Now in your console type:

source /etc/profile

This is to read the profile file and make the CATALINA_HOME variable work.

Test Tomcat: http://localhost:8180

Step Six
Opennms Installation

Required Files:

Libraries
* librrd0-jni
* librrd0
* libicmp-jni
* libiplike-pgsql
* libopennms-java

Opennms Files
* opennms-common
* opennms-contrib
* opennms-server
* opennms-db
* opennms
* opennms-webapp

Follow this procedure to install Opennms.

apt-get install librrd0-jni rrdtool librrd0 libicmp-jni libiplike-pgsql libopennms-java opennms-common opennms-contrib

We are going to install each application of Opennms to make sure that each one installs without errors and if there are we should resolve them before we carry on with the installation.

apt-get install opennms-db

apt-get install opennms-server

apt-get install opennms-webapp

If you get this error:
runjava: Could not find an appropriate JRE.
runjava: You can set a particular JRE by using
runjava: “runjava -S “.

We need to specify the path to our Java installation;
Go to /usr/share/opennms/bin folder.

./runjava -S /usr/lib/j2sdk1.4/bin/java

Your output should be something like this:
runjava: checking specified JRE: “/usr/lib/j2sdk1.4/bin/java”…
runjava: specified JRE is good.
runjava: value of “/usr/lib/j2sdk1.4/bin/java” stored in configuration file

apt-get install opennms

Setup Environment variable for OPENNMS_HOME.Insert the following entries in /etc/profile.

OPENNMS_HOME="/usr/share/opennms"
export OPENNMS_HOME

Now in your console type:

source /etc/profile

This is to read the profile file and make the OPENNMS_HOME variable work.

Run the Installer to Setup the PostgreSQL Database

$OPENNMS_HOME/bin/install -disU

in our case it is /usr/share/opennms/bin/install -disU

Your out put should be something like this.


=================================================================
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… 7.4
– Full version string: PostgreSQL 7.4.16 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
* 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… /usr/share/opennms/etc
- using create.sql… /usr/share/opennms/etc/create.sql
- using iplike module… /usr/lib/postgresql/lib/opennms/iplike.so
- checking database for old backup tables… NONE
- checking for rows that violate constraints… NONE
- creating tables…
– checking table “serverMap”… CREATED
– checking table “serviceMap”… CREATED
– checking table “distPoller”… CREATED
– checking table “node”… CREATED
– checking table “ipInterface”… CREATED
– checking table “snmpInterface”… CREATED
– checking table “service”… CREATED
– checking table “ifServices”… CREATED
– checking table “events”… CREATED
– checking table “outages”… CREATED
– checking table “vulnerabilities”… CREATED
– checking table “vulnPlugins”… CREATED
– checking table “notifications”… CREATED
– checking table “usersNotified”… CREATED
– checking table “assets”… CREATED
- creating tables… DONE
- creating sequences…
– checking “nodeNxtId” minimum value… 1
– removing sequence “nodeNxtId”… CLEAN
– creating sequence “nodeNxtId”… OK
– checking “serviceNxtId” minimum value… 1
– removing sequence “serviceNxtId”… CLEAN
– creating sequence “serviceNxtId”… OK
– checking “eventsNxtId” minimum value… 1
– removing sequence “eventsNxtId”… CLEAN
– creating sequence “eventsNxtId”… OK
– checking “outageNxtId” minimum value… 1
– removing sequence “outageNxtId”… CLEAN
– creating sequence “outageNxtId”… OK
– checking “notifyNxtId” minimum value… 1
– removing sequence “notifyNxtId”… CLEAN
– creating sequence “notifyNxtId”… OK
– checking “vulnNxtId” minimum value… 1
– removing sequence “vulnNxtId”… CLEAN
– creating sequence “vulnNxtId”… OK
- creating sequences… DONE
- creating indexes…
– creating index “server_name_idx”… OK
– creating index “servicemap_name_idx”… OK
– creating index “serviceMap_ipaddr_idx”… OK
– creating index “node_id_type_idx”… OK
– creating index “node_label_idx”… OK
– creating index “ipinterface_nodeid_ipaddr_ismanaged_idx”… OK
– creating index “ipinterface_ipaddr_ismanaged_idx”… OK
– creating index “ipinterface_ipaddr_idx”… OK
– creating index “ipinterface_nodeid_ismanaged_idx”… OK
– creating index “ipinterface_nodeid_idx”… OK
– creating index “snmpinterface_nodeid_ifindex_idx”… OK
– creating index “snmpinterface_nodeid_idx”… OK
– creating index “snmpinterface_ipaddr_idx”… OK
– creating index “ifservices_nodeid_ipaddr_status”… OK
– creating index “ifservices_nodeid_status”… OK
– creating index “ifservices_nodeid_idx”… OK
– creating index “ifservices_serviceid_idx”… OK
– creating index “ifservices_nodeid_serviceid_idx”… OK
– creating index “events_uei_idx”… OK
– creating index “events_nodeid_idx”… OK
– creating index “events_ipaddr_idx”… OK
– creating index “events_serviceid_idx”… OK
– creating index “events_time_idx”… OK
– creating index “events_severity_idx”… OK
– creating index “events_log_idx”… OK
– creating index “events_display_idx”… OK
– creating index “events_ackuser_idx”… OK
– creating index “events_acktime_idx”… OK
– creating index “outages_svclostid_idx”… OK
– creating index “outages_svcregainedid_idx”… OK
– creating index “outages_nodeid_idx”… OK
– creating index “outages_ipaddr_idx”… OK
– creating index “outages_serviceid_idx”… OK
– creating index “outages_regainedservice_idx”… OK
– creating index “vulnerabilities_nodeid_idx”… OK
– creating index “vulnerabilities_ipaddr_idx”… OK
– creating index “vulnerabilities_severity_idx”… OK
– creating index “vulnerabilities_port_idx”… OK
– creating index “vulnerabilities_protocol_idx”… OK
– creating index “vulnplugins_plugin_idx”… OK
– creating index “notifications_ipaddr_idx”… OK
– creating index “notifications_serviceid_idx”… OK
– creating index “notifications_eventid_idx”… OK
– creating index “notifications_respondtime_idx”… OK
– creating index “notifications_answeredby_idx”… OK
– creating index “userid_notifyid_idx”… OK
- creating indexes… DONE
- inserting initial table data for “distPoller”… OK
- checking if database “opennms” is unicode… ALREADY UNICODE
- checking for stale iplike references… CLEAN
- checking for stale eventtime.so references… CLEAN
- adding iplike database function… OK
- adding PL/pgSQL call handler… OK
- adding PL/pgSQL language module… OK
- adding stored procedures…
– getManagePercentAvailIntfWindow.sql… OK
– getManagePercentAvailNodeWindow.sql… OK
– getManagedOutageForIntfInWindow.sql… OK
– getManagedOutageForNodeInWindow.sql… OK
– getManagedServiceCountForIntf.sql… OK
– getManagedServiceCountForNode.sql… OK
– getOutageTimeInWindow.sql… OK
– getPercentAvailabilityInWindow.sql… OK

Installer completed successfully!

If you get an error about connection problems, make sure that you have edited the two files explained earlier and that you have restarted the Postgresql server.

Apply this Patch:

Edit the /var/lib/tomcat4/webapps/opennms.xml file in a text editor and apply this patch
Please make shure the local path matches your installation. It should look like this :

<Context path="/opennms" docBase="/usr/share/opennms/webapp"
debug="0" reloadable="true">
<!--<Logger className="org.opennms.web.log.Log4JLogger" homeDir="/usr/share/opennms" />-->
<Realm className="org.opennms.web.authenticate.OpenNMSTomcatRealm"
homeDir="/usr/share/opennms" />
</Context>

Restart PostgreSQL, Tomcat4, and OpenNMS
Your system should be like this but if not, find the appropriate paths.

/etc/init.d/postgresql-7.4 stop

/etc/init.d/postgresql-7.4 start

/usr/share/tomcat4/bin/shutdown.sh

/usr/share/tomcat4/bin/startup.sh

Start the OpenNMS

/etc/init.d/opennms start

then Start the OpenNMS daemon

$OPENNMS_HOME/bin/opennms.sh start

OK
Point your browser to http://machine_ip:8180/opennms
You should be prompted for a user name and password, which is:

username: admin
Pass: admin

Issues that will arrise.

1. When you try to change any settings in the web console you will get java errors about permissions when you try to save any changes.
2. Creating reports in pdf and html does not work. Once again permissions and extra packages to be installed.
3. Read and Read more on the OPenNMS website.

Solutions

1. The owner of the files giving errors should be Tomcat4.Because OpeNMS uses Tomcat4 to run, Tomcat4 will be the user making and writing changes to these files which only root has privs over at the moment

chown -R tomcat4:tomcat /etc/opennms

2. Look for a “report” folder in /etc/opennms/. If there is not one then create it and CHOWN that folder as explained above.
…More to follow…

[mygal=opennms]

  • Share/Bookmark


5 Comments

  1. AnRkey   |  Tuesday, 17 April 2007 at 16:56

    Really nice howto! It makes life as easy as pie when you have a nice guide like this to work from.

    AnRkey

    PS: You should submit it to Howtoforge

  2. admin   |  Tuesday, 10 July 2007 at 16:52

    Thank you for the comments. I have been able to install Opennms on Ubuntu Feisty Fawn with very little variation to the above Howto. If you are interested in getting it to work, let me know and I will gladly help you with the procedure.

  3. govokinolij   |  Friday, 13 July 2007 at 15:07

    Hello

    Looks good! Very useful, good stuff. Good resources here. Thanks much!

    Bye

  4. ali   |  Wednesday, 08 August 2007 at 10:18

    Hi,
    I have tried to install opennms on ubuntu feisty with several approaches that exist on web, but no success,
    would u plz help me?
    Thanks

  5. admin   |  Wednesday, 29 August 2007 at 19:48

    Hi Ali.

    Sorry for only replying now, I was on leave and I was no where near a computer for the duration.

    I do not mind helping you.
    Can you give me any more details as to what problems you are getting during the installation?

    Craig

Leave a Reply





Because I value your thoughtful opinions, I encourage you to add a comment to this discussion. Don't be offended if I edit your comments for clarity or to keep out questionable matters, however, and I may even delete off-topic comments.