libssh2+ssh2-0.10のインストール
■libssh2+ssh2-0.10のインストール
●openssl-develがインストールされているか確認
[root@localhost ~]# rpm -qa | grep openssl-devel
openssl-devel-0.9.7a-43.17.el4_7.2
● libssh2-0.18.tar.gzインストール
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# wget 'http://jaist.dl.sourceforge.net/project/libssh2/libssh2/0.18/libssh2-0.18.ta
r.gz'
=> `libssh2-0.18.tar.gz'
jaist.dl.sourceforge.net をDNSに問いあわせています... 150.65.7.130
jaist.dl.sourceforge.net|150.65.7.130|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 541,428 (529K) [application/x-gzip]
100%[===========================================================>] 541,428 612.33K/s
18:13:21 (609.99 KB/s) - `libssh2-0.18.tar.gz' を保存しました [541428/541428]
[root@localhost src]# tar zxvf libssh2-0.18.tar.gz
[root@localhost src]# cd libssh2-0.18
[root@localhost libssh2-0.18]# ./configure
[root@localhost libssh2-0.18]# make
[root@localhost libssh2-0.18]# make install
●pecl ssh2-0.10インストール
[root@localhost src]# wget http://pecl.php.net/get/ssh2-0.10.tgz
[root@localhost src]# tar zxvf ssh2-0.10.tgz
[root@localhost src]# cd ssh2-0.10
[root@localhost ssh2-0.10]# phpize && ./configure --with-ssh2
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
[root@localhost ssh2-0.10]# vi config.h
#define LIBSSH2_APINO 200412301450
[root@localhost ssh2-0.10]# make
[root@localhost ssh2-0.10]# make install
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20060613/
■ssh DSA認証を行いパスワード無しにログインする方法
■ssh DSA認証を行いパスワード無しにログインする方法
adminユーザがDSA認証を行う。
cronにrsyncやscp等をつかってファイルのやり取りを行う場合に便利
■sshキー作成
[admin@host100 ~]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/admin/.ssh/id_dsa): ←未入力エンター
/home/admin/.ssh/id_dsa already exists.
Overwrite (y/n)? y ←yes
Enter passphrase (empty for no passphrase): ←未入力エンター
Enter same passphrase again: ←未入力エンター
Your identification has been saved in /home/admin/.ssh/id_dsa.
Your public key has been saved in /home/admin/.ssh/id_dsa.pub.
The key fingerprint is:
b3:7f:85:eb:0d:43:fc:89:7b:a0:c2:d9:64:68:b3:f4 admin@host100
■作成した公開キーを相手サーバにコピーする。
[admin@host100 etc]$ scp /home/admin/.ssh/id_dsa.pub admin@host101:/home/admin/.
admin@host101's password:
id_dsa.pub
■host101で 上記でコピーしたhost101公開鍵を設定する
[admin@host101 ~]$ cat id_dsa.pub >> .ssh/authorized_keys
[admin@host101 ~]$ cat .ssh/authorized_keys
ssh-dss **********************************************************************************
(中略)
yumでError: Missing Dependency
■yumでError: Missing Dependency
↓yumで、Error: Missing Dependencyが発生
[root@localhost ~]# yum -y update
-
- > Processing Dependency: ibutils = 1.2-3.el4 for package: ibutils-libs
- > Finished Dependency Resolution
Error: Missing Dependency: ibutils = 1.2-3.el4 is needed by package ibutils-libs
↓調べてみると、ibutils-libs-1.2-3.el4が2つインストールされている。
[root@localhost ~]# rpm -qa ibutils-libs
ibutils-libs-1.2-4.el4
ibutils-libs-1.2-3.el4
↓rpm -ev --nodepsで強制削除
[root@localhost ~]# rpm -ev --nodeps ibutils-libs-1.2-4.el4
↓再度yum
[root@localhost ~]# yum -y update
無事成功
UPS設定 apcuspd マスター スレーブ
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■UPS設定 apcuspd マスター スレーブ
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■概要
UPSのシャットダウン、復電時のブートの設定を行う。
server1
マスター
UPSからシリアル接続する。
一番最後までシャットダウンさせない。
シャットダウン開始時間 5分
server2,3,4
スレーブ
マスターからethernet経由で、停電の情報を取得する。
マスターより早くシャットダウンさせる。
シャットダウン開始時間 3分
UPS APC_3000VA 100V
特に設定はいらない。
シャットダウンモードになると、ランプが上から下にかけて点滅する。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■BIOS設定
各serverのBIOSの設定で自動起動の設定をする。これをしないと復電時に起動しない。
[Server]-[AC-LINK]を[PowerOn]にする。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■server1にapcuspdの設定を行う。
server1をマスターにする。
その他をスレーブにする。
マスター
server1 192.168.1.101
スレーブ
server2 192.168.1.102
server3 192.168.1.103
server4 192.168.1.104
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■itablesの設定
[root@server1 sysconfig]# cd /etc/sysconfig/
[root@server1 sysconfig]# vi iptables
- A RH-Firewall-1-INPUT -s 192.168.1.0/255.255.255.0 -j ACCEPT
[root@server1 sysconfig]# /etc/init.d/network restart
ローカルネットはフリー接続にする。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■apcuspdの設定
●ダウンロード
[root@server1 src]# wget 'http://jaist.dl.sourceforge.net/project/apcupsd/rpms%20-%20Stable/3.14.7/apcupsd-3.14.7-1.el4.
i386.rpm'
=> `apcupsd-3.14.7-1.el4.i386.rpm'
jaist.dl.sourceforge.net をDNSに問いあわせています... 150.65.7.130
jaist.dl.sourceforge.net|150.65.7.130|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 469,369 (458K) [application/x-redhat-package-manager]
100%[=============================================================================>] 469,369 1.52M/s
13:18:40 (1.51 MB/s) - `apcupsd-3.14.7-1.el4.i386.rpm' を保存しました [469369/469369]
●インストール
[root@server1 src]# rpm -ivh apcupsd-3.14.7-1.el4.i386.rpm
警告: apcupsd-3.14.7-1.el4.i386.rpm: V3 DSA signature: NOKEY, key ID a57b2d90
Preparing... ########################################### [100%]
1:apcupsd ########################################### [100%]
[root@server1 src]# cd /etc/apcupsd/
[root@server1 apcupsd]# cp -p apcupsd.conf apcupsd.conf.org
[root@server1 apcupsd]# vi apcupsd.conf
UPSNAME APC_30_1
UPSCABLE smart
UPSTYPE apcsmart
DEVICE /dev/ttyS0
BATTERYLEVEL 5
MINUTES -1
TIMEOUT 300
ANNOY 120
ANNOYDELAY 60
KILLDELAY 180
TIMEOUTがバッテリー動作からシャットダウン開始までの時間
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■サービス設定
rpmインストール時に自動で設定されている。
[root@server1 sysconfig]# /etc/init.d/apcupsd start
[root@server1 sysconfig]# /etc/init.d/apcupsd stop
■確認テスト
/etc/init.d/apcupsd stop
/sbin/apctest
UPS情報が出力される。
/etc/init.d/apcupsd start
/sbin/apcaccess
UPS情報が出力される。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■テスト
UPSの元電源を抜いて1分後にシャットダウンがスタートするか確認する。
シャットダウンしたのでOK
逆に起動のテストがまだ。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■server2にapcuspdの設定を行う。(スレーブの設定)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
[root@server2 ~]# cd /usr/local/src/
[root@server2 ~]# wget 'http://jaist.dl.sourceforge.net/project/apcupsd/rpms%20-%20Stable/3.14.7/apcupsd-3.14.7-1.el4.i386.rpm'
●インストール
[root@server2 src]# rpm -ivh apcupsd-3.14.7-1.el4.i386.rpm
警告: apcupsd-3.14.7-1.el4.i386.rpm: V3 DSA signature: NOKEY, key ID a57b2d90
Preparing... ########################################### [100%]
1:apcupsd ########################################### [100%]
[root@server1 src]# cd /etc/apcupsd/
[root@server1 apcupsd]# cp -p apcupsd.conf apcupsd.conf.org
↓スレーブ用の設定
[root@server1 apcupsd]# vi apcupsd.conf
UPSNAME APC_30_1
UPSCABLE ether
UPSTYPE net
DEVICE 192.168.1.101:3551
BATTERYLEVEL 5
MINUTES -1
TIMEOUT 180
ANNOY 120
ANNOYDELAY 0
KILLDELAY 0
NETSERVER on
UPSCLASS shareslave
USERMAGIC 192.168.1.102
TIMEOUTがバッテリー動作からシャットダウン開始までの時間
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■サービス設定
rpmインストール時に自動で設定されている。
[root@server2 sysconfig]# /etc/init.d/apcupsd start
[root@server2 sysconfig]# /etc/init.d/apcupsd stop
■確認テスト
/etc/init.d/apcupsd stop
/sbin/apctest
UPS情報が出力される。
/etc/init.d/apcupsd start
/sbin/apcaccess
UPS情報が出力される。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■テスト結果
瞬電テスト
縮退メッセージ出力後、復電メッセージ出力、再起動されないのでOK
長時間停電テスト
縮退メッセージ出力後、スレーブ3分後シャットダウン、マスタ5分後シャットダウン。
復電時に、自動boot確認でOK
ネットワークケーブル切断テスト
スレーブは、シャットダウンしなかった。
マスタのみシャットダウン。
スイッチは、UPS内にいれておくこと。
シャットダウン時復電テスト
シャットダウン時に復電した場合は、自動bootしない。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■UPSの情報をWebで表示する。
■apcupsd-multimon-3.14.7-1.el4.i386.rpmのインストール
[root@server1 ~]# cd /usr/local/src/
[root@server1 src]# wget 'http://jaist.dl.sourceforge.net/project/apcupsd/rpms%20-%20Stable/3.14.7/apcupsd-multimon-3.14.7-1.el4.i386.rpm'
[root@server1 src]# yum install gd
[root@server1 src]# rpm -ivh apcupsd-multimon-3.14.7-1.el4.i386.rpm
警告: apcupsd-multimon-3.14.7-1.el4.i386.rpm: V3 DSA signature: NOKEY, key ID a57b2d90
Preparing... ########################################### [100%]
1:apcupsd-multimon ########################################### [100%]
[root@server1 cgi-bin]# cd /var/www/cgi-bin/
[root@server1 cgi-bin]# mkdir apcupsd/
cgi-bin直下にできるので、apcupsdディレクトリに移動させる。
[root@server1 cgi-bin]# cp -p *.cgi ./apcupsd/
合計 108
drwxr-xr-x 2 root root 4096 8月 21 15:55 .
drwxr-xr-x 6 root root 4096 8月 7 16:19 ..
- rwxr-xr-x 1 root root 24713 8月 2 22:43 multimon.cgi
- rwxr-xr-x 1 root root 17964 8月 2 22:43 upsfstats.cgi
- rwxr-xr-x 1 root root 23873 8月 2 22:43 upsimage.cgi
- rwxr-xr-x 1 root root 26347 8月 2 22:43 upsstats.cgi
↓apacheの設定にcgiに設定を追加する。
[root@server1 conf]# cd /etc/httpd/conf
[root@server1 conf]# cp -p httpd.conf httpd.conf.090821
↓コメントを外す。
LoadModule cgi_module modules/mod_cgi.so
↓を追加
#apcupsd monitor cgi
ScriptAlias /apcupsd/ "/var/www/cgi-bin/apcupsd/"
Options ExecCGI
Order allow,deny
Allow from all
[root@server1 conf]# /etc/init.d/httpd restart
↓ブラウザより確認
http://192.168.1.101/apcupsd/multimon.cgi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■おまけ
/etc/apcupsdディレクトリ
APCUPSDの各種設定ファイル
/sbin/apcaccess
apcupsdからUPSの状態を取得し,そのステータスを表示するプログラム
/sbin/apcnisd
ネットワーク経由でほかのコンピュータにUPSの状態を伝えるデーモン
/etc/rc.d/init.d/apcupsd
APCUPSDを起動したり停止したりするためのスクリプト
/sbin/apctest
APCUPSDの動作を確認するためのバイナリプログラム
/sbin/apcupsd
APCUPSDの本体。デーモンとして起動させる
/usr/share/doc/apcupsd-3.8.5ディレクトリ
APCUPSDのドキュメント類
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
■VirtualHostの設定
■VirtualHostの設定
Version Apache/2.2.3
[root@localhost ~]# cd /etc/httpd/conf
[root@localhost conf]# cp -p httpd.conf httpd.conf.090818
httpd.confを編集
[root@localhost conf]# vi httpd.conf
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80 ←コメントを外す
#
# sampleaaa.com
# 20090818-
#
ServerName sampleaaa.com
DocumentRoot /var/www/sampleaaa.com/htdocs
ErrorLog logs/sampleaaa.com_error_log
CustomLog logs/sampleaaa.com-agent_log combined
Options ExecCGI -Indexes
AllowOverride ALL
#
# testbbb.com
# 20081007-
#
ServerName testbbb.com
DocumentRoot /var/www/testbbb.com/htdocs
ErrorLog logs/testbbb.com-error_log
CustomLog logs/testbbb.com-agent_log combined
Options ExecCGI -Indexes
AllowOverride ALL
======================================================================
[root@localhost conf]# /etc/init.d/httpd restart
httpd を停止中: [ OK ]
httpd を起動中: [ OK ]
■Postgesql初期化処理で--no-locale
■Postgesql初期化処理で--no-locale
postgresqlのパラメータlc_collate,lc_ctypeがCでないと、日本語ソートが正しくない動きをするらしい。検証はしていないが、お約束としてメモ。8.4系だと、CreateDB時に設定可能らしい。
↓postgresにsu
[root@localhost ~]# su - postgres
↓.bash_profileのPGDATAを確認
[ -f /etc/profile ] && source /etc/profile
PGDATA=/var/lib/pgsql/data
export PGDATA
↓データベース初期化
- bash-3.00$ initdb --no-locale
↓確認方法
Welcome to psql 8.1.11, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=# SHOW ALL;
lc_collate | C
lc_ctype | C
lc_messages | C
lc_monetary | C
lc_numeric | C
lc_time | C
lc_collate とlc_ctype がCならばOK
ja.UTFとかだと、やり直し
■Software Raidでのディスク状態の監視(メール通知)
■Software Raidでのディスク状態の監視(メール通知)
Raidディスクの状態を監視する。毎時50分に監視し異常があれば、メールする。
↓mdadm.confの作成
[root@localhost ~]# cd /etc/
[root@localhost etc]# cp -p mdadm.conf mdadm.conf.090817
[root@localhost etc]# echo DEVICE /dev/sd*[0-9] > /etc/mdadm.conf
[root@localhost etc]# mdadm --detail --scan >> /etc/mdadm.conf
↓送信先メールアドレスを追加
[root@localhost etc]# vi /etc/mdadm.conf
DEVICE /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=e2667422:63d01dc7:7903e33f:8134fafa
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=20a59446:491ab2a6:ee881e09:5140c2a4
MAILADDR root ←送信先メールアドレス(とりあえずroot)
↓テスト
[root@localhost etc]# /sbin/mdadm --monitor --scan -1 --test
[root@localhost etc]# mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/root": 2 messages 2 new
>N 1 root@localhost. Mon Aug 17 15:21 19/698 "TestMessage event on /dev/md0:localhost."
N 2 root@localhost. Mon Aug 17 15:21 19/698 "TestMessage event on /dev/md1:localhost."
↑root宛てにメールが来ているのでOK
↓crontabに設定
毎日1回9:50監視し異常があれば、メールする。
[root@localhost etc]# cp -p crontab crontab.090817
[root@localhost etc]# vi crontab
#Soft Raid Monitor
50 * * * * root /sbin/mdadm --monitor --scan -1