TOPサーバ構築・運用> 4. bbgen起動スクリプトのコピー
Big Brother
Big Brotherによるネットワーク監視

第10回:究極のBB機能拡張bbgen
著者:イー・モバイル  矢萩 茂樹   2006/8/11
前のページ  1  2  3  4
4. bbgen起動スクリプトのコピー

   bbgenのインストールとコンパイルが終了したらbbgenの起動スクリプトbb-display.sh/bb-network.shをコピーして、実行権を付加します。
$ cd /home/bb/server
$ cp /home/bb/bbgen-3.6/bb-display.sh.SAMPLE bin/bb-display.sh
$ cp /home/bb/bbgen-3.6/bb-network.sh.SAMPLE bin/bb-network.sh
$ chmod 755 bin/bb-display.sh bin/bb-network.sh


5. fpingに関する設定

   bbgenはfpingを用いてIP死活監視を行います。このときfpingの配置を環境変数として$BBHOME/etc/bbsys.localに設定が必要となります。以下の手順で追加します。

$ cd /home/bb/server
$ echo "FPING=/usr/local/sbin/fping" >> etc/bbsys.local
$ echo "export FPING" >> etc/bbsys.local


6. bbdへのパッチあてとコンパイル

   ここまででbbgen本体のインストールはほぼ完了したので、bbgen対応のbbdへの変更作業を行います。変更コードはbbgen-3.6/bbpathesディレクトリの下に1.9c用/1.9e-server用/1.9e-client用に分かれて配布されています。最新のBBサーバのパッチは非公式ですが個別に配布されているので、パッチをあてる際は注意が必要です(コラム参照)。

$ cd /home/bb/server
$ gpatch -p0 < /home/bb/bbgen-3.6/bbpatches/1.9h-server/bbd-background.patch
$ gpatch -p0 < /home/bb/bbgen-3.6/bbpatches/1.9h-server/bbd-features.patch

   パッチあてが完了したらBBサーバのHOMEディレクトリ配下のsrcディレクトリに移動して、コンパイルを行います。

$ cd src
$ gmake


7. bbgen版bbdのインストールとBBSVRの再起動

   コンパイルの終了したbbgen版bbdをインストールし、bbの再起動を行います。

$ ../runbb.sh stop
$ gmake install
$ ../runbb.sh start
Stopping Big Brother...
   Starting Big Brother Daemon (bbd)...
   Starting Network tests (bb-network)...
   Starting Display process (bb-display)...
   Starting external scripts
      Starting external script bbmrtg-dmz-sw0.pl
      Starting external script bbmrtg-dns0.pl
      Starting external script bbmrtg-fs0.pl
      Starting external script bbmrtg-fw.pl
      Starting external script bbmrtg-mail0.pl
      Starting external script bbmrtg-www.pl
      Starting external script bbmrtg.pl
      Starting external script larrd/larrd.pl
Big Brother 1.9h started


bbgenの拡張機能

   bbgen版BBの再起動後、数分後に新しいBB画面が表示されます。機能拡張を含めてほとんどの機能や環境が引き継がれており、トップ画面から見える差異は少ないので、変化はあまりわからないと思います。

bbgenで機能を拡張したBBの監視トップ画面
図1:bbgenで機能を拡張したBBの監視トップ画面
(画像をクリックすると別ウィンドウに拡大図を表示します)

   しかし様々な点が機能が増えており、さらに拡張が可能です。そこで次回は、追加された機能とさらなる拡張で様々な機能を付与していきます。


バージョン1.9h、1.9i用のパッチ処理

   パッケージにはBB 1.9c用のパッチのみが収録されています。1.9h、1.9iにインストールする場合には以下の場所より1.9h以降用のパッチファイルを個別にダウンロードします。


   これらのファイルを/home/bb/bbgen-3.6/bbpatches/1.9h-serverディレクトリ配下に保存します。

   パッチあてで注意が必要なのは「bbd-background.patch」です。このパッチファイルではsrc/dohostsvc.cのあて先が異なるディレクトリになっています。ですのでpatchコマンドからパッチを当てるファイルを指定する際に、「src/dohostsvc.c」を直接指定してください。またbbd-features.patchファイルは特別なオペレーションはなしで処理できます。

  $ cd /home/bb/server
  $ gpatch -p0 < /home/bb/bbgen-3.6/bbpatches/1.9h-server/bbd-background.patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ur src-19h/dohostsvc.c src-bkgpatch/dohostsvc.c
|--- src-19h/dohostsvc.c        2005-07-08 22:30:13.000000000 +0200
|+++ src-bkgpatch/dohostsvc.c   2005-09-04 11:06:18.849224529 +0200
--------------------------
File to patch: src/dohostsvc.c
patching file src/dohostsvc.c
Hunk #1 succeeded at 340 (offset 80 lines).
patching file web/hist_header
patching file web/histlog_header
patching file web/hostsvc_header
patching file web/replog_header
  $ gpatch -p0 < /home/bb/bbgen-3.6/bbpatches/1.9h-server/bbd-features.patch
patching file src/bb.c
patching file src/bbd.c
Hunk #4 succeeded at 809 (offset 1 line).
Hunk #6 succeeded at 1181 (offset 1 line).
Hunk #8 succeeded at 1343 (offset 1 line).
Hunk #10 succeeded at 1383 (offset 1 line).
Hunk #12 succeeded at 1495 (offset 1 line).
Hunk #14 succeeded at 1770 (offset 1 line).
Hunk #16 succeeded at 1931 (offset 1 line).
patching file src/bbpage.c
patching file src/bbsend.c
patching file src/dohostsvc.c
Hunk #4 succeeded at 389 (offset -2 lines).
patching file src/getipaddr.c
patching file src/loadhosts.c
patching file src/minimake/Makefile
patching file src/utils.c


前のページ  1  2  3  4


イー・モバイル株式会社 矢萩 茂樹
著者プロフィール
イー・モバイル株式会社  矢萩 茂樹
2000年、個人で使えるメガレベルのサービスの可能性を目のあたりにしてADSL事業の立ち上げに参加。ADSLによるブロードバンドIPネットワークの設計・企画に従事。その関連業務で気軽に使えるネットワーク監視手法が必要となり、派生的結果としてオープンソースベースのツールをInternetWeekなどで紹介するに至る。現在、空気媒体のブロードバンド実現に向けて奮闘中。


INDEX
第10回:究極のBB機能拡張bbgen
  bbgenとは
  bbgenのインストールに必要なソフトウェア
  bbgenインストール手順
4. bbgen起動スクリプトのコピー