2008年8月25日 星期一

BigBrother監控主機

系統使用CentOS 5.2
BigBrother是一套伺服器監控程式,免費版本只有提供至1.9i
可設定監控每台伺服器的不同服務
可紀錄伺服器的存活歷程
服務斷線時自動以E-Mail回報


1.安裝所需套件
yum install gcc-c++
yum install httpd

2.下載bb4軟體
mkdir /var/www/html/bb4
cd /var/www/html/bb4

下載bb-1.9i.tar.gz
wget http://bb4.org/dnld/bb-1.9i.tar.gz

3.解壓縮bb4
tar -zxvf bb-1.9i.tar.gz
tar -xf BBSVR-bb1.9i-btf.tar

4.設定bb4
adduser bb
cd /var/www/html/bb4/bb1.9i-btf/install
./bbconfig linux

Do you agree to the terms of this license (y/n):y
What will be the user ID for BB [bb]: (ENTER)
Use FQDN (y/n): [y]
What host will be the BBDISPLAY [server]: 192.168.0.254(監控主機的IP)
What host will be the BBPAGER [192.168.0.254]: (ENTER)
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@server] admin@mail.com.tw
Enter the base URL for BB [/bb]: (ENTER)
Enter CGI directory [/home/www/httpd/cgi-bin]: /var/www/cgi-bin
Enter the base URL of the CGI scripts [/cgi-bin]: (ENTER)

*** 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

Enter web server user id [nobody]:apache
Enter group name [apache]: (ENTER)

5.安裝bb4
chown -R bb /var/www/html/bb4/bbvar /var/www/html/bb4/bb1.9i-btf
su - bb
cd /var/www/html/bb4/bb1.9i-btf/src
make
make install

(如果make時出現
bbd.c:724: error: invalid storage class for function ‘bbd_timeout’錯誤時
vim /var/www/html/bb4/bb1.9i-btf/src/bbd.c
把722行 "static"字串刪掉)

6.編輯bb4監控目標檔案
vim /var/www/html/bb4/bb1.9i-btf/etc/bb-hosts
範例:
group BB Server
192.168.0.254 monter.centos.com.tw # BBPAGER BBNET BBDISPLAY (一定要有監控主機本身,注意Host Name須正確)
192.168.0.1 DNS # dns
192.168.0.5 Web # http://192.168.0.5
192.168.0.247 Ftp.centos.com.tw # ftp
192.168.0.242 Mail.centos.com.tw # pop3 smtp


7.測試bb4設定檔
cd ../etc
./bbchkcfg.sh
exit

8.設定bb4與apache連接
ln -s /var/www/html/bb4/bb1.9i-btf/www /var/www/html/bb
chown -R bb /var/www/html/bb

9.啟動bb4
su - bb -c "/var/www/html/bb4/bb1.9i-btf/runbb.sh start"

vim /etc/rc.local

su - bb -c "/var/www/html/bb4/bb1.9i-btf/runbb.sh start"


10.重新啟動httpd
service httpd restart

備註:
◎刪除舊的資料
/var/www/html/bb4/bb1.9i-btf/bin/bbrm 主機名稱 服務名稱
EX: /var/www/html/bb4/bb1.9i-btf/bin/bbrm DNS dns

0 意見:

##EasyReadMore##