サーバーへのvncのやりかた sshが通る場合 (sshトンネルを使います)

- 準備
ターゲット側には、vncserverが必要です。
rpm ivh でインストールしておきます。
クライアント側には、vnc clientが必要です。
Ultra VNCとかReal VNCのビューアをインストールしておきます。

- putty起動
- 左ペインの 接続->SSH->トンネル をクリック
- ソース(源)ポートに"5901"を、送り先に"localhost:5901"を入力し、"追加"をクリック
- 左ペインの セッション をクリック
- 保存されたセッションから、"Default Settings"を選択し、"保存"をクリック
- 一度、puttyを取り消しで終了させ、再度起動
- そのまま、相手先にsshで接続
- ターゲットのshell上で、vncserverを起動
# vncserver :1
- 初回の場合は、パスワードの設定を聞かれるので、適宜設定
- VNC ビューアを起動し、"localhost:5901"に接続。パスワードは上記を入力
- 終了時は、VNCビューアをクローズし、ターゲットのshell上でvncserverをkill
# vncserver -kill :1

- teraterm起動
- 設定-> sshポート転送 をクリック
- ローカルのポート”5901”、リモートホスト”5901”を入れて、”OK”をクリック
- 設定->設定の保存 をクリックし、TERATERM.INIで保存をクリック
- 一度、teratermを終了し、再度起動
- そのまま、相手先にsshで接続
- ターゲットのshell上で、vncserverを起動
# vncserver :1
- 初回の場合は、パスワードの設定を聞かれるので、適宜設定
- VNC ビューアを起動し、"localhost:5901"に接続。パスワードは上記を入力
- 終了時は、VNCビューアをクローズし、ターゲットのshell上でvncserverをkill
# vncserver -kill :1

調子にのって、MSAも監視しちゃいましょう。

- download
http://exchange.nagios.org/directory/plugins/hardware/storage-systems/san-and-nas/check_msa/details
check_msa

- 注意
"Check MSA2000 and P2000 Storage array" と書いてあるとおり(?)
scriptを覗いてみれば分かるとおり、telnetの許可が必要です。

- resource.cfgに以下追加
$USER8$=-u -p

- commands.cfgの編集で以下追加
define command {
command_name check_msa
command_line $USER1$/check_msa $USER8$ -h $HOSTADDRESS$
}


- windows.cfgの編集で以下追加
define service {
use generic-service
host_name
name check_msa
service_description msa check
check_command check_msa
}

- こんなのが検知メールします。

Nagiosサービス検知メール **

検知タイプ: 障害

サービス: msa check
ホスト:
アドレス:
状態: 注意

日時:

追加情報:

注意: [Vdisk1 (xxxxGB,RAID5,11/) CRIT] [Vdisk2 (xxxxGB,RAID5,11/) FTOL]

11/15 のnagios でHPのIMLをチェックしようの更新

- 3.0にversion upしてますね。ちゃんと更新を確認しないといけないね。

- ここからdownload
http://exchange.nagios.org/directory/plugins/hardware/server-hardware/hp-%28compaq%29/insight-management-logs/details
check_insight_logs Version 3.0

- check_insight_logs を /usr/local/nagios/libexec へコピー
実行権限を付ける
cd /usr/local/nagios/libexec
chmod 755 check_insight_logs

- commands.cfg に追加
define command {
command_name check_iml_log
command_line $USER1$/check_insight_logs -H $HOSTADDRESS$ $USER7$
}

- windows.cfg にimlのgroupを追加
define hostgroup{
hostgroup_name hp-iml-servers
alias HP IML Servers
members serverA,serverB
}

- windows.cfgにserviceを追加
define service {
use generic-service
hostgroup_name hp-iml-servers
name check_hp_iml
check_interval 10
max_check_attempts 3
service_description HP IML LOG
check_command check_iml_log
}

Debianで tftpdをしよう

- tftpd をinstall
aptitude install tftpd

- inetd.confの確認しましょう
less /etc/inetd.conf
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp

ふむふむ、今は/srv/tftp なのか…
(昔は、/tftpboot だったなぁ)

- allowしないと…
vi /etc/hosts.allow で以下の1行を追加
in.tftpd: ALL

- ディレクトリの作成
mkdir /srv/tftp
chown nobody:nogroup /srv/tftp/
chmod 700 /srv/tftp/

- でリスタート
/etc/init.d/openbsd-inetd restart

- 最初にファイルを作っておかないといけないので、tftpdはこれが面倒…
touch /srv/tftp/file_name
chmod 666 /srv/tftp/file_name
chown nobody:nogroup /srv/tftp/file_name

-準備終わり
で、ファイル名を"file_name"でtftpで転送します。

nagios でHPのIMLをチェックしよう

- ここからdownload
http://exchange.nagios.org/directory/plugins/hardware/server-hardware/hp-%28compaq%29/insight-management-logs/details

- check_insight_log.sh を /usr/local/nagios/libexec へコピー
実行権限を付ける
cd /usr/local/nagios/libexec
chmod 755 check_insight_log.sh

- commands.cfg に追加
define command {
command_name check_iml_log
command_line $USER1$/check_insight_log.sh -H $HOSTADDRESS$ $USER7$
}

- windows.cfg にimlのgroupを追加
define hostgroup{
hostgroup_name hp-iml-servers
alias HP IML Servers
members serverA,serverB
}

- windows.cfgにserviceを追加
define service {
use generic-service
hostgroup_name hp-iml-servers
name check_hp_iml
check_interval 10
max_check_attempts 3
service_description HP IML LOG
check_command check_iml_log
}

yaskkserv で Google Japanese Input 使っちゃおう

- download
http://umiushi.org/~wac/yaskkserv/

- ccache がなかったのでインストール
aptitude install ccache

- make でg++ のversionが古いと言われた
あれ? g++がないや。g++-4.1が入っていたのでsymbolic link作る
cd /usr/bin
ln -s g++-4.1 g++

- 解凍して、インストール
tar jxvf yaskkserv-0.5.2.tar.bz2
cd yaskkserv-0.5.2
./configure --enable-google-japanese-input
make
make install_all

- 辞書を作成する (使う辞書はお好みで)
cd /usr/share/skk
yaskkserv_make_dictionary SKK-JISYO.L SKK-JISYO.L.yaskkserv
yaskkserv_hairy --google-japanese-input=notfound /usr/share/skk/SKK-JISYO.L.yaskkserv

わんさか付けるのが好みな人はこんなのはどう??
skkdic-expr2 SKK-JISYO.L + SKK-JISYO.itaiji + SKK-JISYO.itaiji.JIS3_4 + SKK-JISYO.jinmei + SKK-JISYO.edict + SKK-JISYO.geo + SKK-JISYO.KAO + SKK-JISYO.zipcode + SKK-JISYO.station > SKK-JISYO.my
yaskkserv_make_dictionary SKK-JISYO.my SKK-JISYO.my.yaskkserv
yaskkserv_hairy --google-japanese-input=notfound /usr/share/skk/SKK-JISYO.my.yaskkserv

- とりあえず、変換できるかを確認してみよう。
Windows のclient(skkime1.5)はskkimeを再起動する必要があるよ
(= skkimeの辞書設定をもう一度行えばOK)

- OSの起動時のscriptに追加
vi /etc/rc.local に追加します。

/usr/local/sbin/yaskkserv_hairy --google-japanese-input=notfound /usr/share/skk/SKK-JISYO.L.yaskkserv
or
/usr/local/sbin/yaskkserv_hairy --google-japanese-input=notfound /usr/share/skk/SKK-JISYO.my.yaskkserv

Xen Server のnagios cfg

HP ProLiantでIMLをインストールしてある場合は、コメントはずすとHWのチェック可能です。

define host{
use linux-server
host_name xen01
alias xen01_Xenserver
address 192.168.1.1
}

define host{
use linux-server
host_name xen02
alias xen02_Xenserver
address 192.168.1.2
}


define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
}

define hostgroup{
hostgroup_name linux-snmp-servers ; The name of the hostgroup
alias Linux SNMP Servers ; Long name of the group
members xen01,xen02
}

#define hostgroup{
# hostgroup_name hp-iml-servers
# alias HP IML Servers
# members xen01,xen02
#}

define service{
use generic-service
hostgroup_name linux-snmp-servers
name Linux_swap
service_description Memory_swap_check
check_command check_snmp_disk_virtual!75%!90%!
}

define service{
use generic-service
hostgroup_name linux-snmp-servers
name Linux_root
service_description Disk_/_check
check_command check_snmp_disk!/!80%!90%!
}

define service{
use generic-service
host_name xen01,xen02
name Linux_sr-mount1
service_description Disk_/var/run/sr-mount/----------------_check
check_command check_snmp_disk!/var/run/sr-mount/----------!80%!90%!
}

define service{
use generic-service
hostgroup_name linux-snmp-servers
name Linux_process_v6d
service_description process_check_v6d
check_command check_snmp_process!v6d!1!1!
}

define service{
use generic-service
hostgroup_name linux-snmp-servers
name Linux_process_xenstored
service_description process_check_xenstored
check_command check_snmp_process!xenstored!1!1!
}

define service{
use generic-service
hostgroup_name linux-snmp-servers
name Linux_process_xenconsoled
service_description process_check_xenconsoled
check_command check_snmp_process!xenconsoled!1!1!
}

define service{
use generic-service
hostgroup_name linux-snmp-servers
name Linux_process_squeezed
service_description process_check_squeezed
check_command check_snmp_process!squeezed!1!1!
}

define service{
use generic-service
hostgroup_name linux-snmp-servers
name Linux_process_xapi
service_description process_check_xapi
check_command check_snmp_process!xapi!1!1!
}

define service{
use generic-service
hostgroup_name linux-snmp-servers
name Linux_process_tapdisk2
service_description process_check_tapdisk2
check_command check_snmp_process!tapdisk2!1!1!
}

define service {
use generic-service
hostgroup_name linux-snmp-servers
name Linux_load
service_description Linux cpu load check
max_check_attempts 4
check_command check_snmp_load_lin!80,70,70!90,80,80!
}

#define service {
# use generic-service
# hostgroup_name hp-iml-servers
# name check_hp_iml
# check_interval 10
# max_check_attempts 3
# service_description HP IML LOG
# check_command check_imllog
#}

define service {
use generic-service
hostgroup_name linux-snmp-servers
name check_log_varlogmessages
is_volatile 1
service_description log check error in varlogmessages
check_command check_nrpe1!check_logfiles!
}