본문으로 바로가기

[SNMP] 서버 상태 확인 OID (CPU, Memory, Disk, Traffic)

category OS/Linux 2022. 1. 20. 23:40

1. CPU

코어 당 사용률 (%)

# snmpwalk -v 2c -c snmpuser localhost 1.3.6.1.2.1.25.3.3.1.2
HOST-RESOURCES-MIB::hrProcessorLoad.196608 = INTEGER: 2
HOST-RESOURCES-MIB::hrProcessorLoad.196609 = INTEGER: 1
HOST-RESOURCES-MIB::hrProcessorLoad.196610 = INTEGER: 1
HOST-RESOURCES-MIB::hrProcessorLoad.196611 = INTEGER: 1

2. Memory, Disk

저장소 타입 확인 (hrStorageType)

# snmpwalk -v 2c -c snmpuser localhost 1.3.6.1.2.1.25.2.3.1.2
HOST-RESOURCES-MIB::hrStorageType.1 = OID: HOST-RESOURCES-TYPES::hrStorageRam
HOST-RESOURCES-MIB::hrStorageType.3 = OID: HOST-RESOURCES-TYPES::hrStorageVirtualMemory
HOST-RESOURCES-MIB::hrStorageType.6 = OID: HOST-RESOURCES-TYPES::hrStorageOther
HOST-RESOURCES-MIB::hrStorageType.7 = OID: HOST-RESOURCES-TYPES::hrStorageOther
HOST-RESOURCES-MIB::hrStorageType.8 = OID: HOST-RESOURCES-TYPES::hrStorageOther
HOST-RESOURCES-MIB::hrStorageType.10 = OID: HOST-RESOURCES-TYPES::hrStorageVirtualMemory
HOST-RESOURCES-MIB::hrStorageType.31 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.37 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.39 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.40 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.54 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.57 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk

 

저장소 이름(hrStorageDescr)

# snmpwalk -v 2c -c snmpuser localhost 1.3.6.1.2.1.25.2.3.1.3
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Physical memory
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Virtual memory
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: Memory buffers
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: Cached memory
HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: Shared memory
HOST-RESOURCES-MIB::hrStorageDescr.10 = STRING: Swap space
HOST-RESOURCES-MIB::hrStorageDescr.31 = STRING: /
HOST-RESOURCES-MIB::hrStorageDescr.37 = STRING: /dev/shm
HOST-RESOURCES-MIB::hrStorageDescr.39 = STRING: /run
HOST-RESOURCES-MIB::hrStorageDescr.40 = STRING: /sys/fs/cgroup
HOST-RESOURCES-MIB::hrStorageDescr.54 = STRING: /boot
HOST-RESOURCES-MIB::hrStorageDescr.57 = STRING: /run/user/0

 

저장소 할당 단위(hrStorageAllocationUnits)

# snmpwalk -v 2c -c snmpuser localhost 1.3.6.1.2.1.25.2.3.1.4
HOST-RESOURCES-MIB::hrStorageAllocationUnits.1 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.3 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.6 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.7 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.8 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.10 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.31 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.37 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.39 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.40 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.54 = INTEGER: 8192 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.57 = INTEGER: 4096 Bytes

 

저장소 크기(hrStorageSize)

# snmpwalk -v 2c -c snmpuser localhost 1.3.6.1.2.1.25.2.3.1.5
HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 947004
HOST-RESOURCES-MIB::hrStorageSize.3 = INTEGER: 1446712
HOST-RESOURCES-MIB::hrStorageSize.6 = INTEGER: 947004
HOST-RESOURCES-MIB::hrStorageSize.7 = INTEGER: 299984
HOST-RESOURCES-MIB::hrStorageSize.8 = INTEGER: 47752
HOST-RESOURCES-MIB::hrStorageSize.10 = INTEGER: 499708
HOST-RESOURCES-MIB::hrStorageSize.31 = INTEGER: 424446
HOST-RESOURCES-MIB::hrStorageSize.37 = INTEGER: 118375
HOST-RESOURCES-MIB::hrStorageSize.39 = INTEGER: 118375
HOST-RESOURCES-MIB::hrStorageSize.40 = INTEGER: 118375
HOST-RESOURCES-MIB::hrStorageSize.54 = INTEGER: 36587
HOST-RESOURCES-MIB::hrStorageSize.57 = INTEGER: 23676

 

저장소 사용량(hrStorageUsed)

# snmpwalk -v 2c -c snmpuser localhost 1.3.6.1.2.1.25.2.3.1.6
HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 451000
HOST-RESOURCES-MIB::hrStorageUsed.3 = INTEGER: 451000
HOST-RESOURCES-MIB::hrStorageUsed.6 = INTEGER: 59092
HOST-RESOURCES-MIB::hrStorageUsed.7 = INTEGER: 299984
HOST-RESOURCES-MIB::hrStorageUsed.8 = INTEGER: 47752
HOST-RESOURCES-MIB::hrStorageUsed.10 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.31 = INTEGER: 395104
HOST-RESOURCES-MIB::hrStorageUsed.37 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.39 = INTEGER: 11938
HOST-RESOURCES-MIB::hrStorageUsed.40 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.54 = INTEGER: 6501
HOST-RESOURCES-MIB::hrStorageUsed.57 = INTEGER: 0

3. Traffic

인터페이스 이름(ifName)

# snmpwalk -v 2c -c snmpuser localhost 1.3.6.1.2.1.31.1.1.1.1
IF-MIB::ifName.1 = STRING: lo
IF-MIB::ifName.2 = STRING: eth0
IF-MIB::ifName.3 = STRING: wlan0

 

수신량(ifInOctets)

# snmpwalk -v 2c -c snmpuser localhost 1.3.6.1.2.1.2.2.1.10
IF-MIB::ifInOctets.1 = Counter32: 3645062
IF-MIB::ifInOctets.2 = Counter32: 231829622
IF-MIB::ifInOctets.3 = Counter32: 0

 

송신량(ifOutOctets)

# snmpwalk -v 2c -c snmpuser localhost 1.3.6.1.2.1.2.2.1.16
IF-MIB::ifOutOctets.1 = Counter32: 3645672
IF-MIB::ifOutOctets.2 = Counter32: 270787510
IF-MIB::ifOutOctets.3 = Counter32: 0