이 섹션에서는 SNMP 통합을 구성하는 방법을 설명합니다.
SNMP 통합을 구성하려면 다음을 수행합니다.
- /etc/snmp/snmpd.conf를 편집합니다. SNMP 서비스에 연결할 시스템의 소스 IP를 사용하여 다음 줄을 구성에 추가합니다.
다음 예에서는 커뮤니티 문자열 vc-vcg를 통해 localhost에서, SNMPv2c 버전을 사용하여 커뮤니티 문자열
myentprisecommunity를 사용하여 10.0.0.0/8에서 모든 카운터에 대한 액세스를 구성합니다. 자세한 내용은 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