Tuesday, September 4, 2007

Configure SNMP agent on Cisco devices

This article describes how to configure a Cisco Catalyst or a Cisco router in order to provide SNMP functionality.


1 - Login into Cisco device:


telnet 10.0.0.1


2 - Check if SNMP is enabled:


# show snmp
%SNMP agent not enabled

If SNMP is disabled, we enable it using:

3 - Enable SNMP

# configure terminal
# snmp-server community public RO
# snmp-server community private RW


For more information about SNMP options on Cisco devices look at [1]. By default SNMP version enabled on Cisco devices is 2c.

Now let's try to retrieve some informations using:

4 - Download and install net-snmp

* net-analyzer/net-snmp
Latest version available: 5.4
Latest version installed: [ Not Installed ]
Size of downloaded files: [no/bad digest]
Homepage: http://net-snmp.sourceforge.net/
Description: Software for generating and retrieving SNMP data
License: as-is BSD


After you installed net-snmp, you need to install Cisco MIBs. At first you should install CISCO-SMI and then CISCO-VTP-MIB (we want to retrieve vlans informations).You can download them from [2]. After downloaded copy them (changing extension from .my to.txt) to /usr/share/snmp/mibs


5 - Retrieve vlan information:


snmpwalk -m CISCO-VTP-MIB -v 2c -c public 192.168.177.34 vtpVlanState
CISCO-VTP-MIB::vtpVlanState.1.1 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.2 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.3 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.4 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.5 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.6 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.7 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.10 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.12 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.15 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.16 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.20 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.21 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.22 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.23 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.24 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.25 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.28 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.1002 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.1003 = INTEGER: operational(1)
CISCO-VTP-MIB::vtpVlanState.1.1004 = INTEGER: operational(1)
[...]


References:
[1] Configuring SNMP Support
[2] SNMP Object Navigator

No comments:

Post a Comment