강좌

HOME > 강좌 >
강좌| 리눅스 및 오픈소스에 관련된 강좌를 보실 수 있습니다.
 
Net-SNMP (5.0.8)
조회 : 5,428  


Net-SNMP (5.0.8)

 


Net-SNMP

이전에 UCD-SNMP을 설치하는 글을 써둔것이 있다.
사실 설치과정은 동일하다. Net-SNMP가 ucd-snmp에 기반을 두고 있으니..
이번에 설치할 일이 있어 기존방식대로 하다가 설정사항에서 문제가 있었다
아무튼 이 글은 5.0.8에 반영해 적었다.

기존 net-snmp 패키지 삭제

[root@linux root]# uname -a            
Linux linux 2.4.20 #5 화 1월 21 15:38:36 KST 2003 i686 i686 i386 GNU/Linux
[root@linux root]# rpm -qa|grep net-snmp
net-snmp-utils-5.0.1-6
net-snmp-5.0.1-6
net-snmp-devel-5.0.1-6
[root@linux root]# rpm -e net-snmp-devel
[root@linux root]# rpm -e net-snmp-utils
[root@linux root]# rpm -e net-snmp      
오류: Failed dependencies:
        libsnmp.so.5 is needed by (installed) kernel-utils-2.4-8.13
        libsnmp.so.5 is needed by (installed) ethereal-0.9.6-1
        libsnmp.so.5 is needed by (installed) ethereal-gnome-0.9.6-1
        net-snmp >= 5.0 is needed by (installed) ethereal-0.9.6-1
[root@linux root]# rpm -e net-snmp --nodeps
경고: /etc/snmp/snmpd.conf(이)가 /etc/snmp/snmpd.conf.rpmsave(으)로 저장되었습니다
[root@linux root]#


새로운 net-snmp 패키지 설치
[root@linux down]# wget http://cesnet.dl.sourceforge.net/sourceforge/net-snmp/net-snmp-5.0.8.tar.gz
[root@linux down]# tar xvzf net-snmp-5.0.8.tar.gz -C /usr/local/src
[root@linux down]# cd /usr/local/src/net-snmp-5.0.8/
[root@linux net-snmp-5.0.8]# ./configure

configure시 다음 사항 입력. 입력하지 않은 것은 디폴트 사용.
Default version of SNMP to use (3):
System Contact Information (root@): kang@dbakorea.pe.kr
System Location (Unknown): Hang-Shin dong, Goyang City, Kyung-Gi do, Republic of Korea
Location to write logfile (/var/log/snmpd.log):
Location to write persistent information (/var/net-snmp):

[root@linux net-snmp-5.0.8]# make; make install
[root@linux net-snmp-5.0.8]# cp EXAMPLE.conf /usr/local/share/snmp/snmpd.conf
[root@linux net-snmp-5.0.8]# vi /usr/local/share/snmp/snmpd.conf

[/usr/local/share/snmp/snmpd.conf] 변경한 설정사항 일부
#        sec.name  source          community
com2sec  local     localhost       private
com2sec  mynet     192.168.0.0/24   public
com2sec  public    default         public
#com2sec6 mynet     fec0::/64       public

#             sec.model  sec.name
group mygroup v1         mynet
group mygroup v2c        mynet
group mygroup usm        mynet
group local   v1         local
group local   v2c        local
group local   usm        local
group public  v1         public
group public  v2c        public
group public  usm        public

#           incl/excl subtree                          mask
view all    included  .1                               80
view system included  system                           fe
view mib2   included  .iso.org.dod.internet.mgmt.mib-2 fc

#              context sec.model sec.level prefix read   write notify
access mygroup ""      any       noauth    exact  mib2   none  none
access public  ""      any       noauth    exact  system none  none
access local   ""      any       noauth    exact  all    all   all
# -------------------------------------------------------------------

syslocation "Hang-Shin dong, Goyang City, Kyung-Gi do, Republic of Korea"
syscontact "kang myung gyu <kang@dbakorea.pe.kr>"



SNMP Agent가 제대로 되지 않으면 로그와 FAQ, 문서를 보도록 하자.
/var/log/snmpd.log
http://www.net-snmp.org/FAQ.html


서버실행(-h옵션을 주면 도움말을 볼 수 있다)
[root@linux snmp]# snmpd


테스트
[root@linux snmp]# snmpget -v1 -c public localhost system.sysLocation.0          
SNMPv2-MIB::sysLocation.0 = STRING: "Hang-Shin dong, Goyang City, Kyung-Gi do, Republic of Korea"

[root@linux net-snmp-5.0.8]# snmpwalk -v1 -c public localhost system
SNMPv2-MIB::sysDescr.0 = STRING: Linux linux 2.4.20 #5 화 1월 21 15:38:36 KST 2003 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
SNMPv2-MIB::sysUpTime.0 = Timeticks: (42699) 0:07:06.99
SNMPv2-MIB::sysContact.0 = STRING: "kang myung gyu <kang@dbakorea.pe.kr>"
SNMPv2-MIB::sysName.0 = STRING: linux
SNMPv2-MIB::sysLocation.0 = STRING: "Hang-Shin dong, Goyang City, Kyung-Gi do, Republic of Korea"
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORID.1 = OID: IF-MIB::ifMIB
SNMPv2-MIB::sysORID.2 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.3 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.4 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.5 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.6 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.7 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.8 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.9 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module to describe generic objects for network interface sub-layers
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORDescr.7 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.8 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.9 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.9 = Timeticks: (1) 0:00:00.01
End of MIB
[root@linux net-snmp-5.0.8]#



http://www.net-snmp.org/FAQ.html

This article comes from dbakorea.pe.kr (Leave this line as is)

[원글링크] : https://www.linux.co.kr/home2/board/subbs/board.php?bo_table=lecture&wr_id=759


이 글을 트위터로 보내기 이 글을 페이스북으로 보내기 이 글을 미투데이로 보내기

 
강명규
홈페이지 : http://dbakorea.pe.kr/

e-mail : myunggyu골뺑이orgio.net