You will need to sudo or root privileges to install the following packages
snmpd snmp
Once these have been installed you will get following command available to you:
[email protected]:~$ snmp snmp-bridge-mib snmpconf snmpget snmpset snmptranslate snmpvacm snmpbulkget snmpd snmpgetnext snmpstatus snmptrap snmpwalk snmpbulkwalk snmpdelta snmpinform snmptable snmptrapd snmpcheck snmpdf snmpnetstat snmptest snmpusm
Snmpwalk is useful command to collect information from network device with SNMP agents. Depending on what version of SNMP, you will need to use one of the following commands
SNMPv1
snmpwalk -v1 -c{ community-name } ip_address
snmpwalk -v 1 -ctest-lab 10.1.0.201 SNMPv2-MIB::sysDescr.0 = STRING: Juniper Networks, Inc. srx220h2 internet router, kernel JUNOS 12.1X44-D45.2 #0: 2015-01-12 14:20:16 UTC [email protected]:/volume/build/junos/12.1/service/12.1X44-D45.2/obj-octeon/junos/bsd/kernels/JSRXNLE/kernel Build date: 2015-01-12 15:4 SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.2636.1.1.1.2.58 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (458062064) 53 days, 0:23:40.64 SNMPv2-MIB::sysContact.0 = STRING: Write a comment :D SNMPv2-MIB::sysName.0 = STRING: This a test for snmpwalk example :p SNMPv2-MIB::sysLocation.0 = STRING: The Lab in Space SNMPv2-MIB::sysServices.0 = INTEGER: 4
SNMPv2
snmpwalk -v2c -c{ community-name } ip_address
snmpwalk -v2c -ctest-lab 10.1.0.201 SNMPv2-MIB::sysDescr.0 = STRING: Juniper Networks, Inc. srx220h2 internet router, kernel JUNOS 12.1X44-D45.2 #0: 2015-01-12 14:20:16 UTC [email protected]:/volume/build/junos/12.1/service/12.1X44-D45.2/obj-octeon/junos/bsd/kernels/JSRXNLE/kernel Build date: 2015-01-12 15:4 SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.2636.1.1.1.2.58 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (458070509) 53 days, 0:25:05.09 SNMPv2-MIB::sysContact.0 = STRING: Write a comment :D SNMPv2-MIB::sysName.0 = STRING: This a test for snmpwalk example :p SNMPv2-MIB::sysLocation.0 = STRING: The Lab in Space SNMPv2-MIB::sysServices.0 = INTEGER: 4
SNMPv3
snmpwalk -v 3 -u { username } -l { noAuthNoPriv|authNoPriv|authPriv } -a { MD5|SHA } -A { authentication-password } -x { DES|AES } -X { privary-password } ip_address
snmpwalk -v3 -u test -l authPriv -a SHA -A test-lab -x AES -X test-lab 10.1.0.201 SNMPv2-MIB::sysDescr.0 = STRING: Juniper Networks, Inc. srx220h2 internet router, kernel JUNOS 12.1X44-D45.2 #0: 2015-01-12 14:20:16 UTC [email protected]:/volume/build/junos/12.1/service/12.1X44-D45.2/obj-octeon/junos/bsd/kernels/JSRXNLE/kernel Build date: 2015-01-12 15:4 SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.2636.1.1.1.2.58 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (458338855) 53 days, 1:09:48.55 SNMPv2-MIB::sysContact.0 = STRING: Write a comment :D SNMPv2-MIB::sysName.0 = STRING: This a test for snmpwalk example :p SNMPv2-MIB::sysLocation.0 = STRING: The Lab in Space SNMPv2-MIB::sysServices.0 = INTEGER: 4
The following two tabs change content below.
Keeran Marquis
Network Engineer
Keeran Marquis is a Network Engineer. His main goal is to learn everything within the Networking field, pick up a little bit of scripting, be a poor man sysadmin and share whatever he knows! All Posts are his own views, opinions and experiences, no guarantees they will work for you but point you in the right direction 🙂
Latest posts by Keeran Marquis (see all)
- Life and Times of an Unemployed Professional Speed Dater #3 - August 5, 2018
- Life and Times of an Unemployed Professional Speed Dater #2 - August 5, 2018
- Life and Times of an Unemployed Professional Speed Dater #1 - August 5, 2018