RadarURL

유닉스/리눅스
2014.12.26 20:15

SNMP 를 설정해 보자 (CentOS 5.6)

조회 수 4612 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

가 크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

가 크게 작게 위로 아래로 댓글로 가기 인쇄

SNMP 를 설정해 보자(CentOS 5.6)


1. snmp 설치

- root 계정으로 접속

#yum -y install net-snmp*

snmpd 의 설정파일은 /etc/snmp/snmpd.conf 파일인에, 

yum 으로 최초로 설치되는 snmpd.conf 파일 안에는 뭔가가 아주 많이 들어 있다. 

다 삭제하고 read only 로 public 커뮤니티 하나만 세팅해 보자.. 


# cd /etc/snmp

# mv /etc/snmp/snmpd.conf /etc/snmpd.conf.orig

# echo rocommunity public > snmpd.conf


이렇게 해서 /etc/snmp/snmpd.conf 파일을 열어 보면, 

rocommunity public

이렇게 한 줄만 들어가 있다. read only 커뮤니티 public 을 설정한다는 의미일 것이다. 


2. snmpd 재시작

# service snmpd restart

다른 방법

#/etc/init.d/snmpd start


방화벽 오픈 및 다른 곳에서 모니터링하기

snmp 는 UDP 161 포트를 사용하고,

snmp trap 은 UDP 162 포트를 사용한다. 


3. iptable 설정(리눅스 방화벽)

#cd /etc/sysconfig

#vi iptables

-A INPUT -P udp --dport 161 -j ACCEPT

#service iptables restart

#netstat -nulp

 


4. nmap 설치 미 확인

#yum -y install nmap

#nmap -sU localhost

 


5. localhost 의 정보를 읽어 보자

#snmpwalk

USAGE: snmpwalk [OPTIONS] AGENT [OID]

Version:  5.3.2.2

  Web:      http://www.net-snmp.org/

  Email:    net-snmp-coders@lists.sourceforge.net


OPTIONS:

  -h, --help            display this help message

  -H                    display configuration file directives understood

  -v 1|2c|3             specifies SNMP version to use

  -V, --version         display package version number

SNMP Version 1 or 2c specific

  -c COMMUNITY          set the community string

SNMP Version 3 specific

  -a PROTOCOL           set authentication protocol (MD5|SHA)

  -A PASSPHRASE         set authentication protocol pass phrase

  -e ENGINE-ID          set security engine ID (e.g. 800000020109840301)

  -E ENGINE-ID          set context engine ID (e.g. 800000020109840301)

  -l LEVEL              set security level (noAuthNoPriv|authNoPriv|authPriv)

  -n CONTEXT            set context name (e.g. bridge1)

  -u USER-NAME          set security name (e.g. bert)

  -x PROTOCOL           set privacy protocol (DES|AES)

  -X PASSPHRASE         set privacy protocol pass phrase

  -Z BOOTS,TIME         set destination engine boots/time

General communication options

  -r RETRIES            set the number of retries

  -t TIMEOUT            set the request timeout (in seconds)

Debugging

  -d                    dump input/output packets in hexadecimal

  -D[TOKEN[,...]]       turn on debugging output for the specified TOKENs

                           (ALL gives extremely verbose debugging output)

General options

  -m MIB[:...]          load given list of MIBs (ALL loads everything)

  -M DIR[:...]          look in given list of directories for MIBs

  -P MIBOPTS            Toggle various defaults controlling MIB parsing:

                          u:  allow the use of underlines in MIB symbols

                          c:  disallow the use of "--" to terminate comments

                          d:  save the DESCRIPTIONs of the MIB objects

                          e:  disable errors when MIB symbols conflict

                          w:  enable warnings when MIB symbols conflict

                          W:  enable detailed warnings when MIB symbols conflict

                          R:  replace MIB symbols from latest module

  -O OUTOPTS            Toggle various defaults controlling output display:

                          0:  print leading 0 for single-digit hex characters

                          a:  print all strings in ascii format

                          b:  do not break OID indexes down

                          e:  print enums numerically

                          E:  escape quotes in string indices

                          f:  print full OIDs on output

                          n:  print OIDs numerically

                          q:  quick print for easier parsing

                          Q:  quick print with equal-signs

                          s:  print only last symbolic element of OID

                          S:  print MIB module-id plus last element

                          t:  print timeticks unparsed as numeric integers

                          T:  print human-readable text along with hex strings

                          u:  print OIDs using UCD-style prefix suppression

                          U:  don't print units

                          v:  print values only (not OID = value)

                          x:  print all strings in hex format

                          X:  extended index format

  -I INOPTS             Toggle various defaults controlling input parsing:

                          b:  do best/regex matching to find a MIB node

                          h:  don't apply DISPLAY-HINTs

                          r:  do not check values for range/type legality

                          R:  do random access to OID labels

                          u:  top-level OIDs must have '.' prefix (UCD-style)

                          s SUFFIX:  Append all textual OIDs with SUFFIX before parsing

                          S PREFIX:  Prepend all textual OIDs with PREFIX before parsing

  -L LOGOPTS            Toggle various defaults controlling logging:

                          e:           log to standard error

                          o:           log to standard output

                          n:           don't log at all

                          f file:      log to the specified file

                          s facility:  log to syslog (via the specified facility)


                          (variants)

                          [EON] pri:   log to standard error, output or /dev/null for level 'pri' and above

                          [EON] p1-p2: log to standard error, output or /dev/null for levels 'p1' to 'p2'

                          [FS] pri token:    log to file/syslog for level 'pri' and above

                          [FS] p1-p2 token:  log to file/syslog for levels 'p1' to 'p2'

  -C APPOPTS            Set various application specific behaviours:

                          p:  print the number of variables found

                          i:  include given OID in the search range

                          I:  don't include the given OID, even if no results are returned

                          c:  do not check returned OIDs are increasing

                          t:  Display wall-clock time to complete the request


6. localhost 의 snmp 정보 모으기

#snmpwalk -v 2c -c public localhost


7. 원격지 시스템의 snmp 정보 모으기

: 원격지 시스템(넥스지 UTM을 대상으로 함 community 는 aaa로 설정 하였다

#snmpwalk -v 2c -c aaa 호스트IP

#snmpwalk -v2c -c aaa 호스트IP

SNMPv2-MIB::sysDescr.0 = STRING: Linux ns.aaa.or.kr 2.6.6-8hl #1 Tue Oct 12 00:22:29 KST 2004 i686

SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10

SNMPv2-MIB::sysUpTime.0 = Timeticks: (54657) 0:09:06.57

SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)


#snmpwalk -v2c -c read-aaa -O f 호스트IP

.iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0 = STRING: Linux ns.aaa.or.kr 2.6.6-8hl #1 Tue Oct 12 00:22:29 KST 2004 i686

.iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0 = OID: .iso.org.dod.internet.private.enterprises.netSnmp.netSnmpEnumerations.netSnmpAgentOIDs.10

.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.0 = Timeticks: (47124) 0:07:51.24

.iso.org.dod.internet.mgmt.mib-2.system.sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)

#snmpwalk -v2c -c aaa -O fn 호스트IP

 .1.3.6.1.2.1.1.1.0 = STRING: Linux ns.aaa.or.kr 2.6.6-8hl #1 Tue Oct 12 00:22:29 KST 2004 i686

 .1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.8072.3.2.10

 .1.3.6.1.2.1.1.3.0 = Timeticks: (76934) 0:12:49.34

 .1.3.6.1.2.1.1.4.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)



출처 : http://blog.daum.net/hopcount/8658565

TAG •
?

공부 게시판

공부에 도움되는 글을 올려주세요.

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 [공지] 공부 게시판 입니다. 처누 2003.08.18 2016094
2625 u-E(표준화) 양산싱크대막힘 시원하게 뚫는 비법 new 예측불가토끼46 2026.10.06 1
2624 동식물 용인두피문신 고민? 만족 후기 보려면 new 절묘한솔개92 2026.10.06 1
2623 구글 애드센스 토보샵: 명품레플리카 쇼핑의 시작 new 얼어붙은흐름98 2026.10.06 1
2622 사무 소프트웨어 대전누수, 근본 원인 해결의 시작 new 적막한체이서42 2026.10.06 1
2621 사업 마인드 끝판왕 사이즈까지 장착 완료! 010---8293---0291---- 여기가 베트남인줄 마블 노래클럽 new 기운찬오소리38 2026.10.05 1
2620 건강 카-툑 gusim8003 [24시문의] 선불유심내구제/내구제대출/소액대출/급전/ 비대면대출 상조내구제 무직자대출 대출 new 어설픈오소리22 2026.10.05 1
2619 하드웨어 강남엘리트❤️OlO-8655-OO53❤️친절문의24시 강남하퍼1등실장 #강남엘리트 #강남엘리트위치 #강남엘리트하퍼 #하이퍼블릭엘리트 #강남엘리트예약문의 #선릉엘리트 #선릉역엘리트 #강남사라있네 new 괴랄한재규어89 2026.10.05 1
2618 블로그 청담동셔츠룸 010 2817 0845 일정과 인원에 맞춘 셔츠룸 문의 new 정열적인퀘이사14 2026.10.05 1
2617 카메라 최근 테헤란로 벤처 밸리의 핵심 리더들 사이에서 ‘클래스가 다른 정통 수질과 프라이빗 무드’로 소문 자자한 '선릉 룸싸롱' 기습 방문, 인공미를 거부하는 무결점 뉴페이스들과 심장을 마비시킨 사심 플러팅에 제대로 저격당하고 온 솔직 후기 new 희미한홍학99 2026.10.05 1
2616 u-E(활성화) 본식DVD, 웨딩영상 색감이 중요한 이유새 창 열림 new 힘겨운귤35 2026.10.05 2
2615 공지 대전, 인천, 세종 하수구 막힘 문제 해결 방법 new 정열적인코요테90 2026.10.05 4
2614 취미 <문경맥주> 구입 할 수 있는 곳은 새 창 열림 타오르는드래곤61 2026.10.05 1
2613 데이터베이스 강남건전지❤️OlO-8655-OO53❤️친절문의환영 #강남건전지 #강남유니콘 #선릉유니콘 #강남건전지위치 #선릉역건전지#대치동유니콘 #강남바커스 #선릉바커스 #선릉역바커스 #강남룸클럽 #선릉룸클럽 #강남베터리 #강남바데리 괴랄한재규어89 2026.10.05 1
2612 사무 소프트웨어 용인두피문신 고민? 만족 후기 보려면 날카로운꿩11 2026.10.05 12
2611 논문 카­톡 gusim8003 급전/내구제 (24시문의) 폰테크 소액대출 선불폰 가개통 타오르는켄타우로스86 2026.10.05 1
2610 윈도우즈 웨딩누브라, 완벽한 드레스 핏을 위한 선택 날카로운감시자22 2026.10.05 5
2609 인터넷 성공적인 중고화물차 선택, 현명한 가이드 붉은드래곤50 2026.10.05 2
2608 가상화 인천맛집 순위 차가운파편97 2026.10.05 2
2607 응용 프로그래밍 완벽한 웨딩드레스 핏의 비밀, 웨딩누브라 힘겨운암석76 2026.10.05 2
2606 카메라 파주누수업체, 신속 해결 전문가의 비결 차가운에메랄드79 2026.10.05 2
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 132 Next
/ 132


즐겨찾기 (가족)

JAESOO's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너