この情報は古い可能性があります!

まずはRRDToolのインストールをします。
1.0.xx系は日本語化パッチが出ていますが、
1.2.xx(1.3)系はGDを使わない(?)ためフォントを指定してコンパイルしないと
HotSaNICを使うときに日本語が文字化けします。

RRDtool : http://oss.oetiker.ch/rrdtool/
HotSaNIC : http://hotsanic.sourceforge.net/

うまくフォントが表示されない方の為に、
モナーフォントを最小構成(?)でコンパイルしておきましたのでご自由にご利用ください。
http://ftp.momo-i.org/pub/other/mona.ttf

2Mくらいあるのですが、まぁ全部コンパイルするよりは
かなり軽くなってるとおもいます。
これよりもいいフォントあるぜ!って方がいらっしゃいましたら教えてください?
あと、↑のフォントライセンス的にまずいとかあればそれも教えてください?

これを適当な場所においてコンパイルします。
1.3.xが出てますが、ここでは1.2.xの最新を使います。

wget http://ftp.momo-i.org/pub/other/mona.ttf
mv mona.ttf /usr/share/fonts/japanese/TrueType/

cd /usr/local/src
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.30.tar.gz
tar zxvf rrdtool-1.2.30.tar.gz
cd rrdtool-1.2.30

./configure --with-rrd-default-font=/usr/share/fonts/japanese/TrueType/mona.ttf
make
make install
make site-perl-install

cd /usr/local
ln -s rrdtool-1.2.30 rrdtool

既に2003年あたりで停滞してるツールですが、
まだまだローカルホストだけの状態監視なら
使えるツールなので頑張って使います。

cd /usr/local/src
wget http://hotsanic.sourceforge.net/snapshot/hotsanic-0.5.0-pre6-snapshot.tgz
tar zxvf hotsanic-0.5.0-pre6-snapshot.tgz
cp -r HotSaNIC /usr/local

cd /usr/local/HotSaNIC
./setup.pl

そしてなぜかImageMagick-perlがおかしくなってしまったので、
アンインストールしてイメージ変換はperlのモジュールではなく
/usr/bin/convertを利用するようにします。

また、HotSaNICの0.5.0-pre6では以下の状態監視ができますが、
監視するものを絞っていきます。

APCUSVUPSの監視?×
APPS各アプリケーション
BINDDNS
DISKIODiskのIO
DNETProxy??×
MAILQSendmailのキュー×
NETSTATNetstatの状態
NETWORKSネットワークの状態
NTPNTP
PARTパーティションの状態
PINGPing
SENSORSSensorsの状態
SHOUTCASTラジオの状態×
SYSTEMシステム状態
TRAFFICトラフィックの状態
WORMSApacheのワームのログ情報?×

Configuring modules:


Module found: APCUSV

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

Description:
Records statistics from the ISC BIND nameserver
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: DISKIO

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

Description:
Records stats for Distributed.net personal proxies
Do you want to use this module? (Y/n) > n

----------------------------------------


Module found: MAILQ

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

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: NTP

Description:
Records timeserver drift stats
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

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

Description:
Records stats for configured hardware sensors
LM-Sensors required!
Also capable of recording HDD temperatures
(hddtemp and SMART support 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: 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

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

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

Description:
Records stats for worm-impacts on local webserver
Do you want to use this module? (Y/n) > n

----------------------------------------

setting up apps ...
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.6/FAQ
xxx(アプリケーション名がずら~っと出てきるます。) (running 1 times now) - Use this item?? (y/N) > n
Please check the settings file and adapt it to satisfy your needs.

setting up bind ...
select one of these items:
0 /usr/sbin/rndc
1 /usr/sbin/rndc-confgen
by just pressing <ENTER>, item "0" will be selected.
select item 0 ... 1? > 0
Please check the settings file and adapt it to satisfy your needs.

setting up diskio ...
Please check the settings file and adapt it to satisfy your needs.

setting up netstat ...
This module doesn't need any configuration right now.

setting up networks ...
Configuring local interfaces.
(i)nternal means an interface pointiong to your local machines (intranet)
(e)xternal means an interface connecten with the internet
(n)one means you don't want to account this interface.
found eth0 - (i)nternal, (e)xternal or (n)one? > i
found lo - (i)nternal, (e)xternal or (n)one? > i
Please check the settings file and adapt it to satisfy your needs.

setting up ntp ...
Please check the settings file and adapt it to satisfy your needs.

setting up part ...
Use "/dev/md1", mounted on "root filesystem"? (y/N) > y
Use "/dev/md0", mounted on "/boot"? (y/N) > y
Use "tmpfs", mounted on "/dev/shm"? (y/N) > y
Use "/dev/md6", mounted on "/home"? (y/N) > y
Use "/dev/md5", mounted on "/tmp"? (y/N) > y
Use "/dev/md3", mounted on "/usr"? (y/N) > y
Use "/dev/md4", mounted on "/var"? (y/N) > y
Please check the settings file and adapt it to satisfy your needs.

setting up ping ...
Please check the settings file and adapt it to satisfy your needs.
you probably have to configure some destination hosts.

setting up sensors ...

Please check the settings file and adapt it to satisfy your needs.
for your info: this configuration is a bit tricky

setting up system ...
Please check the settings file and adapt it to satisfy your needs.

setting up traffic ...
Use eth0?? (y/N) > y
Use lo?? (y/N) > y
Please check the settings file and adapt it to satisfy your needs.
If you have any interfaces other than 100 MBit, please change the
corrosponding default values.
Maybe there are some additional interfaces or SNMP hosts you want
to query.
Ok.
Writing main settings ...
checking path to "rrdtimer.pl" (current: 'not configured')
DAEMONDIR="/usr/local/src/hotsanic/HotSaNIC"
checking path to "rrdtool" (current: 'not configured')
select one of these items:
0 /usr/bin
1 /usr/local/rrdtool-1.2.15/bin
by just pressing <ENTER>, item "0" will be selected.
select item 0 ... 1? > 1
BINPATH="/usr/local/rrdtool-1.2.15/bin"
VARDIR="$DAEMONDIR/var/"
LOGDIR="$DAEMONDIR/var/log/"
PIDFILE="$DAEMONDIR/var/run/rrdtimer.pid"
WEBDIR="$DAEMONDIR/www"
DIAGRAMLOG="last"
LOGSIZE="200000"
LOGBACKUPS="5"
DEBUGLEVEL="0"
TIMESTAMPING="2"
STIME="120"
SCHEDULE_MIN="100"
SCHEDULE_MAX="200"
RUN="apps bind diskio netstat networks ntp part ping sensors system traffic"
AUTOINDEX="no"
WEB_BACKGROUND="bg.gif"
WEB_MENUBACKGROUND="menubg.gif"
WEB_BGCOLOR="E0E0E0"
WEB_TEXT="000000"
WEB_LINK="000080"
WEB_VLINK="800080"
WEB_ALINK="008000"
WIDTH="600"
HEIGHT="200"
IMAGEFORMAT="gif"
SHOW="apps bind diskio netstat networks ntp part ping sensors 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) > y
CONVERTMETHOD="ImgMgck"
CONVERTPATH="/usr"
THUMBSIZE="20%"
REFRESH="300"
checking path to "snmpwalk" (current: 'not configured')
detected: /usr/bin/snmpwalk
is this corrrect? (Y/n) > y
SNMPWALK="/usr/bin/snmpwalk"
checking path to "snmpget" (current: 'not configured')
detected: /usr/bin/snmpget
is this corrrect? (Y/n) > y
SNMPGET="/usr/bin/snmpget"
checking path to "snmpbulkwalk" (current: 'not configured')
detected: /usr/bin/snmpbulkwalk
is this corrrect? (Y/n) > y
SNMPBULKWALK="/usr/bin/snmpbulkwalk"

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

これで基本のインストールは完了です。
次に細かい設定をしていきます。

/usr/local/HotSaNIC/settings

WEBDIR="$DAEMONDIR/www"

WEBDIR="/usr/local/apache2/htdocs/rrdtools"
#HotSaNICのグラフをおきたいディレクトリを指定

IMAGEFORMAT="gif"

IMAGEFORMAT="png"
#gifはやなのでpngで

SHOW="apps bind diskio netstat networks ntp part ping sensors system traffic"
これはお好きに変更するといいです
インデックスで表示させないだけで、各htmlの出力はします。

ORDER="traffic system part ping dnet sensors"
これはインデックスで表示させる順番です

CONVERTPATH="/usr"

CONVERTPATH="/usr/bin"

以上でとりあえず動かせる状態になりました。
以下のコマンドで起動できます。

/usr/local/HotSaNIC/rrdgraph start

5分くらいたってから以下のコマンドを実行してみましょう。

/usr/local/HotSaNIC/makeindex.pl
/usr/local/HotSaNIC/convert.pl

実行をすると以下のメッセージが一杯出てきます。

resizing /usr/local/apache2/htdocs/rrdtool/traffic/eth0-week.png

そしたらhttp://localhost/rrdtool/にアクセスをすると
(localhostは適宜おきかえてください?)
インデックスがあら不思議と表示されるはずです。
最初はほとんどグラフも表示されないかもしれませんが、
数時間くらいたってから再度見てもらえれば少し情報が載ったグラフが出てくるとおもいます。

最初のsetup.plで設定できない設定をしましょう。

まずはDISKIOですが、これはLinuxのKernelが2.6系では
以下のとおりすることでうまくいくかもしれません。
HDDが/dev/hdaで構築してある前提でいきます。

grep hda /proc/diskstats
x x hda ~~~~
#xは数字に置き換わりますので、HDDがたくさんある場合はその分やりましょう? hdb hdc hdd hde hdf etc...

cd /usr/local/HotSaNIC/modules/diskio
vi settings

SOURCE="stat"

SOURCE="diskstats"

DEV=x_x,hda
を追加

次にPing

cd /usr/local/HotSaNIC/modules/ping
vi settings

以下を追加
HOST="xxx.xxx.xxx.xxx,hoge,ping"

次にSensorsを編集します。
lm_sensorsに対応していないサーバではHDDの温度監視だけします。
そのためにまずはhddtempをインストールします

yum -y install hddtemp
hddtemp -n /dev/hda

hddtempの実行時にWarningが出る場合は、
型番を/usr/share/misc/hddtemp.dbに追加することで回避できます。
そしてやっと設定です。

cd /usr/local/HotSaNIC/modules/sensors
vi settings

SENSOR="/usr/bin/hddtemp -n /dev/hda |",hda,HDD1,1,1,0,ーC,40,60

次にTRAFFICの設定
ここはデフォルトで100MB/sなので1Gb/sに修正します

cd /usr/local/HotSaNIC/modules/traffic
vi settings

GRAPH_BASE="bytes"

GRAPH_BASE="bits"

DEV="eth0,12500000,12500000,100 MBit ethernet"

DEV="eth0,125000000,125000000,1GBit ethernet"

これでとりあえずは完了なので、再起動してインデックス等を再生成ましょう。

/usr/local/HotSaNIC/rrdgraph restart
/usr/local/HotSaNIC/makeindex.pl
/usr/local/HotSaNIC/convert.pl

終わったらまたアクセスをすると表示がされているかもしれません。

コメントを追加

制限付き HTML

  • 使用できるHTMLタグ: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • 行と段落は自動的に折り返されます。
  • ウェブページのアドレスとメールアドレスは自動的にリンクに変換されます。
CAPTCHA
半角で
この質問はあなたが人間の訪問者であるかどうかをテストし、自動化されたスパム送信を防ぐためのものです。
ももーい に投稿