Installation:MacOSX
Subscribe

From OpenNMS

Jump to: navigation, search

OpenNMS is supported on Mac OS X (Darwin) via Ben Reed at the Fink project.

Contents

Install and Configure Fink

Fink Installation

If you don't have Fink installed or Fink is not configured to use the unstable packages tree, read the Fink install page for information on installing Fink for your release of Mac OS X.

Enable the "Unstable" Tree

Next, configure fink to use "unstable" packages. Edit /sw/etc/fink.conf (as root) and add the unstable packages to the Trees line:

 Trees: local/main stable/main unstable/main

...and then run:

 # or fink selfupdate-cvs
 fink selfupdate-rsync
 fink scanpackages

Preparing the Database for OpenNMS

Before installing OpenNMS itself, you will want to install PostgreSQL, and do a few things to make sure PostgreSQL is working properly.

Installing PostgreSQL

First, you'll want to install PostgreSQL. To install, just run the "fink install postgresql-server" command:

 fink install postgresql-server

Startup

Onec PostgreSQL is installed, the first thing you'll need to do is making sure PostgreSQL starts up properly. On most distributions, you can just run (as root):

 /sw/bin/pgsql.sh start

Then, to ensure that PostgreSQL will start after a reboot, use the "daemonic" command to enable start on bootup:

 /sw/bin/daemonic enable postgresql91

Additionally, while it's beyond the scope of this beginning tutorial, you may want to check the PostgreSQL section of the Performance Tuning page to get the most out of your database installation.

Configure Shared Memory (If Necessary)

If, during startup, the PostgreSQL script complains that you need more shared memory, it will create a sample sysctl.conf file for you in the /etc directory. If you don't have an "/etc/sysctl.conf" file already, just move the "/etc/sysctl.conf.pg" file over. Otherwise, merge the contents with your existing sysctl.conf.

You will have to reboot for these changes to take effect.

Then, ensure that the shmmax is set correctly:

 sysctl -a | grep shm

Install OpenNMS

Installing the Latest Official Release Through Fink

OpenNMS is kept up-to-date in Fink. All you need to do is:

 fink selfupdate
 fink install opennms

If you choose the defaults, fink should install $OPENNMS_HOME into /sw/var/opennms.

Post-Install Configuration

Configure Java

Next, you need to tell OpenNMS which Java you want it to use, using the "$OPENNMS_HOME/bin/runjava" command.

In most cases, you should be able to point it at /Library/Java/Home:

 $OPENNMS_HOME/bin/runjava -S /Library/Java/Home/bin/java

Create/Update the OpenNMS Database

Whenever you install OpenNMS or upgrade it, you should run the "$OPENNMS_HOME/bin/install" command, to create the OpenNMS database, or update it to the latest version. The install command takes many options, but in most cases all you should need is:

  • -d - to update the database
  • -i - to insert any default data that belongs in the database
  • -s - to create or update the stored procedures OpenNMS uses for certain kinds of data access

Note.png Try It! Create the Database

Now it's time to create and configure the OpenNMS database. To do so, run the following command (as root):

 $OPENNMS_HOME/bin/install -dis

You should get output something like this:

=========================================================================
OpenNMS Installer
=========================================================================

Configures PostgreSQL tables, users, and other miscellaneous settings.

- searching for jicmp:
  - trying to load /sw/lib/libjicmp.jnilib: OK
- searching for jicmp6:
  - trying to load /sw/lib/libjicmp6.jnilib: OK
...
- Running migration for changelog: URL [...]
INFO 2/1/12 12:48 PM:liquibase: Successfully acquired change log lock
INFO 2/1/12 12:48 PM:liquibase: Creating database history table
INFO 2/1/12 12:48 PM:liquibase: Reading from databasechangelog
INFO 2/1/12 12:48 PM:liquibase: Reading from databasechangelog
INFO 2/1/12 12:48 PM:liquibase: ChangeSet ran successfully in 54ms
...
INFO 2/1/12 12:49 PM:liquibase: Successfully released change log lock
- inserting PL/pgSQL iplike function... OK

Installer completed successfully!

(Optional) Configure IPLIKE

OpenNMS uses a PostgreSQL stored procedure called "IPLIKE" which provides an API for easily performing complicated IP address queries. By default, OpenNMS installs a version of IPLIKE that is compatible with all versions of PostgreSQL, but there is a platform-specific version of IPLIKE with much better performance. While it is optional, it is recommended that you install the "iplike-pg91" package for performance reasons.

Note.png Try It! Install IPLIKE

To do so, install the "iplike-pg91" package with fink, like so (as root):

 fink -y install iplike-pg91

You should see it finish with something like this:

Information about 5966 packages read in 5 seconds.
The following package will be installed or updated:
 iplike-pg91
Reading buildlock packages...
/sw/bin/dpkg-lockwait -i /sw/fink/debs/iplike-pg91_2.0.2-1_darwin-x86_64.deb
...
Setting up iplike-pg91 (2.0.2-1) ...
Clearing dependency_libs of .la files being installed
*** NOTE ***

WARNING: this package will not work until you run
/sw/sbin/install_iplike_91.sh with the appropriate options.

See `/sw/sbin/install_iplike_91.sh -h` for more information.

Then run the install_iplike_91.sh script:

 sudo /sw/sbin/install_iplike_91.sh -d opennms

Start OpenNMS and Connect to the Web UI

You can now start OpenNMS using the "opennms" command (as root):

 $OPENNMS_HOME/bin/opennms start

Note.png Try It! Connect to the Web UI

Try starting OpenNMS, and connecting to the web UI.

 $OPENNMS_HOME/bin/opennms start

You should be able to go to http://YOUR-OPENNMS-IP:8980/opennms/ in your browser and see the web UI. The default username and password are both "admin" so enter them in when you see the login prompt.