nagiosでホストを追加するときのメモです。
# Definitions for monitoring the local (Linux) host
cfg_file=/etc/nagios/objects/localhost.cfg
とあるのでこのlocalhost.cfgをコピーして利用
cp /etc/nagios/objects/localhost.cfg /etc/nagios/objects/jacc1.sample.com.cfg
vi jacc1.toitworks.com.cfg 編集
29 host_name jacc1.sample.com ←変更
30 alias jacc1.sample.com ←変更
31 address 163.43.160.XXX ←変更
46 define hostgroup{
47 hostgroup_name jacc-servers ; The name of the hostgroup (重複不可)
48 alias Jacc Servers ; Long name of the group
49 members localhost ; Comma separated list of hosts that belong to this group (変えたらエラー:変えた方がいい?課題)
50 }
全体の host_name ⇒jacc1.sample.com
変更したら保存。
nagios -v /etc/nagios/nagios.cfg チェック
再起動
service nagios restart
2010/08/29追記
vi /etc/nagios/nagios.cfg に下記を当然追加
39 cfg_file=/etc/nagios/objects/jacc3.sample.com.cfg
2010年8月12日木曜日
CentOS リポジトリの追加
MuninをCentOS5.5にインストールしようとしたら、公式のリポジトリには登録されていなかったのでRPMforgeのリポジトリを追加した。
下記は64ビット版
# wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
# rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
デフォルトは公式のリポジトリのままにしたいのでrpmforgeを無効にする。
vi /etc/yum.repos.d/rpmforge.repo
enable = 0 に変更
インストール
# yum --enablerepo=rpmforge install munin-node
でOK
32ビット版の場合は
#wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
でやってください。
下記は64ビット版
# wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
# rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
デフォルトは公式のリポジトリのままにしたいのでrpmforgeを無効にする。
vi /etc/yum.repos.d/rpmforge.repo
enable = 0 に変更
インストール
# yum --enablerepo=rpmforge install munin-node
でOK
32ビット版の場合は
#wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
でやってください。
2010年7月2日金曜日
CCNA(豆知識)
・no exec-timeout:時間が経ってもログアウトしない
・no logging console:exitで#に戻った時に表示をさせない
スイッチ間をtrank接続するときのケーブル⇒クロスケーブル
(スイッチ)
・自分がVTPモードのどれ(server,client,transparent)になっているか確かめるコマンド
show vtp status
Switch#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 255
Number of existing VLANs : 5
VTP Operating Mode : Server
VTP Domain Name : cisco
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x7D 0x5A 0xA6 0x0E 0x9A 0x72 0xA0 0x3A
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 0.0.0.0 (no valid interface found)
・Switch0がSwitch1とどのポートでつながっているか調べる
Switch0#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
Switch0 Fas 0/1 127 S 2950 Fas 0/10
Fas 0/10が相手のポート
・no logging console:exitで#に戻った時に表示をさせない
スイッチ間をtrank接続するときのケーブル⇒クロスケーブル
(スイッチ)
・自分がVTPモードのどれ(server,client,transparent)になっているか確かめるコマンド
show vtp status
Switch#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 255
Number of existing VLANs : 5
VTP Operating Mode : Server
VTP Domain Name : cisco
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x7D 0x5A 0xA6 0x0E 0x9A 0x72 0xA0 0x3A
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 0.0.0.0 (no valid interface found)
・Switch0がSwitch1とどのポートでつながっているか調べる
Switch0#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
Switch0 Fas 0/1 127 S 2950 Fas 0/10
Fas 0/10が相手のポート
CCNA対策1(VLANコマンド復習)
「スイッチの設定」
[1]基本設定
(特権パスワード設定)
①特権secretパスワード設定(全体のパスワード暗号化もservice password-encryption)
②hostname設定
③コンソールパスワード設定
④リモートパスワード設定
⑤スイッチのIPアドレス設定
(config)#interface VLAN 1
(config-if)#ip address 192.168.1.2 255.255.255.0
(config-if)#no shutdown
(config-if)#exit
(config)#ip default-gateway 192.168.1.1
#show interface VLAN 1
////////////////////////////////////////////////////////////////////////////
[2]VALN作成
①VLAN作成(VLANをデータベースに登録)
#vlan database
(vlan)#vlan 2 name VLAN2
(vlan)#vlan 3 name VLAN3
(vlan)#exit
②ポートをVLANに登録
(config)#interface fa0/2
(config-if)#switchport mode access
(config-if)#switchport access vlan 2
(config-if)#end
#show vlan
③VLAN間ルーティング
(config)#interface fa0/0
(config-if)#no shutdown
(config-if)#interface fa0/0.1
(config-subif)#encapsulation dot1q 1
(config-subif)#ip address 192.168.1.1 255.255.255.0 (このアドレスがホストのゲートウェイ)
(config-if)#interface fa0/0.2
(config-subif)#encapsulation dot1q 10
(config-subif)#ip address 192.168.5.1 255.255.255.0
(config-if)#interface fa0/0.3
(config-subif)#encapsulation dot1q 20
(config-subif)#ip address 192.168.7.1 255.255.255.0
(config-subif)#end
④VTPクライアント、サーバの設定
サーバ設定(default)更新はサーバを変更しないとクライアントへは流れない。
#vlan database
(vlan)#vtp server
(vlan)#vtp domain group1 (グループ付け)
(vlan)#exit
クライアント設定
#vlan database
(vlan)#vtp client
(vlan)#vtp domain group1
(vlan)#exit
⑤トランクリンク作成
(config)#interface fa0/1
(config-if)#switchport mode trunk
(config-if)#end
各スイッチで設定
⑥スイッチの優先度指定
(config)#spanning-tree vlan 1 priority 4096
////////////////////////////////////////////////////////////////////////////////////
[3]セキュリティ設定
ホストからルータのIPアドレスに登録するとMACアドレスが登録される。show mac-address-table
①静的MACアドレスの設定
(config)#mac-address-table static 00e0.2917.1884(MACアドレス) interface fastethernet 0/4 vlan 1
MACアドレスを登録するとそこのMACアドレスが一定になる(他のホストがつなげなくなるわけではない)
セキュリティ設定
②1つのデバイスのみ受け入れ可能
(config)#interface fa0/4
(config-if)#switchport mode access
(config-if)#switchport port-security
(config-if)#switchport port-security mac-address sticky
③各ポートのホスト数の制限
(config-if)#switchport port-security maximum 1
④セキュリティ違反があった場合はシャットダウン
(config-if)#switchport port-security violation shutdown
ポートの再アクティブ化
(config-if)#shutdown
(config-if)#no shutdown
////////////////////////////////////////////////////////////////////////////////
VLAN削除
ホスト削除
(config)#interface fa0/2
(config-if)#no switchport mode access
(config-if)#no switchport access vlan 2
(config-if)#end
VLAN全体削除
#vlan database
(vlan)#no vlan 2
(vlan)#exit
スパニングツリーの設定 show spanning-tree
スイッチの初期化
#delete flash:vlan.dat →show vlanで確認
#erase startup-config
#reload
[その他重要コマンド]
・show interfaces trunk [機器のトランクポートの情報を確認]
・show interfaces switchport [スイッチポートの管理と運用の状態を表示]
[1]基本設定
(特権パスワード設定)
①特権secretパスワード設定(全体のパスワード暗号化もservice password-encryption)
②hostname設定
③コンソールパスワード設定
④リモートパスワード設定
⑤スイッチのIPアドレス設定
(config)#interface VLAN 1
(config-if)#ip address 192.168.1.2 255.255.255.0
(config-if)#no shutdown
(config-if)#exit
(config)#ip default-gateway 192.168.1.1
#show interface VLAN 1
////////////////////////////////////////////////////////////////////////////
[2]VALN作成
①VLAN作成(VLANをデータベースに登録)
#vlan database
(vlan)#vlan 2 name VLAN2
(vlan)#vlan 3 name VLAN3
(vlan)#exit
②ポートをVLANに登録
(config)#interface fa0/2
(config-if)#switchport mode access
(config-if)#switchport access vlan 2
(config-if)#end
#show vlan
③VLAN間ルーティング
(config)#interface fa0/0
(config-if)#no shutdown
(config-if)#interface fa0/0.1
(config-subif)#encapsulation dot1q 1
(config-subif)#ip address 192.168.1.1 255.255.255.0 (このアドレスがホストのゲートウェイ)
(config-if)#interface fa0/0.2
(config-subif)#encapsulation dot1q 10
(config-subif)#ip address 192.168.5.1 255.255.255.0
(config-if)#interface fa0/0.3
(config-subif)#encapsulation dot1q 20
(config-subif)#ip address 192.168.7.1 255.255.255.0
(config-subif)#end
④VTPクライアント、サーバの設定
サーバ設定(default)更新はサーバを変更しないとクライアントへは流れない。
#vlan database
(vlan)#vtp server
(vlan)#vtp domain group1 (グループ付け)
(vlan)#exit
クライアント設定
#vlan database
(vlan)#vtp client
(vlan)#vtp domain group1
(vlan)#exit
⑤トランクリンク作成
(config)#interface fa0/1
(config-if)#switchport mode trunk
(config-if)#end
各スイッチで設定
⑥スイッチの優先度指定
(config)#spanning-tree vlan 1 priority 4096
////////////////////////////////////////////////////////////////////////////////////
[3]セキュリティ設定
ホストからルータのIPアドレスに登録するとMACアドレスが登録される。show mac-address-table
①静的MACアドレスの設定
(config)#mac-address-table static 00e0.2917.1884(MACアドレス) interface fastethernet 0/4 vlan 1
MACアドレスを登録するとそこのMACアドレスが一定になる(他のホストがつなげなくなるわけではない)
セキュリティ設定
②1つのデバイスのみ受け入れ可能
(config)#interface fa0/4
(config-if)#switchport mode access
(config-if)#switchport port-security
(config-if)#switchport port-security mac-address sticky
③各ポートのホスト数の制限
(config-if)#switchport port-security maximum 1
④セキュリティ違反があった場合はシャットダウン
(config-if)#switchport port-security violation shutdown
ポートの再アクティブ化
(config-if)#shutdown
(config-if)#no shutdown
////////////////////////////////////////////////////////////////////////////////
VLAN削除
ホスト削除
(config)#interface fa0/2
(config-if)#no switchport mode access
(config-if)#no switchport access vlan 2
(config-if)#end
VLAN全体削除
#vlan database
(vlan)#no vlan 2
(vlan)#exit
スパニングツリーの設定 show spanning-tree
スイッチの初期化
#delete flash:vlan.dat →show vlanで確認
#erase startup-config
#reload
[その他重要コマンド]
・show interfaces trunk [機器のトランクポートの情報を確認]
・show interfaces switchport [スイッチポートの管理と運用の状態を表示]
登録:
コメント (Atom)