configuration of snmp traps and syslog

onfiguration 1 will
send both mac-notification and linkup and linkdown traps while configuration
2 will only send mac-notification traps?

*Configuration 1*
snmp-server enable traps mac-notification
snmp-server enable traps snmp linkup linkdown
snmp-server host 172.16.1.61 traps version 2c public

*Configuration 2*
snmp-server enable traps mac-notification
snmp-server enable traps snmp linkup linkdown
snmp-server host 172.16.1.61 traps version 2c public mac-notification snmp

this is a good one to play with the debug and let the router show you what it thinks about these settings, see below:

Router#sh debugging
SNMP:
SNMP packet debugging is on

Router#sh ip int br
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            172.16.1.1      YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down

Router#sh run | s snmp
snmp-server enable traps snmp linkdown linkup
snmp-server enable traps syslog
snmp-server host 172.16.1.61 version 2c PUBLIC

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/1
Router(config-if)#no shut
Router(config-if)#
*Mar  1 03:32:56.499: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 03:32:56.535: SNMP: Queuing packet to 172.16.1.61
*Mar  1 03:32:56.539: SNMP: V2 Trap, reqid 14, errstat 0, erridx 0
sysUpTime.0 = 1277653
snmpTrapOID.0 = ciscoSyslogMIB.2.0.1
clogHistoryEntry.2.12 = LINK
clogHistoryEntry.3.12 = 4
clogHistoryEntry.4.12 = UPDOWN
clogHistoryEntry.5.12 = Interface FastEthernet0/1, changed state to up
clogHistoryEntry.6.12 = 1277650
*Mar  1 03:32:57.499: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
*Mar  1 03:32:57.539: SNMP: Queuing packet to 172.16.1.61
*Mar  1 03:32:57.539: SNMP: V2 Trap, reqid 15, errstat 0, erridx 0
sysUpTime.0 = 1277753
snmpTrapOID.0 = ciscoSyslogMIB.2.0.1
clogHistoryEntry.2.13 = LINEPROTO
clogHistoryEntry.3.13 = 6
clogHistoryEntry.4.13 = UPDOWN
clogHistoryEntry.5.13 = Line protocol on Interface FastEthernet0/1, changed state to up
clogHistoryEntry.6.13 = 1277750
*Mar  1 03:32:57.563: SNMP: Queuing packet to 172.16.1.61
*Mar  1 03:32:57.563: SNMP: V2 Trap, reqid 16, errstat 0, erridx 0
sysUpTime.0 = 1277756
snmpTrapOID.0 = snmpTraps.4
ifIndex.2 = 2
ifDescr.2 = FastEthernet0/1
ifType.2 = 6
lifEntry.20.2 = up

THEN change the SNMP-SERVER settings, no more UPDOWN messages:

Router(config)#snmp-server host 172.16.1.61 version 2c PUBLIC config
Router(config)#do sh run | s snmp
snmp-server enable traps snmp linkdown linkup
snmp-server enable traps syslog
snmp-server host 172.16.1.61 version 2c PUBLIC  config

Router(config)#do sh ip int br
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            172.16.1.1      YES manual up                    up
FastEthernet0/1            unassigned      YES unset  up                    up
Router(config)#int f0/1
Router(config-if)#shut
Router(config-if)#
*Mar  1 03:34:38.363: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
*Mar  1 03:34:39.363: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
Router(config-if)#no shut
Router(config-if)#
*Mar  1 03:35:35.935: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 03:35:36.935: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

ANOTHER CHANGE and TEST with key WORD SYSLOG and syslog traps enabled:

Router#sh run | s snmp
snmp-server enable traps syslog
snmp-server host 172.16.1.61 version 2c PUBLIC  syslog
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#exit
Router#
*Mar  1 03:42:06.759: %SYS-5-CONFIG_I: Configured from console by console
*Mar  1 03:42:06.807: SNMP: Queuing packet to 172.16.1.61
*Mar  1 03:42:06.807: SNMP: V2 Trap, reqid 25, errstat 0, erridx 0
sysUpTime.0 = 1332679
snmpTrapOID.0 = ciscoSyslogMIB.2.0.1
clogHistoryEntry.2.21 = SYS
clogHistoryEntry.3.21 = 6
clogHistoryEntry.4.21 = CONFIG_I
clogHistoryEntry.5.21 = Configured from console by console
clogHistoryEntry.6.21 = 1332676
*Mar  1 03:42:07.059: SNMP: Packet sent via UDP to 172.16.1.61

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/1
Router(config-if)#shut
Router(config-if)#
*Mar  1 03:42:43.383: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
*Mar  1 03:42:43.427: SNMP: Queuing packet to 172.16.1.61
*Mar  1 03:42:43.427: SNMP: V2 Trap, reqid 26, errstat 0, erridx 0
sysUpTime.0 = 1336341
snmpTrapOID.0 = ciscoSyslogMIB.2.0.1
clogHistoryEntry.2.22 = LINK
clogHistoryEntry.3.22 = 6
clogHistoryEntry.4.22 = CHANGED
clogHistoryEntry.5.22 = Interface FastEthernet0/1, changed state to administratively down
clogHistoryEntry.6.22 = 1336338
*Mar  1 03:42:43.679: SNMP: Packet sent via UDP to 172.16.1.61
*Mar  1 03:42:44.383: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
*Mar  1 03:42:44.431: SNMP: Queuing packet to 172.16.1.61
*Mar  1 03:42:44.431: SNMP: V2 Trap, reqid 27, errstat 0, erridx 0
sysUpTime.0 = 1336442
snmpTrapOID.0 = ciscoSyslogMIB.2.0.1
clogHistoryEntry.2.23 = LINEPROTO
clogHistoryEntry.3.23 = 6
clogHistoryEntry.4.23 = UPDOWN
clogHistoryEntry.5.23 = Line protocol on Interface FastEthernet0/1, changed state to down
clogHistoryEntry.6.23 = 1336438
*Mar  1 03:42:44.683: SNMP: Packet sent via UDP to 172.16.1.61

sorry forget this one with the snmp-server enable traps syslog, a little different format, just the trap…

Router(config)#do sh run | s snmp
snmp-server enable traps snmp linkdown linkup

snmp-server host 172.16.1.61 version 2c PUBLIC
Router(config)#int f0/1
Router(config-if)#shut
Router(config-if)#no shut
Router(config-if)#

*Mar  1 03:55:43.923: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 03:55:44.923: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
*Mar  1 03:55:44.931: SNMP: Queuing packet to 172.16.1.61
*Mar  1 03:55:44.931: SNMP: V2 Trap, reqid 32, errstat 0, erridx 0
sysUpTime.0 = 1414492

snmpTrapOID.0 = snmpTraps.4
ifIndex.2 = 2
ifDescr.2 = FastEthernet0/1
ifType.2 = 6
lifEntry.20.2 = up

*Mar  1 03:55:45.183: SNMP: Packet sent via UDP to 172.16.1.61

Router(config-if)#
*Mar  1 03:56:54.403: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
*Mar  1 03:56:55.403: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
*Mar  1 03:56:55.411: SNMP: Queuing packet to 172.16.1.61
*Mar  1 03:56:55.411: SNMP: V2 Trap, reqid 33, errstat 0, erridx 0
sysUpTime.0 = 1421540
snmpTrapOID.0 = snmpTraps.3

ifIndex.2 = 2
ifDescr.2 = FastEthernet0/1
ifType.2 = 6

lifEntry.20.2 = administratively down
*Mar  1 03:56:55.663: SNMP: Packet sent via UDP to 172.16.1.61

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s