RE: Specifying SNMP Traps

From: Jonathan Hays (nomad@gfoyle.org)
Date: Fri Apr 23 2004 - 09:36:44 GMT-3


Comments inline:

>-----Original Message-----
>From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On
>Behalf Of ccie2be
>Sent: Friday, April 23, 2004 7:12 AM
>To: Yasser Abdullah; 'Tim Last'; 'Group Study'
>Subject: Re: Specifying SNMP Traps
>
>
>Yasser,
>
>Thanks for getting back to me.
>
>I'm still a bit confused.
>
>What's the difference between a "Notification" and a "Trap"?
>
>Aren't they the different names for the same thing?

####
No, they are not the same thing. This link explains that "notification"
is a generic term that includes both 'traps' and 'inform requests', the
latter requiring an acknowledgement from the recipient.

http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122cgcr/
ffun_c/fcfprt3/fcf014.htm#1007320

>
>Also, does the type of trap have to be specified twice,
>
>once in the snmp-server host command and
>
>again, in the snmp-server enable trap command?

####
Yes. See additional comments below

>
>It's confusing because in the example below, both BGP and CONFIG were
>specified twice,
>
>but TTY was only specified once - in the snmp-server host command.
>
>Why is TTY only specified once but BGP and CONFIG is specified twice?
>
>It doesn't make sense to me.
>
>Thanks in advance, Tim

[snip]

= = =
Here's the link and excerpt again:

http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a
0080094a05.shtml#prereq

"The types of traps can be specified in both commands. You must use the
snmp-server host command to define the Network Management Systems where
traps are to be sent. You should specify the trap types if you don't
want all traps to be sent. Then use multiple snmp-server enable traps
commands, one for each of the trap types that you used in the snmp host
command.

Note: Not all [notification-type] options are supported on both of the
above commands. For example, [notification-type] x25 and teletype (tty)
are not used for snmp-server enable trap. x25 and tty traps are enabled
by default.

For example, to make a Cisco IOS Software device report only
configuration, Border Gateway Protocol (BGP), and tty traps to Network
Management System 10.10.10.10, use the following commands:

snmp-server host 10.10.10.10 public config bgp tty

snmp-server enable traps config

snmp-server enable traps bgp

" [end quotation]

A thorough reading of the supplied web link reveals the following.

The first command is to enable sending notifications to the host
10.10.10.10 of types 'config', 'BGP', and 'tty'. The link states

"If you do not enter an snmp-server host command, no notifications are
sent. In order to configure the router to send SNMP notifications, you
must enter at least one snmp-server host command. If you enter the
command with no keywords, all trap types are enabled for the host."

Further down on the page from the same link, a discussion of the
'snmp-server enable traps' command states:

"If you do not enter an snmp-server enable traps command, no
notifications controlled by this command are sent. In order to configure
the router to send these SNMP notifications, you must enter at least one
snmp-server enable traps command. If you enter the command with no
keywords, all notification types are enabled. If you enter the command
with a keyword, only the notification type related to that keyword is
enabled. In order to enable multiple types of notifications, you must
issue a separate snmp-server enable traps command for each notification
type and notification option."

So it is clear from the documentation that both commands are needed. As
you point out, the real question is why didn't the example have a fourth
command for 'tty' such as 'snmp-server enable traps tty'? I suspect it's
either a typo in the documentation or a default condition.

There's nothing like a bit of hands-on experimentation to solve this
minor conundrum. From the output below you can see that configuring
'snmp-server host' that the 'snmp-server enable traps tty' command is
configured automatically by IOS.

R2#sh run | include snmp
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#snmp-server host 10.10.10.10 public config bgp tty
R2(config)#end
R2#
*May 9 15:59:27.173: %SYS-5-CONFIG_I: Configured from console by
console
R2#sh run | include snmp
snmp-server enable traps tty
snmp-server host 10.10.10.10 public tty config bgp
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#snmp-server enable traps config
R2(config)#end
R2#
*May 9 16:00:48.829: %SYS-5-CONFIG_I: Configured from console by
console
R2#sh run | include snmp
snmp-server enable traps tty
snmp-server enable traps config
snmp-server host 10.10.10.10 public tty config bgp
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#snmp-server enable traps bgp
R2(config)#end
R2#
*May 9 16:01:10.405: %SYS-5-CONFIG_I: Configured from console by
console
R2#sh run | include snmp
snmp-server enable traps tty
snmp-server enable traps config
snmp-server enable traps bgp
snmp-server host 10.10.10.10 public tty config bgp
R2#

HTH,

Jonathan



This archive was generated by hypermail 2.1.4 : Mon May 03 2004 - 19:48:53 GMT-3