HotSaNIC-0.5 のインストール
|
■ このページでは、HotSaNIC-0.5 のインストール手順を説明しています。
このページでは、 「HotSaNICのインストール」(Ver.0.4 ) を読んだ方のために、最新版「HotSaNIC-.0.5.0_Pre5」のについての情報を提供しています。バージョン0.4 のインストール手順は、こちらをご覧くだ さい。
HotSaNIC で利用する関連ソフトウェアのインストールと設定手順も簡単ですが書いておきました。
HotSaNIC-0.5.0_Pre5 をテストインストールしたマシン環境
OS : RedHatLinux 9 ( Kernel 2.4.20-28.7 )
マシン: 1.日立 FLORA DC-330 ( MMX-Pentium 230Mhz/Mem:128MB/HDD:20GB )かなり古い!
2、自作PC ( CPU/VIA-C3 1GHz Mem/512MB マザーボード/JetWay 603TCF HDD/40GB )
HotSaNIC : Html overview to System and Network Information Center■ スクリーンショット
以下の手順は、すべての Linux での HotSaNIC の動作を保証するものではありません。
1つの実行事例であり、参考事例として利用してください。
設定の手順の実行は、自己責任において行ってください。
この手順によって発生した障害や損害については、一切の責任を負いません。
■ 必要なソフトウェアと入手先ページ
● インストールには次のソフトウェアを利用しました
・ Red Hat Linux 9
Perl 5 が必須、
・ HotSaNIC-0.5.0_pre5 URL : http://hotsanic.sourceforge.net/
ホットサニック
・ rrdtool-1.0.46 URL : http://www.rrdtool.com/
ラウンドロビンデータベース RRDTool
・ ImageMagick-5.4.7-10 URL : http://www.imagemagick.org/
イメージマジック(グラフィック処理シフト: サムネール画像の作成に必要です。rpmをおすすめします。 )
・ net-snmp-5.0.9 URL : http://net-snmp.sourceforge.net/
SNMP サーバー/クライアント ( ホストの情報を収集するために利用します。 )
・ Apache-2.0.47 URL : http://www.apache.org/
アパッチ HTTPサーバー
LANなどのネットワークに接続された他のコンピューターをモニターする場合は、その機器にSNMP をインストールします。
このページでのビルド作業の実行権限は root ですが、実際のビルドでは、一般ユーザー権限と root権限を適切に使い分けてインストールしてください。
■ このページのメニュー
新しい機能
HotSaNIC-0.5.0 ( Pre Release5 版) で変更された点は、ソースプログラムに付属の Documentation の中で説明されています。
1年前にリリースされていた HotSaNIC-0.5 ではいくつか問題点?を発見しましたが、今回テストした 0.5.0_Pre5 では改善されていました。HotSaNIC を利用される場合は、0.5.0 を利用されることをおすすめします。
おおざっぱですが気づいたことを挙げておきます。
・ 新しいモジュールが追加されました。( UPS、BIND、MAILQ、NETSTAT、SHOUTCAST )
・ Solaris もサポートされました。
・ BSD 系 UNIX ( FreeBSD、OpenBSD、NetBSD)では、利用できるモジュールがふえました。
・ ディレクトリ構造が大きく変更されて、モジュールがサブディレクトリに収納されました。
・ メインの設定ファイル settings で指定できる項目が追加されました。
・ インターバルを設定ファイル settings で指定することができるようになりました。
・ 以前の HotSaNIC-0.4 にくらべて実行中のシステムの負荷が軽減されているようです。
・ Perl スクリプトの拡張子は .pl になりなました。
・ 文字コードは UTF-8 になった? ( 以前のインストール環境は英語だったので未確認です。)
・ 設定スクリプト setup.pl では、「モジュールの対話式設定事項」が詳細になりました。
・ 温度センサーモジュール SENSORS では、モニターできる項目は CPU温度、FAN回転数、電圧になりました。、
● 追加されたグラフ画像の一部です
IRQ は1秒あたりの割込み発生数をグラフ表示します
Uptime は通算稼動時間をグラフ表示します
NETSTAT はネットワークとの接続情報をグラフ画像にします
サポートするOSと機能
HotSaNIC-0.5.0_Pre5 では、サポートされるOSと機能が広がりました。
Linux では実装されているすべてのモジュールが利用できます。
Linux 以外のサポートOSについては、メインの設定ファイル settings の冒頭に次のような説明があります。
# In this file all global settings for HotSaNIC are defined.
#
# Currently supported operating systems are:
#
# Linux
# fully featured for any Linux system, based on Kernel 2.4.x
# 2.2.x based systems may encounter some incompatibilities
#
# OpenBSD
# FreeBSD
# NetBSD
# at the moment a lot of work has to be done to get the system
# completely running under BSD based systems. Currently supported
# are the following modules:
#
# |FreeBSD |OpenBSD |NetBSD
# ----------+---------------+---------------+-----------
# apcusv |untested |untested |untested
# apps |yes |should work |yes
# diskio |no |no |yes
# dnet |yes |should work |should work
# networks |no |no |no
# part |yes |yes |yes
# ping |yes |untested |yes
# sensors |yes(1) |no |untested
# shoutcast |should work |should work |should work
# system |yes |untested |yes
# traffic |yes |should work |yes
# worms |should work |should work |should work
#
# (1) using the xmbmon utility ver 2.0 or later
# http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/
# (can be compiled without X support!!!)
# ※ FreeBSDでは、CPU温度のモニターをできるようになりました♪
#
# solaris
# same (if not more) amount of work has to be done on Solaris. The
# current state for this %&%@"$&&%$ OS looks as follows:
#
# apcusv yes
# apps should work
# diskio no
# dnet should work
# networks no
# part no
# ping should work
# sensors no
# shoutcast should work
# system yes
# traffic no
# worms should work
※ Solaris への移植はこれからですね。
<< 以降省略 >>
HotSaNICの開発チームの環境はLinux のようです。
FreeBSD についてもサポートされる機能がふえています。
Solaris にも移植がすすんでいるようです。
インストールの注意点
HotSaNIC に関連するソフトウェアを先にインストールしておきます。
# cd
/usr/local/src
# tar zxvf rrdtool-1.0.46.tar.gz # cd rrdtool-1.0.46 # ./configure # make # make install # make site-perl-inst # cd /usr/local # ln -s rrdtool-1.0.46 rrdtool |
# apt-get update
# apt-get install ImageMagick |
# tar zxvf
net-snmp-5.0.9.tar.gz
# cd net-snmp-5.0.9 # ./configure # make # umask 022 # make install # cp EXSAMPLE.conf /etc/snmp/snmpd.conf |
HotSaNIC の設定
● HotSaNIC-0.5.0-pre5 のソースを解凍する
ソースファイルをユーザー権限で解凍し、 /usr/local にコピーします。
ドキュメントは解凍したディレクトリ内の HotSaNIC/Document/ 以下にあるので読みます。
$ cp hotsanic-0.5.0-pre5.gz
~ #ユーザーのホーム
ディレクトリにコピー
$ cd $ tar zxvf hotsanic-0.5.0-pre5.gz # 解凍する # cp -r HotSaNIC /usr/local # コピーする << ディレクトリごとオーナーを root にする >> # chown -R root.root HotSaNIC # cd HotSaNIC |
● 設定スクリプト setup.pl で設定ファイル settings を設定する
HotSaNIC のスクリプト setup.pl を実行することで、設定ファイル settings の設定が対話式にできます。
つぎの画面は設定スクリプト実行例です。( 後学のために失敗した個所もそのまま掲載。)
[root@kaede HotSaNIC]# ./setup.pl
Malformed UTF-8 character (unexpected continuation byte 0xb4, with no preceding
start byte) at lib/HotSaNICshellio.pm line 125 (#1)
Perl detected something that didn't comply with UTF-8 encoding rules.
One possible cause is that you read in data that you thought to be in
UTF-8 but it wasn't (it was for example legacy 8-bit data). Another
possibility is careless use of utf8::upgrade().
Configuring modules:
Module found: APCUSV # ACP社のUPS管理モジュール
Description:
Records some APC-UPS specific readouts:
- load percentage
- battery percentage
- time left when on battery
- output voltage
- system temperature
- battery voltage
Do you want to use this module? (Y/n) >
Do you want to show this module's graphs on the webpage? (Y/n) >
----------------------------------------
Module found: APPS # アプリケーション管理モジュール
Description:
Records the number of instances of the specified applications.
Do you want to use this module? (Y/n) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y
----------------------------------------
Module found: BIND # BINDの管理モジュール
Description:
Records statistics from the ISC BIND nameserver
Do you want to use this module? (Y/n) > n
----------------------------------------
Module found: DISKIO # Disk I/O の管理モジュール
Description:
Records I/O statistics for harddisks.
Do you want to use this module? (Y/n) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y
----------------------------------------
Module found: DNET # DNET の設定
Description:
Records stats for Distributed.net personal proxies
Do you want to use this module? (Y/n) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y
----------------------------------------
Module found: MAILQ # Mail スプールの管理モジュール
Description:
Records outbound mail status.
Currently supported mail-systems: postfix
Do you want to use this module? (Y/n) > n
----------------------------------------
Module found: NETSTAT # ネットワークステータスの管理モジュール
Description:
Records network socket-states.
Do you want to use this module? (Y/n) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y
----------------------------------------
Module found: NETWORKS # IP Tables のモニター
Description:
Records IP- and protocol-based traffic stats.
ipchains/iptables required!
Do you want to use this module? (Y/n) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y
----------------------------------------
Module found: PART # ハードディスクのパーティション管理
Description:
Records partition usages.
Do you want to use this module? (Y/n) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y
----------------------------------------
Module found: PING # PING によるトラフィックモニター
Description:
Records min/avg/max ping-times for configured hosts
Do you want to use this module? (Y/n) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y
----------------------------------------
Module found: SENSORS # CPUの温度モニター
Description:
Records stats for configured hardware sensors
LM-Sensors required!
Do you want to use this module? (Y/n) > n
----------------------------------------
Module found: SHOUTCAST # ストリーミングサーバーSHOUTCASTのモニター
Description:
Records remote stats for ShotCast servers
Note: The console-webbrowser "lynx" has to
be installed to use this module.
Do you want to use this module? (Y/n) > n
----------------------------------------
Module found: SYSTEM # SNMPによるOSシステムのモニター
Description:
Records system specific data:
- cpu usage
- irqs
- loadavg
- memory / swap
- # of processes
- uptime
- # of users
Do you want to use this module? (Y/n) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y
----------------------------------------
Module found: TRAFFIC # TRAFFIC のモニター
Description:
Records usage of ethernet devices (input / output)
Do you want to use this module? (Y/n) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y
----------------------------------------
Module found: WORMS # WebサーバーでのWORM モニター
Description:
Records stats for worm-impacts on local webserver
Do you want to use this module? (Y/n) > n
----------------------------------------
setting up apcusv ...
Malformed UTF-8 character (unexpected continuation byte 0xb4, with no preceding
start byte) at ../../lib/HotSaNICshellio.pm line 125 (#1)
Perl detected something that didn't comply with UTF-8 encoding rules.
One possible cause is that you read in data that you thought to be in
UTF-8 but it wasn't (it was for example legacy 8-bit data). Another
possibility is careless use of utf8::upgrade().
ERROR: apcaccess could not be found.
Please check the settings file and adapt it to satisfy your needs.
setting up apps ...
Malformed UTF-8 character (unexpected continuation byte 0xb4, with no preceding
start byte) at ../../lib/HotSaNICshellio.pm line 125 (#1)
Perl detected something that didn't comply with UTF-8 encoding rules.
One possible cause is that you read in data that you thought to be in
UTF-8 but it wasn't (it was for example legacy 8-bit data). Another
possibility is careless use of utf8::upgrade().
anacron (running 1 times now) - Use this item?? (y/N) >
apmd (running 1 times now) - Use this item?? (y/N) >
bash (running 2 times now) - Use this item?? (y/N) >
bdflush (running 1 times now) - Use this item?? (y/N) >
crond (running 2 times now) - Use this item?? (y/N) >
<< 途中を省略 : 対話式にモニターの要・不要を指定します。 >>
Writing main settings ...
checking path to "rrdtimer.pl" (current: 'not configured')
DAEMONDIR="/usr/local/HotSaNIC"
checking path to "rrdtool" (current: 'not configured')
BINPATH="not configured"
VARDIR="$DAEMONDIR/var/"
LOGDIR="$DAEMONDIR/var/log/"
PIDFILE="$DAEMONDIR/var/run/rrdtimer.pid"
DIAGRAMLOG="last"
LOGSIZE="200000"
LOGBACKUPS="5"
DEBUGLEVEL="-1"
STIME="120"
SCHEDULE_MIN="100"
SCHEDULE_MAX="200"
RUN="apcusv apps diskio dnet netstat networks part ping system traffic"
WEBDIR="not configured"
WIDTH="600"
HEIGHT="200"
IMAGEFORMAT="gif"
SHOW="apcusv apps diskio dnet netstat networks part ping system traffic"
ORDER="traffic system part ping dnet sensors"
DTIME="15"
CTIME="24"
guessing convert method...
checking for Image::Magick perl module... not found
checking path to "convert" from ImageMagick (current: 'not configured')
detected: /usr/bin/convert
is this corrrect? (Y/n) >
CONVERTMETHOD="ImgMgck"
CONVERTPATH="/usr/bin/convert"
THUMBSIZE="20%"
REFRESH="300"
checking path to "snmpwalk" (current: 'not configured')
SNMPWALK="not configured"
checking path to "snmpget" (current: 'not configured')
SNMPGET="not configured"
checking path to "snmpbulkwalk" (current: 'not configured')
SNMPBULKWALK="not configured"
--- Main settings generated. ---
Writing start/stop script "rrdgraph" ... Ok.
Now adapt all settings files to satisfy your needs.
They are all linked to the directory <HotSaNIC_installdir>/var/settings .
上記の要領でメイン設定ファイル settings の大枠をス クリプトで設定します。
後半は設定の結果が出力されるので、未設定の項目をこの出力で確認し、エディターで再設定します。
スクリプト setup.pl でおおわくを設定したのちに、エディターでさらに settings の未処理の設定をします。
ディレクトリの指定: DAEMONDIR、 WEBDIR、・ ・ ・ などは設定する必要があります。
※ 設定ファイル settings の設定例 を参考にしてくださ い。
各モジュールの個別の設定は、そのモジュール・ディレクトリ内にあるファイル settings を直接編集します。
● HotSaNICのインデックス・ページ index.html を作成する
1、HotSaNIC のインデックス・ページを収納するディレクトリを作成する。
2、HotSaNIC を初期化起動する。( コマンドオプション -i を付けて起動する )
3、スクリプト makeindex.pl を実行して、HotSaNIC のWebページ ( グラフ出力ページ )を生成する。
4、トップページのサムネール ( 縮小画像 ) を作成するスクリプト convert.pl を実行する。
以下のように4つのコマンドを実行します。
[root@kaede HotSaNIC]# mkdir /var/www/stat/hotsanic #出力ディレクトリを作成
[root@kaede HotSaNIC]# ./rrdtimer -i # 起動する
< 最低30秒間稼動させてから次のコマンドを実行する >
[root@kaede HotSaNIC]# ./makeindex.pl # index.htmlを作成
[root@kaede HotSaNIC]# ./convert.pl # サムネールを作成
コマンドが正常に実行されると Apache の公開用ディレクトリ /var/www/stat/hotsanic に index.html が作成されます。
index.html などのファイルができたことを確認してください。
##
sec.name
source community
com2sec local localhost WHZAT #コミュニティー名を WHZAT に指定 |
# snmpd -c
/etc/snmp/snmpd.conf
|
# snmpwalk -v 1
-c WHZAT localhost system
<< または >> # snmpwalk -v 2c -c WHZAT localhost .1.3.6.1.4.1.2021.11 |
| Apache の設定 |
Alias /hotsanic
/var/www/stat/hotsanic
<Directory /var/www/stat/hotsanic > Options None Allowoverride None Order Allow,deny Allow from my.net </Directory> |
#
/etc/rc.d/init.rd/httpd restart # 起動する
# /etc/rc.d/init.rd/httpd stop # 停止する |
HotSaNIC を使う
HotSaNIC を起動させる前に、SNMPを起動させておきます。
1、上記のインストール手順を終了後、 HotSaNIC を起動させる。
[root@kaede HotSaNIC]# ./rrdgraph start # 起動する
[root@kaede HotSaNIC]# ./rrdgraph stop # 停止する
2、LANに接続されたPCの ブラウザーで HotSaNIC のページにアクセスして確認する。
URL : http://[サーバーのIPアドレス]/hotsanic/
例: http://192.168.0.12/hotsanic/
この画面が表示されれば、正常に稼動できています。
<< 再駆動させる
>>
[root@kaede HotSaNIC]# ./rrdgraph start # 起動する [root@kaede HotSaNIC]# ./rrdgraph stop # 停止する [root@kaede HotSaNIC]# ./makeindex.pl # index.htmlを作成 <<
数分後、グラフが生成されたのちに >>
[root@kaede HotSaNIC]# ./convert.pl # サムネールを作成 |
Tips
● settings のチューニング
HotSaNIC の各モジュールの設定は、そのモジュール・ディレクトリ内の settings にて行います。
モジュールによっては、( PING など )settings にいくつものグラフを登録できるものがあります。
HotSaNIC では、サーバーの状態をグラフで確認しながら、負荷が最小限 になるようインターバルのチューニングすることをおすすめします。インターバルを大きくしてデータ取得回数を減らすと、グラフのプロット間隔が大きくなっ てギザギザな感じになりますが、サーバーの負荷を軽減できます。両者はトレードオフの関係にあります。
● HotSaNIC の使い方について
1、いろいろなグラフを使ってみよう
HotSaNICでグラフ表示させる項目が多いほど、サーバーの負荷が増えま す。しかし、最初は全部表示させておき、だんだんと目的に則したグラフだけをしぼりこんでゆくことをおすすめします。どんな処理が CPU負荷になるかなど、日々の管理の中で知ることができます。グラフを減らしたことで、どのくらい変化するかもすることができます。
また、作成したグラフ画像は単体で利用できます。各グラフを組み合わせて利用することで、さまざまなオリジナルのモニターページができます。デフォルト の index.html ページを HTML エディターで編集し、グラフを自由に組み合わせてカスタマイスできます。HotSaNIC が生成する各グラフは、垂直配置することで時間軸を合わせることができます。
3、一般ユーザーに公開する場合はよく考えて
サーバーの運用情報を公開す る場合には、性悪説の視点で思慮深く選んで公開してください。学校や公共的な環境では、ユーザーの必要とする最小限の指標グラフをえらんでください。例と してファイルサーバーならば、PART のグラフ、DISK I/O、TRAFFIC などの公開が適切です。
HotSaNIC はサーバー管理の便利なツールですが、なるべく管理者だけで利用することをおすすめします。
4、SNMP を使ったモニター
モジュールの SYSTEM はプロトコル SNMP を利用して、TCP/IP のネットワーク上にある他のPCもモニターできます。SNMP を使うことで MRTG と同じようにネットワークの管理に利用できます。MRTGよりも間単に利用できます。
以下の2つの画像は、HotSaNIC の メモリーグラフ ( デフォルトのグラフ ) と、SNMP から取得したメモリーグラフです。どちらも同じサーバーのグラフですが、表記が違って見えます。SNMP で取得した情報をグラフ表示させる場合は、表記の設定で調整することも必要になります。また、複数のサーバーを集中的に管理する場合は、NTPサーバーを 利用して全サーバーの時計を同期させて運用します。
実装する場合は事前にテストをしてください。
デフォルトのメモリーモニターグラフ
SNMP を利用したメモリーモニターグラフ
6、サーバーのCPU温度モニターに使ってい ます
わたしが HotSaNIC を使うきっかけは、「自宅サーバーをファンレスで運用し、外出先からもCPU温度を知りたい。」という動機でした。MRTG の開発者 Tabias Oeticker 氏の RRDTOOL をしらべていて HotSaNIC にたどりつきました。( MRTGは、ルーターのトラフィック情報をSNMPで取得し、そのグラフを生成するソフトウェアです。)
自宅サーバーには、HotSaNIC の SENSORS のモジュールを使い、CPU ( VIA-C3 )の内部温度について書いたページがありますので参考までにごらんください。
サーバーCPU温度の推移グラフ 2003/04〜2004/03 :
謝 辞
HotSaNIC は、Bernd Pissny、 Matt Burke、 Peter Reich、 Benjamin Meyer の4人のエンジニアが中心に開発しています。Hot SaNICは、FSF ( Free Software Foundation )の GNU General Public License にしたがって配布されています。
RRDTOOL は、MRTGの開発者でもある Tobias Oetiker 氏により開発されました。
これらのすばらしいソフトウェアが自由に利用できることに感謝しています。
Have a nice day !
もどる