分享
 
 
 

opennms安装手册

王朝java/jsp·作者佚名  2006-01-10
窄屏简体版  字體: |||超大  

一、安装opennms前的准备

1、安装Linux

安装linux再此不作详细,请参考相关文档

2、安装JAVA虚拟机

1)jdk安装

在网上下载下载j2sdk-1_4_2_02-linux-i586-rpm.bin;

把j2sdk-1_4_2_02-linux-i586-rpm.bin文件拷贝到系统某一目录,在此以/mypath

cp j2sdk-1_4_2_02-linux-i586-rpm.bin /mypath

cd /mypath

j2sdk-1_4_2_02-linux-i586-rpm.bin

运行它之后会显示一个许可信息 (License),同意之后,安装程序会将 JDK 解压在当前路径下的一个名为 j2sdk1.4.1_02 的目录中

然后作链接

ln -s j2sdk1.4.1_02 jdk

ln -s j2sdk1.4.1_02/jre jre

2)jdk设置

在/etc/profile文件的头上增加下面四行.这里假设JAVA安装在/mypath/j2sdk1.4.2_07目录下,mypath根据系统自己定义

JAVA_HOME=/mypath/jdk

export JAVA_HOME

PATH="$PATH:$JAVA_BIN"

export PATH

然后执行 . /etc/profile,使其生效。

3、安装TOMCAT

下载jakarta-tomcat-4.1.30.zip

然后把jakarta-tomcat-4.1.30.zip文件拷贝到LINUX中,然后在jakarta-tomcat-4.1.30.zip

所在的目录下执行

#unzip -x jakarta-tomcat-4.1.30.zip -d /temp

mv jakarta-tomcat-4.1.30 tomcat4.1.30

ln -s tomcat4.1.30 tomcat

4、postgres数据库安装

1)postgres安装

在网上下载postgresql-7.3.2.tar.gz

# useradd postgres

# passwd postgres

#new passwd: postgres

#retype passwd: postgres

# tar -zxvf source/postgresql-7.3.2.tar.gz

# cd /ir/postgresql-7.3.2

# ./configure --prefix=/usr/local/pgsql

# make

# make install

# chown -R postgres.postgres /usr/local/pgsql

# vi ~postgres/.bash_profile

添加:

PGLIB=/usr/local/pgsql/lib

PGDATA=$HOME/data

PATH=$PATH:/usr/local/pgsql/bin

MANPATH=$MANPATH:/usr/local/pgsql/man

export PGLIB PGDATA PATH MANPATH

以 postgres 用户登录,

# su – postgres

建立数据库目录:

$ mkdir data

启动数据库引擎:

$ initdb

启动服务

/usr/local/pgsql/bin/postmaster -D /home/postgres/data

or

/usr/local/pgsql/bin/pg_ctl -D /home/postgres/data -l logfile start

2)postgres配置

配置/home/postgres/data/postgresql.conf

tcpip_socket = true

max_connections = 256

shared_buffers = 1024

配置/home/postgres/data/pg_hba.conf

# 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 192.168.0.254 255.255.255.0 trust

3)postgres自启动配置

vi /etc/init.d/post

#! /bin/sh

# PGVERSION is:

PGVERSION=7.3

# Source function library.

INITD=/etc/rc.d/init.d

. $INITD/functions

# Get function listing for cross-distribution logic.

TYPESET=`typeset -f|grep "declare"`

# Get config.

. /etc/sysconfig/network

# Find the name of the script

NAME=`basename $0`

# Set defaults for port and database directory

PGPORT=5432

export PGDATA=/var/lib/pgsql

if [ -f $PGDATA/PG_VERSION ] && [ -d $PGDATA/base/template1 ]

then

echo "Using old-style directory structure"

else

export PGDATA=/var/lib/pgsql/data

fi

# Override defaults from /etc/sysconfig/pgsql if file is present

[ -f /etc/sysconfig/pgsql/${NAME} ] && . /etc/sysconfig/pgsql/${NAME}

export PGDATA

export PGPORT

export PGOPTS

# Check that networking is up.

# Pretty much need it for postmaster.

[ "${NETWORKING}" = "no" ] && exit 0

[ -f /usr/bin/postmaster ] || exit 0

start(){

PSQL_START=$"Starting ${NAME} service: "

# Check for the PGDATA structure

if [ -f $PGDATA/PG_VERSION ] && [ -d $PGDATA/base ]

then

# Check version of existing PGDATA

if [ `cat $PGDATA/PG_VERSION` != '7.3' ]

then

SYSDOCDIR="(Your System's documentation directory)"

if [ -d /usr/doc/postgresql-$PGVERSION ]

then

SYSDOCDIR=/usr/doc

fi

if [ -d /usr/share/doc/postgresql-$PGVERSION ]

then

SYSDOCDIR=/usr/share/doc

fi

if [ -d /usr/doc/packages/postgresql-$PGVERSION ]

then

SYSDOCDIR=/usr/doc/packages

fi

if [ -d /usr/share/doc/packages/postgresql-$PGVERSION ]

then

SYSDOCDIR=/usr/share/doc/packages

fi

echo

echo $"An old version of the database format was found.\nYou need to upgrade the data format before using PostgreSQL.\nSee $SYSDOCDIR/postgresql-$PGVERSION/README.rpm-dist for more information."

exit 1

# This doesn't seem to do anything useful...

# else

# if echo "$TYPESET"|grep "declare -f success ()" >/dev/null

# then

# success "$PSQL_CHECK"

# else

# echo " [ OK ]"

# fi

# echo

fi

# No existing PGDATA! Initdb it.

else

echo -n $"Initializing database: "

if [ ! -d $PGDATA ]

then

mkdir -p $PGDATA

chown postgres.postgres $PGDATA

chmod go-rwx $PGDATA

fi

# Make sure the locale from the initdb is preserved for later startups...

[ -f /etc/sysconfig/i18n ] && cp /etc/sysconfig/i18n $PGDATA/../initdb.i18n

# Just in case no locale was set, use en_US

[ ! -f /etc/sysconfig/i18n ] && echo "LANG=en_US" > $PGDATA/../initdb.i18n

# Is expanded this early to be used in the command su runs

echo "export LANG LC_ALL LC_CTYPE LC_COLLATE LC_NUMERIC LC_CTYPE LC_TIME" >> $PGDATA/../initdb.i18n

# Initialize the database

su -l postgres -s /bin/sh -c "/usr/bin/initdb --pgdata=$PGDATA > /dev/null 2>&1" < /dev/null

[ -f $PGDATA/PG_VERSION ] && echo_success

[ ! -f $PGDATA/PG_VERSION ] && echo_failure

echo

fi

# Check for postmaster already running...

# note that pg_ctl only looks at the data structures in PGDATA

# you really do need the pidof()

pid=`pidof -s /usr/bin/postmaster`

if [ $pid ] && /usr/bin/pg_ctl status -D $PGDATA > /dev/null 2>&1

then

echo $"Postmaster already running."

else

#all systems go -- remove any stale lock files

rm -f /tmp/.s.PGSQL.${PGPORT} > /dev/null

echo -n "$PSQL_START"

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster -o '-p ${PGPORT}' start > /dev/null 2>&1" < /dev/null

sleep 1

pid=`pidof -s /usr/bin/postmaster`

if [ $pid ]

then

success "$PSQL_START"

touch /var/lock/subsys/${NAME}

echo $pid > /var/run/postmaster.${PGPORT}.pid

echo

else

failure "$PSQL_START"

echo

fi

fi

}

stop(){

echo -n $"Stopping ${NAME} service: "

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl stop -D $PGDATA -s -m fast" > /dev/null 2>&1

ret=$?

if [ $ret -eq 0 ]

then

echo_success

else

echo_failure

fi

echo

rm -f /var/run/postmaster.${PGPORT}.pid

rm -f /var/lock/subsys/${NAME}

}

restart(){

stop

start

}

condrestart(){

[ -e /var/lock/subsys/${NAME} ] && restart

}

reload(){

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl reload -D $PGDATA -s" > /dev/null 2>&1

}

# This script is slightly unusual in that the name of the daemon (postmaster)

# is not the same as the name of the subsystem (postgresql)

# See how we were called.

case "$1" in

start)

start

;;

stop)

stop

;;

status)

status postmaster

;;

restart)

restart

;;

condrestart)

condrestart

;;

reload|force-reload)

reload

;;

*)

echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"

exit 1

esac

exit 0

保存

chmod 755 post

ln –s /etc/init.d/post /etc/rc5.d/S82postgress

5、rrdtool安装

到网上下载rrdtool-1.0.49.tar.gz

# tar -zxvf source/rrdtool-1.0.49.tar.gz

# cd rrdtool-1.0.49

# ./configure --prefix=/ir/rrdtool

# make

# make install

安装完毕后,修改MRTG 的配置文件 mrtg.cfg 添加一下三行;

# more /etc/mrtg/net-rrd.cfg

# Created by

# ./cfgmaker --output=/etc/mrtg/net.cfg public@localhost

LogFormat: rrdtool 添加此行

PathAdd: /usr/local/rrdtool/bin/ 添加此行

LibAdd: /usr/local/rrdtool/lib/perl/ 添加此行

二、opennms安装

# cd /ir/source

# rpm -Uvh j2sdk-1_4_2_07-linux-i586.rpm

#rpm -Uvh tomcat4-4.1.24-full.2jpp.noarch.rpm

# rpm -Uvh tomcat4-admin-webapps-4.1.24-full.2jpp.noarch.rpm

# rpm -Uvh rrdtool-1.0.41-1.8.0.i386.rpm --nodeps

# rpm -Uvh postgresql-7.3.2-3.i386.rpm --nodeps

# rpm -Uvh postgresql-server-7.3.2-3.i386.rpm –-nodeps

# rpm -Uvh postgresql-libs-7.3.2-3.i386.rpm

# rpm -Uvh perl-DBD-Pg-1.21-2.i386.rpm –-nodeps

#rpm -Uvh opennms-1.2.0-1_rhl9.i386.rpm

#rpm -Uvh opennms-webapp-1.2.0-1_rhl9.i386.rpm

#rpm -Uvh opennms-docs-1.2.0-1_rhl9.i386.rpm

以上所有文件必须先到网上下载,安装完毕后设置jre

# cd /opt/OpenNMS/bin

# runjava –s

# runjava -S path

# $OPENNMS_HOME/bin/install –disU

# $OPENNMS_HOME/bin/install -y -w $CATALINA_HOME/webapps -W $CATALINA_HOME/server/lib

opennms系统配置

配置notificationCommand.xml

此项是配置是消息发送

配置discovery-configuration.xml

输入要管理的设备(包括了IP , 共同体的密码等),此文件可以什么都不配,但是要指定一个文件:targethost.xml ,然后到targethot.xml中来配

配置 targethost.xml

在targethost.xml输入配具体的要管理的机器

最后启动tomcat,opennms运行。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有