티스토리 뷰

Linux

리눅스 SNMP 관련

CHOMAN 2015. 6. 11. 16:22

리눅스 SNMP 도표

 

CPU
1분간 평균 사용률: .1.3.6.1.4.1.2021.10.1.3.1
5분간 평균 사용률: .1.3.6.1.4.1.2021.10.1.3.2
15분간 평균 사용률: .1.3.6.1.4.1.2021.10.1.3.3

사용자 CPU 시간(%): .1.3.6.1.4.1.2021.11.9.0
사용자 CPU 시간 원본값: .1.3.6.1.4.1.2021.11.50.0
시스템 CPU 시간(%): .1.3.6.1.4.1.2021.11.10.0
시스템 CPU 시간 원본값: .1.3.6.1.4.1.2021.11.52.0
유휴 CPU 시간(%): .1.3.6.1.4.1.2021.11.11.0
유휴 CPU 시간 원본값: .1.3.6.1.4.1.2021.11.53.0
raw nice cpu time: .1.3.6.1.4.1.2021.11.51.0

메모리

전체 Swap 메모리 크기: .1.3.6.1.4.1.2021.4.3.0
사용 가능한 Swap 메모리 크기: .1.3.6.1.4.1.2021.4.4.0
전체 물리 메모리(RAM) 크기: .1.3.6.1.4.1.2021.4.5.0
사용 가능한 물리 메모리(RAM) 크기: .1.3.6.1.4.1.2021.4.6.0
사용 가능한 전체 메모리 크기(=사용 가능한 Swap 메모리 크기 + 사용 가능한 물리 메모리 크기): .1.3.6.1.4.1.2021.4.11.0
전체 공유 메모리 크기: .1.3.6.1.4.1.2021.4.13.0
전체 버퍼 메모리 크기: .1.3.6.1.4.1.2021.4.14.0
전체 캐쉬 메모리 크기: .1.3.6.1.4.1.2021.4.15.0

디스크

The snmpd.conf needs to be edited. Add the following (assuming a machine with a single ‘/’ partition):

disk / 100000 (or)

includeAllDisks 10% for all partitions and disks

The OIDs are as follows

Path where the disk is mounted: .1.3.6.1.4.1.2021.9.1.2.1
Path of the device for the partition: .1.3.6.1.4.1.2021.9.1.3.1
Total size of the disk/partion (kBytes): .1.3.6.1.4.1.2021.9.1.6.1
Available space on the disk: .1.3.6.1.4.1.2021.9.1.7.1
Used space on the disk: .1.3.6.1.4.1.2021.9.1.8.1
Percentage of space used on disk: .1.3.6.1.4.1.2021.9.1.9.1
Percentage of inodes used on disk: .1.3.6.1.4.1.2021.9.1.10.1

System Uptime: .1.3.6.1.2.1.1.3.0

참고1: http://www.debianadmin.com/linux-snmp-oids-for-cpumemory-and-disk-statistics.html

참고2: http://coolx.net/cboard/read.jsp?db=computer&num=76

2. 디스크 관련 추가 설정 정보

기본적으로 Net-SNMP를 설치하면 /(root) 에 대한 SNMP 정보만 표시된다.

루트 이외의 파티션 정보를 SNMP로 노출하려면 아래의 설정을 수정해야 한다.

- snmpd.conf 파일에 디스크 파티션 정보를 수정/추가해야 한다.

- datacollection-config.xml 파일에 디스크 파티션 정보를 수정/추가해야 한다.

참고: http://www.opennms.org/index.php/Monitoring_disk_space_with_Net-SNMP

 

퍼옴 : http://blog.daum.net/thermidor/7346820


ex) [root@SMC_73 ~]# snmpwalk -v2c -c managed_snmp 27.255.85.32 mem -On


.1.3.6.1.4.1.2021.4.1.0 = INTEGER: 0

.1.3.6.1.4.1.2021.4.2.0 = STRING: swap

.1.3.6.1.4.1.2021.4.3.0 = INTEGER: 18873648

.1.3.6.1.4.1.2021.4.4.0 = INTEGER: 18823060

.1.3.6.1.4.1.2021.4.5.0 = INTEGER: 12464968

.1.3.6.1.4.1.2021.4.6.0 = INTEGER: 781312

.1.3.6.1.4.1.2021.4.11.0 = INTEGER: 19604372

.1.3.6.1.4.1.2021.4.12.0 = INTEGER: 16000

.1.3.6.1.4.1.2021.4.13.0 = INTEGER: 0

.1.3.6.1.4.1.2021.4.14.0 = INTEGER: 20904

.1.3.6.1.4.1.2021.4.15.0 = INTEGER: 3392024

.1.3.6.1.4.1.2021.4.100.0 = INTEGER: 0 : SWAP 메모리 사용량 값

.1.3.6.1.4.1.2021.4.101.0 = STRING: 


SNMP 버그 관련?

vim /etc/snmp/snmpd.conf

OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"

 → OPTIonS="-LS 2 d -Lf /dev/null -p /var/run/snmpd.pid -a"


Dec 30 04:15:10 localhost snmpd[8178]: Received SNMP packet(s) from UDP: [192.168.0.29]:53894

Dec 30 04:15:10 localhost snmpd[8178]: Connection from UDP: [192.168.0.29]:34686 





ifHCInOctets (RX bytes)

.1.3.6.1.2.1.31.1.1.1.6.2


ifHCOutOctets (RX bytes)

.1.3.6.1.2.1.31.1.1.1.10.2

 



정리



ifHCInOctets: 1.3.6.1.2.1.31.1.1.1.6 (64-bit Octets in counter)

ifHCOutOctets: 1.3.6.1.2.1.31.1.1.1.10 (64-bit Octets out counter)

ifHCInUcastPkts:  1.3.6.1.2.1.31.1.1.1.7 (64-bit Packets in counter)

ifHCOutUcastPkts:  1.3.6.1.2.1.31.1.1.1.11 (64-bit Packets out counter)

ifHighSpeed: 1.3.6.1.2.1.31.1.1.1.15 (An estimate of the interface's current bandwidth in units of 1Mbps)

Low Speed interfaces


Lower speed interfaces can get by with 32-bit counters. If you use 32-bit counters on high-speed interfaces, they can wrap quickly; a 10 Mbps stream of back-to-back, full-size packets causes ifInOctets to wrap in just over 57 minutes. At 100 Mbps, the minimum wrap time is 5.7 minutes, and at 1 Gbps, the minimum is 34 seconds Note 1


ifInOctets: 1.3.6.1.2.1.2.2.1.10 (32-bit Octets in counter)

ifOutOctets: 1.3.6.1.2.1.2.2.1.16 (32-bit Octets out counter)

ifInUcastPkts: 1.3.6.1.2.1.2.2.1.11 (32-bit Packets in counter)

ifOutUcastPkts: 1.3.6.1.2.1.2.2.1.17 (32-bit Packets out counter)

ifSpeed: 1.3.6.1.2.1.2.2.1.5 (Currently negotiated speed of the interface - Max: 4.294 Gbps)

 



네트워크
분류항목SNMP MIB
네트워크 카드네트워크 카드 장치명ifDescr
MACifPhysAddress
트래픽 BPSifInOctets / ifOutOctets
트래픽 PPSifInUcastPkt / ifOutUcastPkt
네트워크 카드 errorifInErrors / ifOutErrors
네트워크 카드 droppedifInDiscards / ifOutDiscards









시스템
분류항목SNMP MIB
기본정보HostnamesysName
UptimesysUpTimeInstance
시스템 시간versionCDate
CPU사용자 CPU 사용률ssCpuUser
시스템 CPU 사용률ssCpuSystem
CPU IdlessCpuIdle
시스템 LOADlaLoad
MEMORY메모리 전체 스왑공간memTotalSwap
메모리 사용가능 스왑공간memAvailSwap
물리적인 전체 메모리 공간memTotalReal
물리적인 메모리중 이용가능한 공간memAvailReal
전체 사용가능한 메모리memTotalFree
전체 공유메모리 크기memShared
버퍼링된 메모리크기memBuffer
캐싱된 메모리크기memCached
HDD라벨명dskPath
장치명dskDevice
파티션별 사용률 %dskPercent









서비스
분류항목SNMP MIB
TCP현재 접속자수(established)tcpCurrEstab
접속패킷tcpInSegs / tcpOutSegs
LISTEN포트 / established 아이피tcpConnState
UDP접속패킷udpInDatagrams / udpOutDatagrams
ICMP수신메세지icmpInMsgs / icmpOutMsgs
응답메세지icmpInMsgs / icmpOutMsgs





'Linux' 카테고리의 다른 글

MRTG 자원 모니터링  (0) 2015.06.11
L2 스위치 / 리눅스 서버 SNMP 비교  (0) 2015.06.11
THRESHOLD MRTG  (0) 2015.06.11
snmpwalk 명령어  (0) 2015.06.11
rrdtool 설치  (0) 2015.06.11
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함