検索

カレンダー

2012年2月
« 1月    
 12345
6789101112
13141516171819
20212223242526
272829  

広告

東電電力供給情報

カテゴリー

最近のコメント

リンク

GMOとくとくBB 固定IPアドレス逆引き設定完了

投稿者:yasu 更新日時:2011年4月27日 23時37分59秒
カテゴリCentOS, Linux, Scientific Linux, 自宅サーバー

先日申し込んだGMOとくとくBB固定IP付接続サービスの逆引き設定も無料ということで申し込みをしておりまして、先ほどプロバイダ側の設定が完了したから自宅のDNSサーバーの設定を変更しておくれってメールがきていたので外部向けDNSのzone名をメールで指示のあったzone名に変更してnemedサービスを再起動。

その後モバイルルーターで外部からdigコマンドでIPアドレスから名前解決できるか確認してみました。

ubuntu@ubuntu:~$ dig -x 183.177.138.7

; <<>> DiG 9.7.0-P1 <<>> -x 183.177.138.7
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27756
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;7.138.177.183.in-addr.arpa. IN PTR

;; ANSWER SECTION:
7.138.177.183.in-addr.arpa. 2859 IN CNAME 7.SUB7.138.177.183.in-addr.arpa.
7.SUB7.138.177.183.in-addr.arpa. 86400 IN PTR sa-sa-ki.jp. ←自宅の外部DNSサーバで指定している名前が返ってきました

;; AUTHORITY SECTION:
SUB7.138.177.183.in-addr.arpa. 86400 IN NS ns.sa-sa-ki.jp.

;; ADDITIONAL SECTION:
ns.sa-sa-ki.jp. 51331 IN A 183.177.138.7

おおっ、ANSWER SECTIONに「7.SUB7.138.177.183.in-addr.arpa. 86400 IN PTR sa-sa-ki.jp.」が返ってきていますね。
ついに外部から逆引きで名前解決できるようになりました。

一般的にはプロバイダで固定IPアドレスは提供してくれても外部からの逆引きって自分のDNSを参照してくれないかもしくは有料でっていうのが多いらしいです。
以前使っていたドルフィンインターネットも逆引き設定してもらうだけで別途1,050円支払う必要があるし。
GMOとくとくBBは無料でやってくれます。
気前がいいですね。

逆引きの仕組みや設定方法は下記サイトが役に立つかと思います。
@IT:キャッシュ/逆引きDNSの構築と運用(2/2)

CentOS 5.6 iptablesのログ出力を行う

投稿者:yasu 更新日時:2011年4月15日 15時02分33秒
カテゴリCentOS, Linux, 自宅サーバー

iptablesで破棄されたアクセスのログを取ろうと思います。
ログファイルを別ファイルに出力してかつ毎週ローテーションしようと思います。

iptablesの設定

破棄されるアクセスのログを取りますので、最後のREJECTする前の行にログ出力の設定を追加します。

# iptablesの設定ファイルを変更します
[root@centos ~]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
~ 中略 ~
# ファイアーウォールのログを出力します
-A RH-Firewall-1-INPUT -j LOG --log-level debug --log-prefix '[iptables]:'
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT

[:]キー、[w]キー、[q]キーを順に押下して内容を保存しviエディタを終了します

# iptablesサービスを再起動します
[root@centos ~]# /etc/rc.d/init.d/iptables restart
ファイアウォールルールを適用中: [ OK ]
チェインポリシーを ACCEPT に設定中filter [ OK ]
iptables モジュールを取り外し中 [ OK ]
iptables ファイアウォールルールを適用中: [ OK ]
iptables モジュールを読み込み中ip_conntrack_netbios_ns [ OK ]

syslogの設定

iptablesのログ出力先を指定します。

# syslogの設定ファイルを変更します
[root@centos ~]# vi /etc/syslog.conf
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console
# iptablesのログ出力先を指定します
kern.debug /var/log/iptables.log

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages

# The authpriv file has restricted access.
authpriv.* /var/log/secure

# Log all the mail messages in one place.
mail.* -/var/log/maillog

# Log cron stuff
cron.* /var/log/cron

# Everybody gets emergency messages
*.emerg *

# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler

# Save boot messages also to boot.log
local7.* /var/log/boot.log

# iptables log

[:]キー、[w]キー、[q]キーを順に押下して内容を保存しviエディタを終了します

# syslogサービスを再起動します
[root@centos log]# /etc/rc.d/init.d/syslog restart
カーネルロガーを停止中: [ OK ]
システムロガーを停止中: [ OK ]
システムロガーを起動中: [ OK ]
カーネルロガーを起動中: [ OK ]

ログローテーションの設定

iptablesのログのローテーション設定を行います。

[root@centos ~]# vi /etc/logrotate.d/syslog
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron /var/log/iptables.log {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}

[:]キー、[w]キー、[q]キーを順に押下して内容を保存しviエディタを終了します

以上で設定は終了です。
しばらくして出力した/var/log/iptables.logを見てみると

Apr 15 02:00:39 centos kernel: '[iptables]:'IN=eth0 OUT= MAC=00:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:00 SRC=114.166.97.239 DST=192.168.0.xx LEN=516 TOS=0x00 PREC=0x00 TTL=53 ID=14481 PROTO=TCP SPT=65019 DPT=80 WINDOW=65535 RES=0x00 ACK PSH URGP=0
Apr 15 10:56:35 centos kernel: '[iptables]:'IN=eth0 OUT= MAC=00:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:00 SRC=58.4.67.21 DST=192.168.0.xx LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=33035 PROTO=TCP SPT=62597 DPT=80 WINDOW=16614 RES=0x00 RST URGP=0
Apr 15 10:56:39 centos kernel: '[iptables]:'IN=eth0 OUT= MAC=00:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:00 SRC=58.4.67.21 DST=192.168.0.xx LEN=40 TOS=0x00 PREC=0x00 TTL=54 ID=43980 PROTO=TCP SPT=58552 DPT=80 WINDOW=16412 RES=0x00 RST URGP=0
Apr 15 12:27:21 centos kernel: '[iptables]:'IN=eth0 OUT= MAC=000:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:00 SRC=180.11.99.99 DST=192.168.0.xx LEN=743 TOS=0x00 PREC=0x00 TTL=117 ID=17774 PROTO=TCP SPT=62767 DPT=80 WINDOW=66 RES=0x00 ACK PSH URGP=0
Apr 15 13:14:43 centos kernel: '[iptables]:'IN=eth0 OUT= MAC=00:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:00 SRC=218.42.83.100 DST=192.168.0.xx LEN=40

こんなアクセスがあった事がわかります。

CentOS6の代わりにScientific Linux 6.0 rollingをVMWareの仮想環境にインストールしてみる

投稿者:yasu 更新日時:2011年1月21日 20時29分47秒
カテゴリCentOS, Linux

RedHatLinuxEnterprise6がリリースされて数ヶ月が経過しますが、未だにCentOS6はリリースされません。
いつ頃リリースされるんだろうとインターネットを調べているとこんな記事が。
Linux/CentOS6を待てない方はScientific 6rolling(開発途中版)を - 情報技術の四方山話

Scientific LinuxもCentOSと同じようにRedHatLinuxEnterprise互換の無料ディストリビューションなのでVMWareの仮想環境にインストールして雰囲気を味わってみることにします。

まず下記サイトからisoイメージをダウンロードします。
Index of /linux/scientific/6rolling
※yasuはここから64ビット版をダウンロード

VMWare Playerを起動して新規仮装マシンの作成を選び、ダウンロードした1枚目のDVDイメージ SL-6-x86_64-2011-01-14-DVD1.iso をインストーラディスクファイルに選択して[次へ(N)]ボタンをクリックします。

ゲストOSは[Linux]、バージョンは[CentOS 64 ビット]を選択して[次へ(N)]ボタンをクリックします。

仮装マシンのマシン名と格納場所を決めて[次へ(N)]ボタンをクリックします。

ディスク容量と仮想ディスクの作成方法を選択して[次へ(N)]ボタンをクリックします。

[完了]ボタンをクリックして仮装マシンを起動します。

仮装マシンが起動したら[Install or upgrade an existing system]を選択して[Enter]キーを押下します。

メディアのチェックは時間がかかるので[Skip]を選択して[Enter]キーを押下します。

[Next]ボタンをクリックします。

[Japanese(日本語)]を選択して[Next]ボタンをクリックします。

[日本語]を選択して[Next]ボタンをクリックします。

[基本ストレージデバイス]を選択して[次(N)]ボタンをクリックします。

警告ダイアログが表示されたら[再初期化(R)]ボタンをクリックします。

ホスト名を入力して[次(N)]ボタンをクリックします。
※ここではデフォルトのlocalhost.localdomainのまま進めます

[アジア/東京]を選択し、[システムクロックでUTCを使用(S)]のチェックを外して[次(N)]ボタンをクリックします。

rootのパスワードを入力して[次(N)]ボタンをクリックします。

[カスタムレイアウトを作成する]を選択して[次(N)]ボタンをクリックします。

[ハードディスク]-[sda]-[空き]を選択して[作成(C)]ボタンをクリックします。

[標準パーティション]を選択して[作成]ボタンをクリックします。

パーティション情報を入力して[OK(O)]ボタンをクリックします。
マウントポイント:/
ファイルシステムタイプ:ext4
サイズ(MB):18000
追加容量オプション:固定容量
基本パーティションにする:チェック

再度、[ハードディスク]-[sda]-[空き]を選択して[作成(C)]ボタンをクリックします。

[標準パーティション]を選択して[作成]ボタンをクリックします。

パーティション情報を入力して[OK(O)]ボタンをクリックします。
ファイルシステムタイプ:swap
サイズ(MB):2479
追加容量オプション:固定容量
基本パーティションにする:チェック

[次(N)]ボタンをクリックします。

フォーマットの警告が表示されたら[フォーマット(F)]ボタンをクリックします。

ストレージ設定をディスクに書き込み中が表示されたら[変更をディスクに書き込む(W)]をクリックします。

仮想ディスクのフォーマットが始まるのでしばらく待ちます。

[次(N)]ボタンをクリックします。

インストールするソフトウェアパッケージを選択します。
とりあえず雰囲気を見るだけですので[Desktop]を選択し、追加リポジトリーには[SL]を選択し、[後でカスタマイズ(L)]を選択し[次(N)]ボタンをクリックします。

必要なインストールメディアが表示されたら[続行(C)]ボタンをクリックします。

インストールが始まりますのでしばらく待ちます。

ディスク交換の表示が出たら2枚目のDVDイメージを選択してDVDドライブに接続し[OK]ボタンをクリックします。
※VMWare PlayerのCD/DVDドライブの交換方法の手順はここでは省略します

インストールが完了したら[再起動(T)]ボタンをクリックします。

仮想マシンが再起動してようこそ画面が表示されたら[進む(F)]ボタンをクリックします。

ユーザー名とパスワード、パスワードの確認を入力して[進む(F)]ボタンをクリックします。

[ネットワーク上で日付と時刻を同期化します(Y)]にチェックをして[進む(F)]ボタンをクリックします。

kdumpを設定するにはメモリーが足りません。と出てきましたが無視して[OK(O)]ボタンをクリックします。
※仮想環境のメモリは1GB割り当てていたのですが足りないようです。
 とりあえずお試しなのでお許しを・・・

[終了]ボタンをクリックします。

ログイン画面が表示されるのでログインします。

デスクトップが表示されます。

軽く触ってみましたが雰囲気的にはUbuntu10.04的な感じでデスクトップOSとしても使えそうな気がしました。
まだrolling版(開発途中版?)なので不安定なんでしょうけどこれはCentOS6も含めて楽しみです。
今度は自宅サーバーにすることを意識してGnomeもインストールしないオプションで試してみようかな。

centos kernel: BUG: soft lockup - CPU#3 stuck for 10s!

投稿者:yasu 更新日時:2011年1月17日 12時10分14秒
カテゴリCentOS

今朝自宅サーバーのmessageログを監視していたら見たことないエラーがでてきた。
で、調べてみたら1/2に1回、今日は3回同じようなのが発生していた。

Jan 2 15:11:41 centos kernel: BUG: soft lockup - CPU#3 stuck for 10s! [automount:2618]
Jan 2 15:11:41 centos kernel:
Jan 2 15:11:41 centos kernel: Pid: 2618, comm: automount
Jan 2 15:11:41 centos kernel: EIP: 0060:[<c061e5d8>] CPU: 3
Jan 2 15:11:41 centos kernel: EIP is at _spin_unlock_irqrestore+0x8/0x9
Jan 2 15:11:41 centos kernel: EFLAGS: 00000286 Not tainted (2.6.18-194.26.1.el5 #1)
Jan 2 15:11:41 centos kernel: EAX: f7c3e000 EBX: ffffffff ECX: 00000286 EDX: 00000200
Jan 2 15:11:41 centos kernel: ESI: f675ee94 EDI: f7c3e000 EBP: 000003ea DS: 007b ES: 007b
Jan 2 15:11:41 centos kernel: CR0: 8005003b CR2: b7f58000 CR3: 36790000 CR4: 000006d0
Jan 2 15:11:41 centos kernel: [<c042d6f4>] try_to_del_timer_sync+0x65/0x6c
Jan 2 15:11:41 centos kernel: [<c042d705>] del_timer_sync+0xa/0x14
Jan 2 15:11:41 centos kernel: [<c061d560>] schedule_timeout+0x78/0x8c
Jan 2 15:14:04 centos kernel: [<c042ce21>] process_timeout+0x0/0x5
Jan 2 15:15:37 centos kernel: [<c043a001>] do_futex+0x20b/0xbf6
Jan 2 15:16:31 centos kernel: [<c0472454>] cache_alloc_refill+0x14b/0x482
Jan 2 15:16:36 centos kernel: [<c0403de1>] copy_thread+0xe7/0x1e6
Jan 2 15:20:04 centos kernel: [<c041f81d>] default_wake_function+0x0/0xc
Jan 2 15:20:05 centos kernel: [<c0422c18>] wake_up_new_task+0x20b/0x213
Jan 2 15:20:05 centos kernel: [<c044befe>] audit_syscall_entry+0x15a/0x18c
Jan 2 15:20:05 centos kernel: [<c043aafd>] sys_futex+0x111/0x127
Jan 2 15:20:05 centos kernel: [<c0404f17>] syscall_call+0x7/0xb
Jan 2 15:20:05 centos kernel: =======================

何だろうこれ。
ネットで軽く調べてみたけどこれといって有力な情報は見つけられず。
サービスダウンしているわけでもないし、とりあえず様子見。

やっぱり早くメインサーバーをGT110bに移行しないとダメかなぁ。

■2011/01/21追記
16日からソフトウェアRAID1の再syncが走っていて20日の3時くらいに終わったのですが、それからは発生しなくなりました。
ただ再syncが影響しているかは断言できません。

64ビット版CentOS5.5の設定を進めてみたけど・・・

投稿者:yasu 更新日時:2010年12月7日 16時01分43秒
カテゴリCentOS, 自宅サーバー

CentOS5.5のダウンロードも終わり、DVDとCDに焼いてML110 G6を新たなLinux自宅サーバーとするべくインストールも終わりました。
で、以前flashcastに書いたブログを見ながら設定を進めていたのですが、当時の設定を変更したい箇所がいくつかでてきたりしたので、ちゃんと手順を残そうかと思い、改めてCentOSをインストールし直すことにしました。

構成も考えないとダメかな。
せっかく仮想環境が使えるCPUなんだからKVMで仮想環境にCentOSをインストールしてもよさそう。

もうちょっと考えてからチャレンジしたいと思います。

64ビット版CentOS5.5のディスクイメージサイズがでかすぎ

投稿者:yasu 更新日時:2010年12月6日 19時17分51秒
カテゴリCentOS

HP ProLiant ML110 G6にインストールする64ビット版CentOS5.5をダウンロードしてるんだけどサイズでかすぎ!!
DVD1枚に収まらないってどんだけ機能詰め込んでるんだよ??

10分たってもまだ半分〜。

GT110bとかCore i7 870とかCore i5 760とか

投稿者:yasu 更新日時:2010年12月5日 23時09分43秒
カテゴリCentOS, Ubuntu, Windows, ハードウェア, 自宅サーバー

wikiを参考に激安サーバーで我が家のクライアントPCを一新します。
NEC Express5800/GT110b ×2
Intel Core i7 870×1
Intel Core i5 760×1
Patriot PSD38G1333KH(4GB×2)×2
Creative Sound Blaster 5.1 VX×2

グラボはこの間買ったGV-R4350C-512Iと家に転がってる古いグラボでひとまず凌ぎます。
GT110bには64bit版Windows 7と64bit版Ubuntu 10.04 LTSをインストールして、この間買ったML110 G6は64bit版CentOS5.5をインストールしようと思います。

CentOS5.5にlshwをインストールしてみた

投稿者:yasu 更新日時:2010年12月3日 14時24分35秒
カテゴリCentOS, Linux, Ubuntu

たまたまUbuntu Tipsを読んでいて便利なコマンドがあるなーと思ったのがlshwコマンドなのですが、CentOSにはインストールされていなかったのでCentOSにもlshwをインストールしてみました。
ハードウェア情報を調べるには - Ubuntu Japanese Wiki

[root@centos ~]# vi /etc/yum.repos.d/CentOS-Dag.repo
[dag]
name=CentOS-$releasever - Dag
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1 ←# 0から1に変更
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

ファイルを保存し、viエディタを終了します

[root@centos ~]# yum install lshw
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: ftp.nara.wide.ad.jp
* base: ftp.nara.wide.ad.jp
* extras: ftp.nara.wide.ad.jp
* updates: ftp.nara.wide.ad.jp
dag | 1.1 kB 00:00
dag/primary | 2.2 MB 00:00
dag 10352/10352
Setting up Install Process
Resolving Dependencies
--> Running transaction check
-> Package lshw.i386 0:2.15-1.el5.rf set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================
Package Arch Version Repository Size
==========================================================================================
Installing:
lshw i386 2.15-1.el5.rf dag 1.4 M

Transaction Summary
==========================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)

Total download size: 1.4 M
Is this ok [y/N]: y
Downloading Packages:
lshw-2.15-1.el5.rf.i386.rpm | 1.4 MB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : lshw 1/1

Installed:
lshw.i386 0:2.15-1.el5.rf

Complete!

これでインストール完了です。
あとはlshwコマンドを実行すればハードウェア情報が取得できます。

CentOS5.5にHotSaNICをインストールしてサーバー監視

投稿者:yasu 更新日時:2010年11月14日 15時06分54秒
カテゴリCentOS, Linux

CentOS5.5にHotSaNICを導入してサーバ監視をしたいと思います。

■参考サイト■
はじめての自宅サーバ構築 - Fedora/CentOS - サーバ監視(HotSaNIC + RRDTool)
ハードディスクの温度を測定する方法 - Linuxで自宅サーバ構築(新森からの雑記)

RRDTool(HotSaNIC関連パッケージのひとつ)インストール用dagレポジトリ有効化

RRDToolをyumでインストールする為にdagレポジトリを有効にします。

[root@centos ~]# vi /etc/yum.repos.d/CentOS-Dag.repo
[dag]
name=CentOS-$releasever - Dag
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
# enabledの値を0から1に変更
enabled=0

enabled=1
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

ファイルを保存してviエディタを終了します

HotSaNIC関連パッケージインストール

HotSaNIC関連パッケージをインストールします。

[root@centos ~]# yum -y install rrdtool net-snmp net-snmp-utils ImageMagick hddtemp

RRDTool(HotSaNIC関連パッケージのひとつ)インストール用dagレポジトリ無効化

RRDToolをyumでインストールしたらdagレポジトリを無効にします。

[root@centos ~]# vi /etc/yum.repos.d/CentOS-Dag.repo
[dag]
name=CentOS-$releasever - Dag
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
# enabledの値を1から0に変更
enabled=1

enabled=0
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

ファイルを保存してviエディタを終了します

hhdtemp用設定ファイルダウンロード

hhdtemp用設定ファイルをダウンロードします。

[root@centos ~]# wget -O /etc/hddtemp.db http://www.guzu.net/linux/hddtemp.db

HotSaNICインストール

HotSaNICをインストールします。

[root@centos ~]# cd /usr/local
[root@centos local]# wget http://sourceforge.net/projects/hotsanic/files/hotsanic/0.5.0-pre5/hotsanic-0.5.0-pre5.tgz/download

[root@centos local]# tar -xzvf hotsanic-0.5.0-pre5.tgz

HotSaNIC設定ファイル作成

HotSaNICの設定ファイルをウィザード形式で作成します。
ここではひとまず全部の設定をOnにします。

[root@centos local]# cd HotSaNIC
[root@centos HotSaNIC]# ./setup.pl
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) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y

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

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) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y

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

Module found: MAILQ

Description:
Records outbound mail status.
Currently supported mail-systems: postfix
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: 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: 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!
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) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y

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

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) > y
Do you want to show this module's graphs on the webpage? (Y/n) > y

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

setting up apcusv “

ERROR: apcaccess could not be found.

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

setting up apps “
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
acpid (running 1 times now) - Use this item?? (y/N) > y
aio/0 (running 1 times now) - Use this item?? (y/N) > y
aio/1 (running 1 times now) - Use this item?? (y/N) > y
aio/2 (running 1 times now) - Use this item?? (y/N) > y
aio/3 (running 1 times now) - Use this item?? (y/N) > y
ata/0 (running 1 times now) - Use this item?? (y/N) > y
ata/1 (running 1 times now) - Use this item?? (y/N) > y
ata/2 (running 1 times now) - Use this item?? (y/N) > y
ata/3 (running 1 times now) - Use this item?? (y/N) > y
ata_aux (running 1 times now) - Use this item?? (y/N) > y
atd (running 1 times now) - Use this item?? (y/N) > y
audispd (running 1 times now) - Use this item?? (y/N) > y
auditd (running 1 times now) - Use this item?? (y/N) > y
automount (running 1 times now) - Use this item?? (y/N) > y
avahi-daemon (running 2 times now) - Use this item?? (y/N) > y
bash (running 3 times now) - Use this item?? (y/N) > y
clamd (running 1 times now) - Use this item?? (y/N) > y
cqueue/0 (running 1 times now) - Use this item?? (y/N) > y
cqueue/1 (running 1 times now) - Use this item?? (y/N) > y
cqueue/2 (running 1 times now) - Use this item?? (y/N) > y
cqueue/3 (running 1 times now) - Use this item?? (y/N) > y
crond (running 1 times now) - Use this item?? (y/N) > y
cupsd (running 1 times now) - Use this item?? (y/N) > y
dbus-daemon (running 1 times now) - Use this item?? (y/N) > y
dovecot (running 1 times now) - Use this item?? (y/N) > y
dovecot-auth (running 1 times now) - Use this item?? (y/N) > y
events/0 (running 1 times now) - Use this item?? (y/N) > y
events/1 (running 1 times now) - Use this item?? (y/N) > y
events/2 (running 1 times now) - Use this item?? (y/N) > y
events/3 (running 1 times now) - Use this item?? (y/N) > y
gam_server (running 1 times now) - Use this item?? (y/N) > y
gpm (running 1 times now) - Use this item?? (y/N) > y
hald (running 1 times now) - Use this item?? (y/N) > y
hald-addon-acpi (running 1 times now) - Use this item?? (y/N) > y
hald-addon-keyb (running 2 times now) - Use this item?? (y/N) > y
hald-runner (running 1 times now) - Use this item?? (y/N) > y
hcid (running 1 times now) - Use this item?? (y/N) > y
hd-audio0 (running 1 times now) - Use this item?? (y/N) > y
hidd (running 1 times now) - Use this item?? (y/N) > y
httpd (running 9 times now) - Use this item?? (y/N) > y
imap (running 2 times now) - Use this item?? (y/N) > y
imap-login (running 5 times now) - Use this item?? (y/N) > y
init (running 1 times now) - Use this item?? (y/N) > y
irqbalance (running 1 times now) - Use this item?? (y/N) > y
kacpid (running 1 times now) - Use this item?? (y/N) > y
kauditd (running 1 times now) - Use this item?? (y/N) > y
kblockd/0 (running 1 times now) - Use this item?? (y/N) > y
kblockd/1 (running 1 times now) - Use this item?? (y/N) > y
kblockd/2 (running 1 times now) - Use this item?? (y/N) > y
kblockd/3 (running 1 times now) - Use this item?? (y/N) > y
khelper (running 1 times now) - Use this item?? (y/N) > y
khubd (running 1 times now) - Use this item?? (y/N) > y
khungtaskd (running 1 times now) - Use this item?? (y/N) > y
kjournald (running 1 times now) - Use this item?? (y/N) > y
klogd (running 1 times now) - Use this item?? (y/N) > y
kmpath_handlerd (running 1 times now) - Use this item?? (y/N) > y
kmpathd/0 (running 1 times now) - Use this item?? (y/N) > y
kmpathd/1 (running 1 times now) - Use this item?? (y/N) > y
kmpathd/2 (running 1 times now) - Use this item?? (y/N) > y
kmpathd/3 (running 1 times now) - Use this item?? (y/N) > y
kpsmoused (running 1 times now) - Use this item?? (y/N) > y
krfcommd (running 1 times now) - Use this item?? (y/N) > y
kseriod (running 1 times now) - Use this item?? (y/N) > y
ksoftirqd/0 (running 1 times now) - Use this item?? (y/N) > y
ksoftirqd/1 (running 1 times now) - Use this item?? (y/N) > y
ksoftirqd/2 (running 1 times now) - Use this item?? (y/N) > y
ksoftirqd/3 (running 1 times now) - Use this item?? (y/N) > y
kstriped (running 1 times now) - Use this item?? (y/N) > y
kswapd0 (running 1 times now) - Use this item?? (y/N) > y
kthread (running 1 times now) - Use this item?? (y/N) > y
lockd (running 1 times now) - Use this item?? (y/N) > y
master (running 1 times now) - Use this item?? (y/N) > y
mcstransd (running 1 times now) - Use this item?? (y/N) > y
md0_raid1 (running 1 times now) - Use this item?? (y/N) > y
mdadm (running 1 times now) - Use this item?? (y/N) > y
migration/0 (running 1 times now) - Use this item?? (y/N) > y
migration/1 (running 1 times now) - Use this item?? (y/N) > y
migration/2 (running 1 times now) - Use this item?? (y/N) > y
migration/3 (running 1 times now) - Use this item?? (y/N) > y
mingetty (running 6 times now) - Use this item?? (y/N) > y
mysqld (running 1 times now) - Use this item?? (y/N) > y
mysqld_safe (running 1 times now) - Use this item?? (y/N) > y
named (running 1 times now) - Use this item?? (y/N) > y
nfsiod (running 1 times now) - Use this item?? (y/N) > y
ntpd (running 1 times now) - Use this item?? (y/N) > y
pcscd (running 1 times now) - Use this item?? (y/N) > y
pdflush (running 2 times now) - Use this item?? (y/N) > y
perl (running 2 times now) - Use this item?? (y/N) > y
pickup (running 1 times now) - Use this item?? (y/N) > y
pop3-login (running 3 times now) - Use this item?? (y/N) > y
portmap (running 1 times now) - Use this item?? (y/N) > y
ps (running 1 times now) - Use this item?? (y/N) > y
qmgr (running 1 times now) - Use this item?? (y/N) > y
restorecond (running 1 times now) - Use this item?? (y/N) > y
rpc.idmapd (running 1 times now) - Use this item?? (y/N) > y
rpc.statd (running 1 times now) - Use this item?? (y/N) > y
rpciod/0 (running 1 times now) - Use this item?? (y/N) > y
rpciod/1 (running 1 times now) - Use this item?? (y/N) > y
rpciod/2 (running 1 times now) - Use this item?? (y/N) > y
rpciod/3 (running 1 times now) - Use this item?? (y/N) > y
saslauthd (running 5 times now) - Use this item?? (y/N) > y
sh (running 1 times now) - Use this item?? (y/N) > y
smartd (running 1 times now) - Use this item?? (y/N) > y
squid (running 2 times now) - Use this item?? (y/N) > y
sshd (running 5 times now) - Use this item?? (y/N) > y
su (running 1 times now) - Use this item?? (y/N) > y
syslogd (running 1 times now) - Use this item?? (y/N) > y
tlsmgr (running 1 times now) - Use this item?? (y/N) > y
udevd (running 1 times now) - Use this item?? (y/N) > y
unlinkd (running 1 times now) - Use this item?? (y/N) > y
watchdog/0 (running 1 times now) - Use this item?? (y/N) > y
watchdog/1 (running 1 times now) - Use this item?? (y/N) > y
watchdog/2 (running 1 times now) - Use this item?? (y/N) > y
watchdog/3 (running 1 times now) - Use this item?? (y/N) > y
xfs (running 1 times now) - Use this item?? (y/N) > y
yum-updatesd (running 1 times now) - Use this item?? (y/N) > y
Please check the settings file and adapt it to satisfy your needs.

setting up bind “
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 dnet “
Please check the settings file and adapt it to satisfy your needs.

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

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 part “

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 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 shoutcast “

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

setting up system “

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

setting up traffic “

Configuring local interfaces. Please answer these:
found: eth0 - (y)es or (n)o ? y

found: lo - (y)es or (n)o ? y

Please check the settings file and adapt it to satisfy your needs.
If you have any interfaces slower than 100 MBit, please change the
corrosponding default values.
Maybe there are some additional interfaces or SNMP hosts you want
to query.

setting up worms “

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

Ok.
Writing main settings “
checking path to "rrdtimer.pl" (current: 'not configured')
DAEMONDIR="/usr/local/HotSaNIC"
checking path to "rrdtool" (current: 'not configured')
detected: /usr/bin
is this corrrect? (Y/n) > y
BINPATH="/usr/bin"
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 bind diskio dnet mailq netstat networks part ping sensors shoutcast system traffic worms"
WEBDIR="not configured"
WIDTH="600"
HEIGHT="200"
IMAGEFORMAT="gif"
SHOW="apcusv apps bind diskio dnet mailq netstat networks part ping sensors shoutcast system traffic worms"
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/bin/convert"
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 /var/settings .

HotSaNIC設定ファイル変更

ウィザードで作成したHotSaNICの設定ファイルを一部修正します。

[root@centos HotSaNIC]# vi settings
# path to the "rrdtool" binary
# this has to be a directory !
#
# BINPATH="/usr/local/rrdtool-1.0.33/bin"
#
# BINPATHの値をnot configuredから/usr/binに変更
BINPATH="not configured"

BINPATH="/usr/bin"

# web-directory for all graphs
# this directory must be writeable for the rrdgraph tool
# because each plugin will create its own subdir here.
#
# WEBDIRの値をnot configuredから/var/www/hotsanicに変更
WEBDIR="not configured"

WEBDIR="/var/www/hotsanic"

# the output-format of the generated images may be either "gif" or "png"
#
# IMAGEFORMATの値をgifからpngに変更
IMAGEFORMAT="gif"

IMAGEFORMAT="png"

# diagram-rebuild timebase (minutes).
# Usually 15 min. should do fine, but if you think your system
# is too busy, just increase the timebase as you like.
# Values up to about 45 make sense since the lowest-scale graph
# covers 60 minutes of data sampled.
#
# DTIMEの値を15から1に変更
DTIME="15"

DTIME="1"

# This setting controlss how the images will be converted
# to thumbnails
#
# Value Behaviour
#
# "ImgMgck" Call ImageMagick's "convert" to create thumbnails
#
# "I::M" Use the Image::Magick module
#
# "HTML" Don't convert at all, but use the HTML image resize
# tag instead. More data has to be transfered using
# this method, but you won't need additional software.
#
# CONVERTMETHODの値をHTMLからImgMgckに変更
CONVERTMETHOD="HTML"

CONVERTMETHOD="ImgMgck"

# path to the "convert" binary from ImageMagick package
# this has to be the full path to the binary !
#
# CONVERTPATH="/usr/X11R6/bin/convert"
#
# CONVERTPATHの値を空から/usr/bin/convertに変更
CONVERTPATH=""

CONVERTPATH="/usr/bin/convert"

# configure the pathes of some additional applications which may be
# needed by HotSaNIC
#

# configure the full pathes to snmpwalk and snmpget binaries here.
# These may be needed to get data from remote machines.
#
# SNMPWALKの値をnot configuredから/usr/bin/snmpwalkに変更
SNMPWALK="not configured"

SNMPWALK="/usr/bin/snmpwalk"

# SNMPGETの値をnot configuredから/usr/bin/snmpgetに変更
SNMPGET="not configured"

SNMPGET="/usr/bin/snmpget"

# SNMPBULKWALKの値をnot configuredから/usr/bin/snmpbulkwalkに変更
SNMPBULKWALK="not configured"

SNMPBULKWALK="/usr/bin/snmpbulkwalk"

ファイルを保存してviエディタを終了します

HotSaNIC エイリアスの設定とアクセス制御

HotSaNICのエイリアスの設定とローカルネットワークからのみ参照できるようアクセス制御を行います。

[root@centos HotSaNIC]# vi /etc/httpd/conf.d/hotsanic.conf
Alias /hotsanic /var/www/hotsanic
<Location /hotsanic>
DirectoryIndex frame.html
Order deny,allow
Deny from all
Allow from 192.168.0.0/24

ファイルを保存してviエディタを終了します

Apacheを再起動してエイリアスの設定とアクセス制御を反映

[root@centos HotSaNIC]# /etc/rc.d/init.d/httpd restart
httpd を停止中: [ OK ]
httpd を起動中: [ OK ]

HotSaNIC インデックスページ作成

[root@centos HotSaNIC]# ./makeindex.pl
WEBDIR (path to HotSaNIC's output directory) does not exist.
Trying to create path“
generating index-files for each plugin“
apcusv
creating directory /var/www/hotsanic/apcusv
moving index-files to webdir

apps
print() on closed filehandle FILE at ./makeindex.pl line 80 (#1)
(W closed) The filehandle you're printing on got itself closed sometime
before now. Check your control flow.

print() on closed filehandle FILE at ./makeindex.pl line 82 (#1)
print() on closed filehandle FILE at ./makeindex.pl line 86 (#1)
print() on closed filehandle FILE at ./makeindex.pl line 88 (#1)
print() on closed filehandle FILE at ./makeindex.pl line 90 (#1)
creating directory /var/www/hotsanic/apps
moving index-files to webdir

bind
creating directory /var/www/hotsanic/bind
moving index-files to webdir

diskio
creating directory /var/www/hotsanic/diskio
moving index-files to webdir

dnet
creating directory /var/www/hotsanic/dnet
moving index-files to webdir

mailq
creating directory /var/www/hotsanic/mailq
moving index-files to webdir

netstat
creating directory /var/www/hotsanic/netstat
moving index-files to webdir

networks
creating directory /var/www/hotsanic/networks
moving index-files to webdir

part
creating directory /var/www/hotsanic/part
moving index-files to webdir

ping
creating directory /var/www/hotsanic/ping
moving index-files to webdir

sensors
creating directory /var/www/hotsanic/sensors
moving index-files to webdir

shoutcast
creating directory /var/www/hotsanic/shoutcast
moving index-files to webdir

system
creating directory /var/www/hotsanic/system
moving index-files to webdir

traffic
creating directory /var/www/hotsanic/traffic
moving index-files to webdir

worms
creating directory /var/www/hotsanic/worms
moving index-files to webdir

building /var/www/hotsanic/index.html “
table-size: 117 lines.

Modules are added in this order:
traffic
system
part
ping
dnet
sensors
apcusv
apps
bind
diskio
mailq
netstat
networks
shoutcast
worms

done.

HotSaNIC 起動設定

#rrdgraphを/etc/rc.d/init.d/にシンボリックリンクする
[root@centos HotSaNIC]# ln -s /usr/local/HotSaNIC/rrdgraph /etc/rc.d/init.d/rrdgraph

#シンボリックリンクを確認する
[root@centos HotSaNIC]# ls -l /etc/rc.d/init.d/rrdgraph
lrwxrwxrwx 1 root root 28 10月 21 14:54 /etc/rc.d/init.d/rrdgraph -> /usr/local/HotSaNIC/rrdgraph

#HotSaNIC起動スクリプト自動起動
[root@centos HotSaNIC]# chkconfig rrdgraph on

#HotSaNIC起動スクリプト自動起動設定確認
[root@centos HotSaNIC]# chkconfig --list rrdgraph
rrdgraph 0:off 1:off 2:on 3:on 4:on 5:on 6:off

#HotSaNIC起動スクリプト実行
[root@centos HotSaNIC]# /etc/rc.d/init.d/rrdgraph start
Starting rrdtimer“
reading & checking config (/usr/local/HotSaNIC/settings) “
evaluating cmdline arguments“
entering daemon mode“

サムネイル作成

はじめての自宅サーバ構築 - Fedora/CentOS - サーバ監視(HotSaNIC + RRDTool) より

サムネイルとは、インデックスページの各情報リンクのイメージ画像を作成します。
一度も実行しないとインデックスページの画像は表示されないので注意してください。

マシンの性能によるのかもしれませんが、rrdgraphのサービス起動直後にconvert.plを実行すると一部のサムネイルしか作成されません。
数分~数十分くらいしてから実行するとよいかもしれません。

[root@centos HotSaNIC]# ./convert.pl
resizing /var/www/hotsanic/worms/cmd.exe-week.png
resizing /var/www/hotsanic/worms/default.ida-week.png
resizing /var/www/hotsanic/worms/root.exe-week.png
resizing /var/www/hotsanic/mailq/bytes-week.png
resizing /var/www/hotsanic/mailq/req-week.png
resizing /var/www/hotsanic/netstat/connections-week.png
resizing /var/www/hotsanic/apcusv/outv-week.png
resizing /var/www/hotsanic/apcusv/battv-week.png
resizing /var/www/hotsanic/apcusv/timeleft-week.png
resizing /var/www/hotsanic/apcusv/temp-week.png
resizing /var/www/hotsanic/apcusv/loadpct-week.png
resizing /var/www/hotsanic/apcusv/battpct-week.png
resizing /var/www/hotsanic/system/proc-week.png
resizing /var/www/hotsanic/system/mem-week.png
resizing /var/www/hotsanic/system/cpu1-week.png
resizing /var/www/hotsanic/system/load-week.png
resizing /var/www/hotsanic/system/swap-week.png
resizing /var/www/hotsanic/system/cpu3-week.png
resizing /var/www/hotsanic/system/users-week.png
resizing /var/www/hotsanic/system/cpu2-week.png
resizing /var/www/hotsanic/system/cpu0-week.png
resizing /var/www/hotsanic/system/cpu-week.png
resizing /var/www/hotsanic/system/uptime-week.png
resizing /var/www/hotsanic/apps/dovecot-week.png
resizing /var/www/hotsanic/apps/ps-week.png
resizing /var/www/hotsanic/apps/init-week.png
resizing /var/www/hotsanic/apps/klogd-week.png
resizing /var/www/hotsanic/apps/perl-week.png
resizing /var/www/hotsanic/apps/hald-week.png
resizing /var/www/hotsanic/apps/master-week.png
resizing /var/www/hotsanic/apps/kauditd-week.png
resizing /var/www/hotsanic/apps/hald-runner-week.png
resizing /var/www/hotsanic/apps/atd-week.png
resizing /var/www/hotsanic/apps/kjournald-week.png
resizing /var/www/hotsanic/apps/httpd-week.png
resizing /var/www/hotsanic/apps/mingetty-week.png
resizing /var/www/hotsanic/apps/mysqld-week.png
resizing /var/www/hotsanic/apps/sh-week.png
resizing /var/www/hotsanic/apps/gpm-week.png
resizing /var/www/hotsanic/apps/dovecot-auth-week.png
resizing /var/www/hotsanic/apps/yum-updatesd-week.png
resizing /var/www/hotsanic/apps/imap-login-week.png
resizing /var/www/hotsanic/apps/hd-audio0-week.png
resizing /var/www/hotsanic/apps/mysqld_safe-week.png
resizing /var/www/hotsanic/apps/clamd-week.png
resizing /var/www/hotsanic/apps/kstriped-week.png
resizing /var/www/hotsanic/apps/ata_aux-week.png
resizing /var/www/hotsanic/apps/pickup-week.png
resizing /var/www/hotsanic/apps/irqbalance-week.png
resizing /var/www/hotsanic/apps/squid-week.png
resizing /var/www/hotsanic/apps/lockd-week.png
resizing /var/www/hotsanic/apps/named-week.png
resizing /var/www/hotsanic/apps/kthread-week.png
resizing /var/www/hotsanic/apps/dbus-daemon-week.png
resizing /var/www/hotsanic/apps/nfsiod-week.png
resizing /var/www/hotsanic/apps/qmgr-week.png
resizing /var/www/hotsanic/apps/khubd-week.png
resizing /var/www/hotsanic/apps/mcstransd-week.png
resizing /var/www/hotsanic/apps/pop3-login-week.png
resizing /var/www/hotsanic/apps/syslogd-week.png
resizing /var/www/hotsanic/apps/xfs-week.png
resizing /var/www/hotsanic/apps/avahi-daemon-week.png
resizing /var/www/hotsanic/apps/hald-addon-acpi-week.png
resizing /var/www/hotsanic/apps/kswapd0-week.png
resizing /var/www/hotsanic/apps/hidd-week.png
resizing /var/www/hotsanic/apps/rpc_idmapd-week.png
resizing /var/www/hotsanic/apps/khungtaskd-week.png
resizing /var/www/hotsanic/apps/kmpath_handlerd-week.png
resizing /var/www/hotsanic/apps/kseriod-week.png
resizing /var/www/hotsanic/apps/kacpid-week.png
resizing /var/www/hotsanic/apps/krfcommd-week.png
resizing /var/www/hotsanic/apps/cupsd-week.png
resizing /var/www/hotsanic/apps/mdadm-week.png
resizing /var/www/hotsanic/apps/auditd-week.png
resizing /var/www/hotsanic/apps/md0_raid1-week.png
resizing /var/www/hotsanic/apps/portmap-week.png
resizing /var/www/hotsanic/apps/audispd-week.png
resizing /var/www/hotsanic/apps/imap-week.png
resizing /var/www/hotsanic/apps/gam_server-week.png
resizing /var/www/hotsanic/apps/unlinkd-week.png
resizing /var/www/hotsanic/apps/sshd-week.png
resizing /var/www/hotsanic/apps/restorecond-week.png
resizing /var/www/hotsanic/apps/tlsmgr-week.png
resizing /var/www/hotsanic/apps/pcscd-week.png
resizing /var/www/hotsanic/apps/udevd-week.png
resizing /var/www/hotsanic/apps/kpsmoused-week.png
resizing /var/www/hotsanic/apps/khelper-week.png
resizing /var/www/hotsanic/apps/ntpd-week.png
resizing /var/www/hotsanic/apps/hald-addon-keyb-week.png
resizing /var/www/hotsanic/apps/acpid-week.png
resizing /var/www/hotsanic/apps/crond-week.png
resizing /var/www/hotsanic/apps/pdflush-week.png
resizing /var/www/hotsanic/apps/saslauthd-week.png
resizing /var/www/hotsanic/apps/rpc_statd-week.png
resizing /var/www/hotsanic/apps/hcid-week.png
resizing /var/www/hotsanic/apps/smartd-week.png
resizing /var/www/hotsanic/apps/automount-week.png
resizing /var/www/hotsanic/apps/bash-week.png
resizing /var/www/hotsanic/apps/su-week.png
resizing /var/www/hotsanic/dnet/csc-week.png
resizing /var/www/hotsanic/dnet/rc5-week.png
resizing /var/www/hotsanic/dnet/des-week.png
resizing /var/www/hotsanic/dnet/ogr-week.png
resizing /var/www/hotsanic/traffic/lo-week.png
resizing /var/www/hotsanic/traffic/eth0-week.png
resizing /var/www/hotsanic/part/_dev_md0-week.png

ブラウザからHotSaNICで取得している情報を確認します。

あれ?
systemの情報が表示されない・・・。

少し時間をおいて再度インデックスページ作成(makeindex.pl)処理を実行したらsystemの情報が表示されました。

せっかくhddtempをインストールしたのにハードディスクの温度は測れてないや。
これはまた次回。

squidのログファイルをapache形式にする

投稿者:yasu 更新日時:2010年10月7日 12時14分42秒
カテゴリCentOS, Squid

以前CentOS5にインストールしたsquidですが、squidのログファイルっていつアクセスしたかわからないですよね?
これをapache形式にして時間がわかるようにしたいと思います。
初期状態のログはこんな感じ
↓↓↓↓↓
1285922644.977 4 127.0.0.1 TCP_MISS/503 1379 POST http://safebrowsing.clients.google.com/safebrowsing/downloads? - NONE/- text/html

これが設定を変更するとこんな感じになります。
↓↓↓↓↓
127.0.0.1 - - [01/Oct/2010:17:44:37 +0900] "GET http://www.sh.turbolinux.com/support/image_support/side_caption_4c_4_f2.gif HTTP/1.1" 200 1118 TCP_MISS:DIRECT

squidの設定ファイルを編集します

[root@centos ~]# vi /etc/squid/squid.conf

~ 中略 ~

# TAG: access_log
# These files log client request activities. Has a line every HTTP or
# ICP request. The format is:
# access_log [ [acl acl ...]]
# access_log none [acl acl ...]]
#
# Will log to the specified file using the specified format (which
# must be defined in a logformat directive) those entries which match
# ALL the acl's specified (which must be defined in acl clauses).
# If no acl is specified, all requests will be logged to this file.
#
# To disable logging of a request use the filepath "none", in which case
# a logformat name should not be specified.
#
# To log the request via syslog specify a filepath of "syslog":
#
# access_log syslog[:facility.priority] [format [acl1 [acl2 ....]]]
# where facility could be any of:
# authpriv, daemon, local0 .. local7 or user.
#
# And priority could be any of:
# err, warning, notice, info, debug.
#
# Note: 2.6.STABLE14 and earlier only supports a slightly different
# and undocumented format with all uppercase LOG_FACILITY|LOG_PRIORITY
#access_log /var/log/squid/access.log squid ←先頭に#を追記してコメント化
access_log /var/log/squid/access.log auto ←追記

~ 中略 ~

# TAG: emulate_httpd_log on|off
# The Cache can emulate the log file format which many 'httpd'
# programs use. To disable/enable this emulation, set
# emulate_httpd_log to 'off' or 'on'. The default
# is to use the native log format since it includes useful
# information Squid-specific log analyzers use.
#
#Default:
emulate_httpd_log on ←追記

ファイルを保存してviエディタを終了します

squidのサービスを再起動して設定を反映します

[root@centos ~]# /etc/rc.d/init.d/squid restart
squid を停止中: “““““. [ OK ]
init_cache_dir /var/spool/squid/coss“ squid を起動中: . [ OK ]

ログファイルの確認

[root@centos ~]# cat /var/log/squid/access.log

ログファイルを確認してapache形式の表示になっていれば設定完了です。