These instructions cover installation for most Debian-Based distributions (Debian, Ubuntu, etc.)
增加 OpenNMS 下載來源到 sources.list
修改/etc/apt/sources.lists ,增加下列內容 deb http://debian.opennms.org stable main deb-src http://debian.opennms.org stable main
(如果想要用最新展版的OpenNMS, 他可能有目前穩定版所沒有的新功能,請用unstable 取代 stable.)
deb http://debian.opennms.org unstable main
deb-src http://debian.opennms.org unstable main 增加 OpenNMS PGP Key 給APT
The official OpenNMS packages are signed with a GPG / PGP key. The fingerprint for the official release key is:
22EE DDA6 8698 B02F B2EC 50B7 062B 8A68 4C4C BBD9
You will need to tell APT about the key: wget -O - http://debian.opennms.org/OPENNMS-GPG-KEY | sudo apt-key add -
(如果是root身份,上面那行要去掉sudo wget -O - http://debian.opennms.org/OPENNMS-GPG-KEY | apt-key add -
) 在 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.
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 export OPENNMS_HOME=/usr/share/opennms
(If you are not using a bourne-compatible shell, you may need to use different syntax.)
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:
在檔案的最後找到以下幾行
local all all ident sameuser
host all all 127.0.0.1/32 ident sameuser
host all all ::1/128 ident sameuser
You will need to change "ident sameuser" to "trust":
將最後一欄改成trust
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 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版)
tcpip_socket = true
On newer PostgreSQL versions, this is enabled with:
較新的版本要將以下功能打開
# you can use "*" to listen on all addresses
listen_addresses = 'localhost' 重新啟動資料庫
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:
yum install iplike For DEB-based distributions using APT (use suffix pgsql74, pgsql81, pgsql82, or pgsql83 according to the version of PostgreSQL on your system):
OpenNMS 需要知道去哪裡找JAVA,請執行以下指令(一般而言這樣就夠了,後面部需要) $OPENNMS_HOME/bin/runjava -s
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:
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_HOME/bin/install -dis
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):
# i386 example
$OPENNMS_HOME/bin/install -dis -l /usr/lib/jni:/usr/lib
# x86_64 example
$OPENNMS_HOME/bin/install -dis -l /usr/lib64/jni:/usr/lib64 啟動 OpenNMS
You should have a basic OpenNMS installation ready now, so start it up:
現在應該已經有了基礎的OpenNMS,啟動他 sudo /etc/init.d/opennms start
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: