この情報は古い可能性があります!
監視ツールの定番を入れてみます。
HP: http://bb4.org/
gcc4だとコンパイルに失敗するようなので、
後述で回避策を載せておきます。
ユーザの作成
useradd -d /usr/local/bb bb
インストール
cd /usr/local/src
wget http://bb4.org/dnld/bb-1.9i.tar.gz
tar zxvf bb-1.9i.tar.gz
tar xvf BBSVR-bb1.9i-btf.tar
cp -rp bb1.9i-btf/* /usr/local/bb/
cd /usr/local/bb/install
./bbconfig linux
Do you agree to the terms of this license (y/n): y
---> We'll configure for linux...
Big Brother needs it's own user id. If your BB user doesn't exist,
you'll have to create it then re-run bbconfig.
What will be the user ID for BB [bb]: bb
---> BB will only run from user 'bb'
Making sure BBHOME </usr/local/src/bb/bb1.9i-btf> is writable...
---> OK, /usr/local/src/bb/bb1.9i-btf is fine...
When you set up your machines, you should use Fully Qualified
Domain names, this means you use the whole name, like www.bb4.com,
instead of just 'www'. This is recommended.
Use FQDN (y/n): [y] y
---> Good, we'll use FQDN
Big Brother creates HTML pages with the status of your network.
You'll need a web server to publish this information.
What host will be the BBDISPLAY [www.momo-i.org]:
---> OK... www.momo-i.org will be a BBDISPLAY
Big Brother sends important messages to a pager server. This
machine will at a minimum to be able to send mail.
What host will be the BBPAGER [www.momo-i.org]:
---> OK... www.momo-i.org will be a BBPAGER
Some questions regarding the current host
(www.momo-i.org) will be asked.
Is this host a BBDISPLAY host (y/n): [y]
Is this host a BBPAGER host (y/n): [y]
Enter the default e-mail address to send notifications to: [ root@www.momo-i.org ] webmaster@momo-i.org
Since Big Brother produces results to be displayed on web
pages, we need to know where to view these results.
Enter the base URL for BB [/bb]:
---> OK... Big Brother will live under http://www.momo-i.org/bb
Big Brother also uses CGI scripts to create dynamic output.
What directory do these scripts live in?
Enter CGI directory [/home/www/httpd/cgi-bin]: /home/htdocs/cgi-bin
---> OK... CGI scripts will live at /home/htdocs/cgi-bin
Enter the base URL of the CGI scripts [/cgi-bin]:
---> OK... The base URL location of CGI scripts is in /cgi-bin
--------------------------------------------------------
--> UPDATING runbb.sh
--> UPDATING bbsys.local
--> UPDATING bbsys.local for LINUX requiring -w3 option in PINGPAR1
--> CHECKING COMMAND PATHNAMES
*** Verifying pathnames to necessary commands...
*** The following changes need to be made...
--> /usr/bin/mail -s changed to /bin/mail -s
--> /sbin/ping changed to /bin/ping
--> /usr/bin/grep changed to /bin/grep
--> /usr/bin/sort changed to /bin/sort
--> /usr/bin/sed changed to /bin/sed
--> /usr/bin/egrep changed to /bin/egrep
*** Making changes...
*** We've noticed that we've set some of the pathnames wrong
*** by default here. May we mail a summary of the paths we
*** missed back to info@bb4.com so we can update our installs?
[y/n]
n
*** Done.
--> UPDATING bbdef.sh
--> UPDATING URL location
--> INSTALLING CGI scripts
BB needs to set the group name of the www/rep directory
to the group name of the web server by using its user name
Enter web server user id [nobody]: apache
You may override the group name determined by the previous step.
Enter group name [apache]:
--> SETTING WRITE PERMISSION FOR OWNER AND GROUP FOR www/rep
--> CHANGING THE GROUP ID OF www/rep
--> UPDATING pager scripts
--------------------------------------------------------
--------------------------------------------------------
--> Done. Now do
chown -R bb /usr/local/src/bb/bbvar /usr/local/src/bb/bb1.9i- btf
su - bb
to continue installation using that user ID
Now compile Big Brother
cd /usr/local/src/bb/bb1.9i-btf/src
make
make install
--------------------------------------------------------
BBはrootでは起動できないため、最初に作ったbbというユーザで起動します。
#!/bin/sh
#
# chkconfig: 235 75 75
# description: BigBrother is monitoring your machine and \
# monitoring daemon.
#
# processname: bb
# pidfile: /var/run/bb.pid
# config: /usr/local/BB/bb/etc
#
#
# Source function library.
DOMAIN=initscripts
. /etc/rc.d/init.d/functions
# Source networking configuration.
[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
# binary location
bb="/usr/local/BB/bb/runbb.sh"
lock="/var/lock/subsys/bb"
RETVAL=0
prog="BigBrother"
[ -x $bb ] || exit 1
# See how we were called.
start() {
# Start daemons.
if [ -f "$lock" ]; then
echo -n $"$prog: already running"
return 1
fi
echo -n $"Starting $prog: "
su - bb -c "$bb start"
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $lock
echo
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Stopping $prog: "
su - bb -c "$bb stop"
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f $lock && success $"$prog stop" || failure $"$prog stop"
echo
return $RETVAL
}
restart() {
stop
sleep 3
start
}
case "$1" in
start)
start;;
stop)
stop;;
restart)
restart;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
次にいろいろな設定です。
まずはコンパイルしたものを上の起動ファイルで指定した場所へ移動します。
その他細かくやりたい場合はbb-***.DISTを.DISTをなくしたものに直して使います。
bb-hosts
192.168.0.10 www.momo-i.org # BBNET BBDISPLAY BBPAGER cpu disk msgs procs dns ssh smtp ftp pop3 http://www.momo-i.org
bbのサーバのコンパイルがこける件
bbサーバはgcc4でコンパイルすると途中でエラーがでます。
以下の手順でMakefileを書き換えてmakeするとうまくいくっぽいですね。
cd /usr/local/src/bb/src/minimake
grep gcc *
出てきた CC = "gcc" のgccをgcc34(又はgcc32)に変更
gcc32又はgcc34が無い場合は、yumでインストールしてください。
これでmakeが出来るようになったはずです。
コメントを追加