このセクションでは、SNMP 統合を設定する方法について説明します。
SNMP 統合を設定するには、次の手順を実行します。
- /etc/snmp/snmpd.conf を編集します。SNMP サービスに接続するシステムの送信元 IP アドレスを含む次の行を設定ファイルに追加します。
次の例では、ローカル ホスト(コミュニティ文字列 vc-vcg を経由)および 10.0.0.0/8(SNMPv2c バージョンでコミュニティ文字列
myentprisecommunityを使用)からすべてのカウンタにアクセスするように設定しています。詳細については、Net-SNMP のドキュメントを参照してください。agentAddress udp:161 # com2sec sec.name source community com2sec local localhost vc-vcg com2sec myenterprise 10.0.0.0/8 myentprisecommunity# group access.name sec.model sec.name group rogroup v2c local group rogroup v2c myenterpriseview all included .1 80 # access access.name context sec.model sec.level match read write notif access rogroup "" any noauth exact all none none#sysLocation Sitting on the Dock of the Bay #sysContact Me <[email protected]>sysServices 72master agentx# # Process Monitoring ## At least one 'gwd' process proc gwd # At least one 'mgd' process proc mgd# # Disk Monitoring # # 100MBs required on root disk, 5% free on /var, 10% free on all other disks disk / 100000 disk /var 5% includeAllDisks 10%# # System Load # # Unacceptable 1-, 5-, and 15-minute load averages load 12 10 5
- /etc/iptables/rules.v4 を編集します。SNMP サービスに接続するシステムの送信元 IP アドレスを含む次の行を設定ファイルに追加します。
# WARNING: only add targeted rules for addresses and ports # do not add blanket drop or accept rules since Gateway will append its own rules # and that may prevent it from functioning properly *filter :INPUT ACCEPT [0:0] -A INPUT -p udp -m udp --source 127.0.0.1 --dport 161 -m comment --comment "allow SNMP port" -j ACCEPT -A INPUT -p udp -m udp --source 10.0.0.0/8 --dport 161 -m comment --comment "allow SNMP port" -j ACCEPT :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] COMMIT
- snmp サービスと iptables サービスを再起動します。
service snmpd restart service iptables-persistent restart service vc_process_monitor restart