User Tools

Site Tools


tech:network:cisco:snmp:snmp

SNMP

Topology

Physical Lab.

Install Zabbix Server

Using Zabbix Server Appliance 3.4 Appliance Image.

Download, Start VM, Configure IP address, that's it!

Initial config

  • R1
en
conf t
!
int f0/0
ip addr 172.16.2.1 255.255.255.0
no shut
exit
int f0/1
ip addr 172.16.1.1 255.255.255.0
no shut
exit
!
end
  • R2
en
conf t
!
! ip configuration
int f0/0
ip addr 172.16.2.2 255.255.255.0
no shut
exit
int f0/1
ip addr dhcp
no shut
exit
!
end

Configuration

R1(config)#snmp-server community Public01 ro
R1(config)#snmp-server community Private01 rw
R1(config)#do sh run | i snmp-server
snmp-server community Public01 RO
snmp-server community Private01 RW
R1(config)#snmp-server host 172.16.2.241 version 2c Public01
R1(config)#snmp-server enable traps
snmp-server community Public01 ro
snmp-server community Private01 rw
snmp-server host 172.16.2.241 version 2c Public01
snmp-server enable traps

number of configuration generated…

R1(config)#do sh run | i snmp
snmp-server community Public01 RO
snmp-server community Private01 RW
snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart
snmp-server enable traps vrrp
snmp-server enable traps flowmon
snmp-server enable traps ds1
snmp-server enable traps call-home message-send-fail server-fail
snmp-server enable traps tty
snmp-server enable traps eigrp
snmp-server enable traps ospf state-change
snmp-server enable traps ospf errors
snmp-server enable traps ospf retransmit
snmp-server enable traps ospf lsa
snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
snmp-server enable traps ospf cisco-specific state-change shamlink interface
snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
snmp-server enable traps ospf cisco-specific errors
snmp-server enable traps ospf cisco-specific retransmit
snmp-server enable traps ospf cisco-specific lsa
snmp-server enable traps envmon
snmp-server enable traps adslline
snmp-server enable traps c3g
snmp-server enable traps vstack
snmp-server enable traps license
snmp-server enable traps flash insertion removal
snmp-server enable traps icsudsu
snmp-server enable traps isdn call-information
snmp-server enable traps isdn layer2
snmp-server enable traps isdn chan-not-avail
snmp-server enable traps isdn ietf
snmp-server enable traps ds0-busyout
snmp-server enable traps ds1-loopback
snmp-server enable traps ethernet cfm cc mep-up mep-down cross-connect loop config
snmp-server enable traps ethernet cfm crosscheck mep-missing mep-unknown service-up
snmp-server enable traps disassociate
snmp-server enable traps deauthenticate
snmp-server enable traps authenticate-fail
snmp-server enable traps dot11-qos
snmp-server enable traps switch-over
snmp-server enable traps rogue-ap
snmp-server enable traps wlan-wep
snmp-server enable traps rf
snmp-server enable traps atm subif
snmp-server enable traps bfd
snmp-server enable traps bgp
snmp-server enable traps bstun
snmp-server enable traps bulkstat collection transfer
snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
snmp-server enable traps memory bufferpeak
snmp-server enable traps cnpd
snmp-server enable traps config-copy
snmp-server enable traps config
snmp-server enable traps config-ctid
snmp-server enable traps dlsw
snmp-server enable traps dsp card-status
snmp-server enable traps dsp oper-state
snmp-server enable traps entity
snmp-server enable traps fru-ctrl
snmp-server enable traps resource-policy
snmp-server enable traps frame-relay multilink bundle-mismatch
snmp-server enable traps frame-relay
snmp-server enable traps frame-relay subif
snmp-server enable traps hsrp
snmp-server enable traps ipmobile
snmp-server enable traps ipmulticast
snmp-server enable traps isis
snmp-server enable traps mpls traffic-eng
snmp-server enable traps mpls fast-reroute protected
snmp-server enable traps mpls rfc ldp
snmp-server enable traps mpls ldp
snmp-server enable traps msdp
snmp-server enable traps mvpn
snmp-server enable traps pim neighbor-change rp-mapping-change invalid-pim-message
snmp-server enable traps pppoe
snmp-server enable traps cpu threshold
snmp-server enable traps nhrp nhs
snmp-server enable traps nhrp nhc
snmp-server enable traps nhrp nhp
snmp-server enable traps nhrp quota-exceeded
snmp-server enable traps rsvp
snmp-server enable traps ipsla
snmp-server enable traps stun
snmp-server enable traps syslog
snmp-server enable traps l2tun session
snmp-server enable traps l2tun pseudowire status
snmp-server enable traps vtp
snmp-server enable traps pw vc
snmp-server enable traps event-manager
snmp-server enable traps firewall serverstatus
snmp-server enable traps isakmp policy add
snmp-server enable traps isakmp policy delete
snmp-server enable traps isakmp tunnel start
snmp-server enable traps isakmp tunnel stop
snmp-server enable traps ipsec cryptomap add
snmp-server enable traps ipsec cryptomap delete
snmp-server enable traps ipsec cryptomap attach
snmp-server enable traps ipsec cryptomap detach
snmp-server enable traps ipsec tunnel start
snmp-server enable traps ipsec tunnel stop
snmp-server enable traps ipsec too-many-sas
snmp-server enable traps mpls vpn
snmp-server enable traps vrfmib vrf-up vrf-down vnet-trunk-up vnet-trunk-down
snmp-server host 172.16.2.241 version 2c Public01
R1(config)#access-list 1 permit 172.16.2.240
R1(config)#snmp-server community Public01 ro ?
  <1-99>       Std IP accesslist allowing access with this community string
  <1300-1999>  Expanded IP accesslist allowing access with this community
               string
  WORD         Access-list name
  ipv6         Specify IPv6 Named Access-List
  <cr>

R1(config)#snmp-server community Public01 ro 1
R1(config)#no access-list 1
R1(config)#access-list 1 permit 172.16.2.241
access-list 1 permit 172.16.2.241
snmp-server community Public01 ro 1
snmp-server system-shutdown
R1(config)#snmp-server system-shutdown
R1#wr
Building configuration...
[OK]
snmp-server trap-source f0/0
snmp-server queue-length 100
snmp-server trap-timeout 60
snmp-server contact Wataru Noguchi
snmp-server location My Home

R1#ping 172.16.2.2 repeat 10000000000

R2#debug snmp packets
SNMP packet debugging is on
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int
000024: Jun 10 18:54:57.219 JST: SNMP: Queuing packet to 172.16.2.241
000025: Jun 10 18:54:57.223 JST: SNMP: V2 Trap, reqid 3, errstat 0, erridx 0
 sysUpTime.0 = 1992138
 snmpTrapOID.0 = ciscoConfigManMIB.2.0.1
 ccmHistoryEventEntry.3.6 = 1
 ccmHistoryEventEntry.4.6 = 2
 ccmHistoryEventEntry.5.6 = 3
000026: Jun 10 18:54:57.475 JST: SNMP: Packet sent via UDP to 172.16.2.241
R2(config)#int f0/1
R2(config-if)#shut
R2(config-if)#
000027: Jun 10 18:55:13.998 JST: SNMP: Queuing packet to 172.16.2.241
000028: Jun 10 18:55:13.998 JST: SNMP: V2 Trap, reqid 4, errstat 0, erridx 0
 sysUpTime.0 = 1993816
 snmpTrapOID.0 = ospfTrap.2.16
 ospfGeneralGroup.1 = 172.16.2.2
 ospfIfEntry.1 = 0.0.0.0
 ospfIfEntry.2 = 2
 ospfIfEntry.12 = 7
000029: Jun 10 18:55:14.062 JST: SNMP: Queuing packet to 172.16.2.241
000030: Jun 10 18:55:14.062 JST: SNMP: V2 Trap, reqid 5, errstat 0, erridx 0
 sysUpTime.0 = 1993823
 snmpTrapOID.0 = ospfTrap.2.16
 ospfGeneralGroup.1 = 172.16.2.2
 ospfIfEntry.1 = 0.0.0.0
 ospfIfEntry.2 = 2
 ospfIfEntry.12 = 1
000031: Jun 10 18:55:14.250 JST: SNMP: Packet sent via UDP to 172.16.2.241
R2(config-if)#^Z
R2#
000032: Jun 10 18:55:14.482 JST: SNMP: Queuing packet to 172.16.2.241
000033: Jun 10 18:55:14.482 JST: SNMP: V2 Trap, reqid 6, errstat 0, erridx 0
 sysUpTime.0 = 1993865
 snmpTrapOID.0 = ospfTrap.2.12
 ospfGeneralGroup.1 = 172.16.2.2
 ospfLsdbEntry.1 = 0.0.0.0
 ospfLsdbEntry.2 = 1
 ospfLsdbEntry.3 = 172.16.2.2
 ospfLsdbEntry.4 = 172.16.2.2
000034: Jun 10 18:55:14.546 JST: SNMP: Packet sent via UDP to 172.16.2.241
000035: Jun 10 18:55:14.798 JST: SNMP: Packet sent via UDP to 172.16.2.241
R2#
000036: Jun 10 18:55:15.653 JST: %SYS-5-CONFIG_I: Configured from console by console
000037: Jun 10 18:55:15.981 JST: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
000038: Jun 10 18:55:16.981 JST: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
R2#
000039: Jun 10 18:55:16.981 JST: SNMP: Queuing packet to 172.16.2.241
000040: Jun 10 18:55:16.981 JST: SNMP: V2 Trap, reqid 7, errstat 0, erridx 0
 sysUpTime.0 = 1994115
 snmpTrapOID.0 = snmpTraps.3
 ifIndex.2 = 2
 ifDescr.2 = FastEthernet0/1
 ifType.2 = 6
 lifEntry.20.2 = administratively down
000041: Jun 10 18:55:17.233 JST: SNMP: Packet sent via UDP to 172.16.2.241
R2#unde
R2#undebug all
All possible debugging has been turned off
ASW1#sh interfaces status

Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        connected    1          a-full  a-100 10/100BaseTX
Fa0/2                        connected    1          a-full  a-100 10/100BaseTX
Fa0/3                        notconnect   1            auto   auto 10/100BaseTX
Fa0/4                        notconnect   1            auto   auto 10/100BaseTX
Fa0/5                        notconnect   1            auto   auto 10/100BaseTX
Fa0/6                        notconnect   1            auto   auto 10/100BaseTX
Fa0/7                        notconnect   1            auto   auto 10/100BaseTX
Fa0/8                        connected    1          a-full  a-100 10/100BaseTX
Gi0/1                        connected    1          a-full a-1000 10/100/1000BaseTX

References

tech/network/cisco/snmp/snmp.txt · Last modified: 2018/06/10 19:06 by wnoguchi