3月
06
muninでsnmp監視
net-snmpのインストール
- # yum install net-snmp net-snmp-utils
監視対象の情報が取得できることを確認
- # snmpwalk -v 2c -c public server.local
muninの設定上監視対象にhost名がなければ付けておく(DNSで引けるなら不要)
- # /etc/hosts
- 192.168.0.100 server.local
muninの自動設定機能を利用
- #munin-node-configure --snmp server.local
- ln -s /usr/share/munin/plugins/snmp__users /etc/munin/plugins/snmp_server.local_users
- ln -s /usr/share/munin/plugins/snmp__load /etc/munin/plugins/snmp_server.local_load
- ln -s /usr/share/munin/plugins/snmp__if_err_ /etc/munin/plugins/snmp_server.local_if_err_4
- ln -s /usr/share/munin/plugins/snmp__if_err_ /etc/munin/plugins/snmp_server.local_if_err_6
- ln -s /usr/share/munin/plugins/snmp__if_ /etc/munin/plugins/snmp_server.local_if_4
- ln -s /usr/share/munin/plugins/snmp__if_ /etc/munin/plugins/snmp_server.local_if_6
- ln -s /usr/share/munin/plugins/snmp__df /etc/munin/plugins/snmp_server.local_df
出力されたln〜のコマンドを使ってシンボリックリンクを作成
host treeに監視対象を追記
- # vi /etc/munin/munin.conf
- [localhost]
- address 127.0.0.1
- use_node_name yes
- [server.local] ←監視対象の名前
- address 127.0.0.1 ←監視するサーバのアドレス
- use_node_name no
munin-nodeを再起動
- # service munin-node restart
監視対象側の設定(OSX Leopardの場合)
snmpdはインストール済みなので起動設定を行う
起動ファイルを作成
- $ sudo vi /Library/LaunchDaemons/snmpd.plist
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
- <plist version="1.0">
- <dict>
- <key>Label</key>
- <string>snmpd</string>
- <key>OnDemand</key>
- <true/>
- <key>Program</key>
- <string>/usr/sbin/snmpd</string>
- <key>RunAtLoad</key>
- <true/>
- </dict>
- </plist>
設定読み込み
- $ sudo launchctl load -w /Library/LaunchDaemons/snmpd.plist
起動
- $ sudo launchctl start snmpd
起動を確認
- $ sudo laof -i
動作の確認
- $ snmpwalk -v 2c -c public localhost
- $ snmpwalk -v 2c -c private localhost
snmpdの設定
- $ sudo vi /etc/snmp/snmpd.conf
- # sec.name source community
- #com2sec local localhost private
- #com2sec mynetwork NETWORK/24 public
- com2sec local 192.168.0.0/24 public
監視ホスト(CentOS)から監視対象(OSX Leoprad)の情報が取得できることを確認する
no comment untill now