cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Etc


Reference














.

os:linux:command:snmpwalk.html



Network
snmp - How to Configure snmp in Linux

How to use snmpwalk command in Linux

snmpwalk -h

# snmpwalk -h

USAGE: snmpwalk [OPTIONS] AGENT [OID]

OPTIONS:
  -h, --help            display this help message
  -v 1|2c|3             specifies SNMP version to use

SNMP Version 1 or 2c specific
  -c COMMUNITY          set the community string

General options
  -O OUTOPTS            Toggle various defaults controlling output display:
                          n:  print OIDs numerically


Example

RFC1213 MIB-II (1.3.6.1.2.1)

System Information

hostname
# snmpwalk -v 2c -c public localhost sysname
SNMPv2-MIB::sysName.0 = STRING: localhost.localdomain

# snmpwalk -v 2c -c public localhost .1.3.6.1.2.1.1.5
SNMPv2-MIB::sysName.0 = STRING: localhost.localdomain

# snmpwalk -v 2c -c public -O n localhost sysname
.1.3.6.1.2.1.1.5.0 = STRING: centos7
# 
uname -a

hostname, kernel

# snmpwalk -v 2c -c public localhost .1.3.6.1.2.1.1.1
SNMPv2-MIB::sysDescr.0 = STRING: Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64

Network Interface Information

# snmpwalk -v 2c localhost -c public .1.3.6.1.2.1.2.2.1.2
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: eth0


NET-SNMP MIB(1.3.6.1.4.1.2021)

Memory

memory = .1.3.6.1.4.1.2021.4

# snmpwalk -v 2c localhost -c public memory
or
# snmpwalk -v 2c localhost -c public .1.3.6.1.4.1.2021.4
UCD-SNMP-MIB::memIndex.0 = INTEGER: 0
UCD-SNMP-MIB::memErrorName.0 = STRING: swap
UCD-SNMP-MIB::memTotalSwap.0 = INTEGER: 1015800 kB
UCD-SNMP-MIB::memAvailSwap.0 = INTEGER: 1015800 kB
UCD-SNMP-MIB::memTotalReal.0 = INTEGER: 502220 kB
UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 336160 kB
UCD-SNMP-MIB::memTotalFree.0 = INTEGER: 1351960 kB
UCD-SNMP-MIB::memMinimumSwap.0 = INTEGER: 16000 kB
UCD-SNMP-MIB::memBuffer.0 = INTEGER: 8328 kB
UCD-SNMP-MIB::memCached.0 = INTEGER: 56128 kB
UCD-SNMP-MIB::memSwapError.0 = INTEGER: noError(0)
UCD-SNMP-MIB::memSwapErrorMsg.0 = STRING:
#

Disk Infomation




os/linux/command/snmpwalk.html.txt · Last modified: 2017/05/14 by admin

Page Tools