作者,列了多个系统的不同情况,并标注了修改的语句

原文 http://hc.cyc.edu.tw/modules/tadnews/index.php?nsn=22

這篇文章是從opennms官網隨便翻譯過來的,原網址
需要修改的地方或指令我加粗體,另外使用etch以後的版本會比較簡單而且簡單很多。
另外可以裝phppgadmin來處理資料庫,不過他依附的是php4,如果使用OB2D要把php5移掉

Debian-Based Distributions 安裝

These instructions cover installation for most Debian-Based distributions (Debian, Ubuntu, etc.)

增加 OpenNMS 下載來源 sources.list

修改 /etc/apt/sources.lists ,增加下列內容

( 如果想要用最新展版的 OpenNMS, 可能有目前穩定版所沒有的新功能,請用 unstable 取代 stable.)

增加 OpenNMS PGP Key APT

The official OpenNMS packages are signed with a GPG / PGP key. The fingerprint for the official release key is:
 
   
You will need to tell APT about the key:

(如果是身份,上面那行要去掉

Debian 4.0 (etch) and Ubuntu 7.10 (gutsy) 或更新版本(OB2D在這邊)

As Sun Java has been put under the GPL it's sufficient to type "apt-get install opennms" since Debian 4.0 (etch) or Ubuntu 7.10 (gutsy); the dependencies will be fulfilled automatically.
輸入 "apt-get install opennms"就會自動安裝(包含 postgresqlJAVA SDK等, 另外 jrrd rrdtool 是建議安裝的套件,需要手動安裝)

在早期的 Debian and Ubuntu(如b2d Jacana、LaPue)

Installing on older Debian or Ubuntu releases involves additional steps to get a Sun Java 5 or Java 6 JDK. Instructions are available online, but if possible, save yourself the trouble and use a newer release that includes Sun Java in the default repositories.

設定 OpenNMS

First, for the purposes of convenience, we are going to set the $OPENNMS_HOME environment variable before running any commands.
在執行命令前先設定 $OPENNMS_HOME
 
   
(If you are not using a bourne-compatible shell, you may need to use different syntax.)
 

設定資料庫

OpenNMS 需要以預設使用者 "postgres 』依靠 TCP/IP 連線到 PostgreSQL (在安裝 opennms 時會自動裝起來)
RedHat-based systems
/etc/init.d/postgresql start
/sbin/service postgresql start
pg_hba.conf and postgresql.conf are in /var/lib/pgsql/data

Debian-based systems X.X 是版本,如 8.1
/etc/init.d/postgresql-X.X start
pg_hba.conf postgresql.conf 兩個檔案 /etc/postgresql/X.X/main

Mac OS X (Fink)
/sw/bin/pgsql.sh start
編輯 pg_hba.conf to Allow postgres to Authenticate
To allow the "postgres" user to connect, you will need to edit your database's pg_hba.conf file, which is usually created on installation or the first startup of PostgreSQL, depending on your distribution: By default, it will have something like this at the bottom:
在檔案的最後找到以下幾行


You will need to change "ident sameuser" to "trust":
將最後一欄改成


編輯 postgresql.conf to Allow TCP/IP Connections
You may also need to change the postgresql.conf to allow TCP/IP connections, if it cannot do so already. On older PostgreSQL versions, this is enabled with the flag:
7.x版需要將以下功能打開(不適用於較新的 8.x版)
 
   
On newer PostgreSQL versions, this is enabled with:
較新的版本要將以下功能打開

重新啟動資料庫
Once you've made these changes, you need to restart your database.
因設定改變需要重新啟動資料庫
/etc/init.d/postgresql-X.X restart
建立 opennms 資料庫
If not done, use "sudo -u postgres createdb -U postgres -E UNICODE opennms" to create the database in postgres.
如果是 root身份則改成
su postgres
createdb -U postgres -E UNICODE opennms
exit

安裝 IPLIKE Stored Procedure in the Database

If this is your first time installing OpenNMS or iplike, you should make sure that iplike is configured in your database. First you need to install the iplike package from OpenNMS package repositories.
For RPM-based distributions using YUM:
 
   
For DEB-based distributions using APT (use suffix pgsql74, pgsql81, pgsql82, or pgsql83 according to the version of PostgreSQL on your system):
正常來說在 apt-get install opennms 的時候就會安裝,如果沒有的話請執行
 
   
如果 OpenNMS database 已經設定則可繼續,或是手動執行
 
   

告訴 OpenNMS 去哪裡找JAVA

OpenNMS 需要知道去哪裡找 JAVA ,請執行以下指令(一般而言這樣就夠了,後面部需要)
 
   
This will search $JAVA_HOME and other common locations for your JDK. If you wish to use a specific JDK, you can run it with the -S flag instead:
如果是自行設置的 JDK則需要指定位置如
 
   
然後將設定 JAVA_HOME 寫入 /etc/default/opennms
 
   

初始化 OpenNMS Database

Next, you need to run the OpenNMS installer, which will initialize the OpenNMS database, and do some other basic setup. Upon upgrade, you should run this command again to make sure your database schema and other things required at startup are up-to-date.
執行 OpenNMS的安裝程式,這將會初始化 OpenNMS資料庫並進行基本設定,(升級可再次執行確認資料庫結構和其他必要的升級。)
大部分的狀況只要執行下面指令即可
 
   
Sometimes you may need to tell OpenNMS where to find libjicmp.so; in that case, you can use the -l option (OpenNMS 1.3.5 and higher):



啟動 OpenNMS

You should have a basic OpenNMS installation ready now, so start it up:
現在應該已經有了基礎的 OpenNMS,啟動他
 
   
As of OpenNMS 1.3.7, by default, the web UI will come up using the embedded Jetty servlet container, on port 8980. Open your browser and point it at:
依照 OpenNMS1.3.7 的預設值, web 使用介面將會使用 Jetty servlet (以前需要 TOMCAT ),在 port 8980 ,打開瀏覽器到
 
   
帳號密碼都使用 admin登入
port設定可以到 /etc/opennms/opennms.properties裡面修改,如將 8980改成 8180。)