zhaoke 发表于 2006-11-25 04:55:21

在Fedora Linux上安装BixServer

在Fedora Linux上安装BixServer

赵珂 cn.zhaoke.com
http://blog.zhaoke.com/19.html


BixServer 是 BixData 的核心组件, 主要用于从服务器收集数据. BixData是一个用于系统, 应用程序和网络的监视工具.

本文介绍如何在FC4(Fedora Core 4 Linux, 也适用于最新的FC版本)上安装bixserver, 编写BixServer启动脚本和以非root方式运行bixserver.

在FC4上安装BixServer

下载和解压bixserver软件包(或BixAgent, 用于远程服务器监视, 我把程序放在/usr/bin/bixdata目录), 你可以从这里下载: http://www.bixdata.com/downloads

BixServer和BixAgent需要Mysql库支持, 如果你没有安装, 可以使用yum安装mysqlclient*

启动脚本

下面脚本通过使用/sbin/service命令来启动bixserver(或bixagent, 用bixagent替换脚本中的bixserver), 和使用chkconfig命令把此脚本添加到启动过程.

脚本放在/etc/init.d/目录, 权限为可运行(chmod 755).
脚本非常基础, 仅启动或停止biserver(或 agent)

(使用runserver.sh来启动bixserver, Bixserver 2.3版本后启动路径有所修改)
—————————-开始—————————-
#!/bin/sh
#
# Bixserver script: start bixserver deamon
#
# chkconfig: - 95 5
# description: Bixserver is the bixdata server which is used to collect
# data from agents about local/remote systems
#

# Source function library.
. /etc/rc.d/init.d/functions

start() {
echo -n $”BixServer: “
cd /usr/bin/bixdata;
nohup ./runserver.sh >out &
sleep 1
PID=`pidof -s -x -o $$ -o $PPID -o %PPID bixserver`
if [ $PID ]; then
echo_success
else
echo_failure
fi
echo
# RETVAL=$?;
}

stop() {
# /bin/true
echo -n “Stopping BixServer daemon: “
killproc bixserver && echo_success || echo_failure
echo
}

# See how we were called.
case “$1″ in
start)
start
;;
stop)
stop
;;
status)
;;
restart)
stop
start
;;
condrestart)
;;
reload)
;;
*)
echo $”Usage: $0 {start|stop|status|restart|condrestart|reload}”
;;
esac
exit $RETVAL
—————————-结束—————————-

好的, 现在bixserver可以通过下面命令来运行:
/sbin/service bixserver start

使用下面命令添加bixserver到启动过程中;
/sbin/chkconfig –add bixserver
/sbin/chkconfig bixserver on

脚本亦适应于bixagent, 只需要把脚本中的bixserver(红色字体)替换为bixagent.
如果bixdata放在其它目录, 你需要更新脚本中的bixdata路径(蓝色字体).

以其它用户运行bixserver

我修改了上面脚本, 你可以通过bixdata用户来运行bixserver. 这样会安全一些, 不会有其它影响. 当你没有以root用户运行bixserver, 需要下面的软件包.

—————————-开始—————————-
#!/bin/sh
#
# Bixserver script: start bixserver deamon
#
# chkconfig: - 95 5
# description: Bixserver is the bixdata server which is used to collect
# data from agents about local/remote systems
#

# Source function library.
. /etc/rc.d/init.d/functions

start() {
echo -n $”BixServer: “
cd /usr/bin/bixdata/bixserver;
# nohup ./bixserver >out &
# su - bixdata -c “cd /usr/bin/bixdata/bixserver; nohup ./bixserver >out &”
su - bixdata -c “cd /usr/bin/bixdata; nohup ./runserver.sh >out &”
sleep 1
PID=`pidof -s -x -o $$ -o $PPID -o %PPID bixserver`
if [ $PID ]; then
echo_success
else
echo_failure
fi
echo
# RETVAL=$?;
}

stop() {
# /bin/true
echo -n “Stopping BixServer daemon: “
killproc bixserver && echo_success || echo_failure
echo
}

# See how we were called.
case “$1″ in
start)
start
;;
stop)
stop
;;
status)
;;
restart)
stop
start
;;
condrestart)
;;
reload)
;;
*)
echo $”Usage: $0 {start|stop|status|restart|condrestart|reload}”
;;
esac
exit $RETVAL
—————————-结束—————————-

安装智能监视工具

因为bixserver需要依赖智能监视工具来生成图表等(包括非root方式运行bixserver), 所以你需要安装智能监视工具.

安装监视工具到Fedora:
yum install smartmontools

这将会安装smartmontools的rpm包, 现在设置进程自动启动, 然后运行smartmontools, 重新启动bixserver/agent.

/sbin/chkconfig –add smartd
/sbin/chkconfig smartd on

/sbin/service bixserver restart (或重启bixagent)

更多信息请参考bixdata公司网站.

参考:
Bixdata: bixserver

备注:
转载请保持文章完整性, 欢迎交流.
页: [1]
查看完整版本: 在Fedora Linux上安装BixServer