Opennms 1.61安装

前言:因为工作轮动关係,对于SERVER的监控需求急增。想起多年前写过的一篇文章『Opennms安装心得』发现网路上的文章大多停留在opennms 1.2.X,而opennms已经是stable 1.6.1的版本了。所以,再动手研究顺道记录安装的过程作为以后的参考,如有需要还是请着名出处 http://addichen.blogspot.com。还是老规矩,为了以后交接、管理的方便,习惯使用RPM来安装
系统环境:Centos 5.2
1.安装yum-fastestmirror
.[root@localhost ~]# yum install yum-fastestmirror
Setting up Install Process
...
Running Transaction
Installing: yum-fastestmirror
######################### [1/1]
Installed: yum-fastestmirror.noarch 0:1.1.9-2.fc8
Complete!

2.安装Repository RPMs
[root@localhost ~]# rpm -Uvh http://yum.opennms.org/repofiles/opennms-repo-stable-rhel5.noarch.rpm

查询可安装的套件
[root@localhost ~]# yum list opennms
…….
Available Packages
opennms.noarch1.6.1-1opennms-stable-c

3.安装postgresql-server
[root@localhost ~]# yum -y install postgresql-server
……
Transaction Test Succeeded
Running Transaction
Installing: postgresql
######################### [1/2]
Installing: postgresql-server
######################### [2/2]
Installed: postgresql-server.i386 0:8.1.11-1.el5_1.1
Dependency Installed: postgresql.i386 0:8.1.11-1.el5_1.1
Complete!

4.启动postgresql并设定开机时启动。
[root@localhost ~]# service postgresql start
Initializing database:[OK]
Starting postgresql service:[OK]
[root@localhost ~]# chkconfig postgresql on
5. Install OpenNMS
=============================================================================
Package
Arch
Version
Repository
Size
=============================================================================
Installing:
opennmsnoarch1.6.1-1
opennms-stable-common 4.9 k
Installing for dependencies:
jdk i586 2000:1.5.0_15-fcs
opennms-stable-common 46 M
jicmp i386 1.0.7-1
opennms-stable-rhel5 46 k
opennms-core noarch 1.6.1-1
opennms-stable-common 49 M
opennms-webapp-jetty noarch 1.6.1-1
opennms-stable-common 30 M

Transaction Summary
=============================================================================
Install
5 Package
Update
0 Package
Remove
0 Package

Total download size: 126 M
Is this ok [y/N]: y
Downloading Packages:
: opennms-core-1.6.1 100% |=========================| 49 MB 03:30
: opennms-webapp-jet 100% |=========================| 30 MB 01:36
: jdk-1_5_0_15-linux 100% |=========================| 46 MB 03:02
: opennms-1.6.1-1.no 100% |=========================| 4.9 kB 00:00
: jicmp-1.0.7-1.i386 100% |=========================| 46 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 4c4cbbd9
Importing GPG key 0x4C4CBBD9 "OpenNMS Project" from http://yum.opennms.org/OPENNMS-GPG-KEY
6.将/etc/yum.repos.d/opennms*.repo档案加入以下的参数enabled=0
7. Configure OpenNMS
[root@localhost ~]# export OPENNMS_HOME=/opt/opennms
8. Configure Database
pg_hba.conf 与 postgresql.conf 在 /var/lib/pgsql/data下
[root@localhost ~]# vi /var/lib/pgsql/data/ pg_hba.conf
原有的参数设定
local all all ident sameuser
host all all 127.0.0.1/32ident sameuser
host all all ::1/128ident sameuser
改成
local all all trust
host all all127.0.0.1/32trust
host all all ::1/128 trust

[root@localhost ~]# vi /var/lib/pgsql/data/ postgresql.conf
# 去除 "*" 如下
listen_addresses = 'localhost'
9.重新启动services并建立Database
[root@localhost ~]# service postgresql restart
[root@localhost ~]# sudo -u postgres createdb -U postgres -E UNICODE opennms

10.安装iplike
[root@localhost ~]# yum install iplike
[root@localhost ~]# install_iplike.sh
CREATE FUNCTION

11.设定OpenNMS 连结到 Java
[root@localhost ~]# $OPENNMS_HOME/bin/runjava –s

12.加入JAVA_HOME 到 /etc/default/opennms
[root@localhost ~]# vi /etc/default/opennms
JAVA_HOME=/usr

13. 初始化OpenNMS 与 Database
# 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
…………..
Installer completed successfully!
表示成功了。

14.编辑$OPENNMS_HOME/etc/discovery-configuration.xml,设定所要监看的IP区间
]