The snmp-server commands enable SNMP on Management Ethernet interfaces by default. For information about how to enable SNMP server support on other inband interfaces, see the Implementing Management Plane Protection on Cisco IOS XR Software module in Cisco IOS XR System Security Configuration
Guide for the Cisco CRS Router.

Examples

index
persistence

To enable index
persistence on an Simple Network Management Protocol (SNMP) interface, use the
indexpersistence command in SNMP interface
configuration mode. To restore the default conditions with respect to this
command, use the
no form of
this command.

indexpersistence

noindexpersistence

Syntax Description

This command has no keywords or arguments.

Command Default

Index persistence is
disabled.

Command Modes

SNMP interface configuration

Command History

Release

Modification

Release 2.0

This command
was introduced.

Usage Guidelines

Use the
indexpersistence command to enable ifIndex persistence
for individual entries (corresponding to individual interfaces) in the ifIndex
table of the IF-MIB. IfIndex persistence retains the mapping between the ifName
object values and the ifIndex object values (generated from the IF-MIB) across
reboots, allowing for consistent identification of specific interfaces using
SNMP.

Task ID

Task ID

Operations

snmp

read,
write

Examples

The following
example shows how to assign ifIndex persistence on interface 0/0/1/0:

notification
linkupdown

To enable or disable
linkUp and linkDown trap notifications on a Simple Network Management Protocol
(SNMP) interface, use the
notificationlinkupdown command in SNMP interface configuration
mode. To revert to the default setting, use the
no form of
this command.

notificationlinkupdowndisable

nonotificationlinkupdowndisable

Syntax Description

disable

Disables
linkUp and linkDown trap notifications on an SNMP interface.

Syntax Description

This command has no keywords or arguments.

Command Default

By default, for all
main interfaces the linkUp and linkDown trap notifications are enabled; for all
subinterfaces they are disabled.

Command Modes

SNMP interface configuration

SNMP interface subset configuration

Command History

Release

Modification

Release 2.0

This command
was introduced.

Release 3.2

The
enable keyword was removed.

Release 3.9.0

This
command was supported in the SNMP interface subset configuration mode.

Usage Guidelines

Enabling of linkUp
and linkDown notifications is performed globally using the
snmp-server traps
snmp command. Issue the
notificationlinkupdown command to disable linkUp and linkDown
notifications on an interface.

Use the
no form of
this command to enable linkUp and linkDown notifications on an interface, if
linkUp and linkDown notifications have been disabled.

You can also use
the
snmp-server interface
subset command to enable or disable groups of interfaces.

Task ID

Task ID

Operations

snmp

read,
write

Examples

The following
example shows how to disable linkUp and linkDown trap notifications on
interface 0/0/1/0:

Syntax Description

Specifies the identifier of the interface subset. The subset-number argument is configured using the snmp-server interface subset command.

regular-expressionexpression

Specifies a subset of interfaces matching a regular expression, for which to display information.

type

(Optional) Interface type. For more information, use the question mark (?) online help function.

interface-path-id

(Optional) Physical interface or virtual interface.

Note

Use the show
interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (?) online help function.

Command Default

None

Command Modes

EXEC

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

Regular expressions have two constraints:

Regular expressions must always be entered within double quotes to ensure that the CLI interprets each character correctly.

All characters that are part of a regular expression are considered regular characters with no special meaning. In order to enter special characters, such as "\" or "?," they must be preceded by the backslash character "\." For example, to enter the regular expression ([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1, you would enter ([A-Z][A-Z0-9]*)\\b[^>]*>(.*\?)</\\1.

Refer to the Understanding Regular Expressions, Special Characters, and Patterns
module in Cisco IOS XR Getting Started Guide for the Cisco CRS Router for more information regarding regular expressions.

When using the subset or regular-expression keywords, the actual display might not match the configuration if there are higher priority subset-number values that actually apply to the interface. This can happen for a set of interfaces that are included in two or more configured regular expressions or where an individual interface configuration is enabled.

Task ID

Task ID

Operation

snmp

read

Examples

The following example illustrates how to display linkUp and linkDown notification status for a subset of interfaces identified by a specific subset-number:

RP/0/RP0/CPU0:router# show snmp interface notification subset 3

This example illustrates how to display linkUp and linkDown notification status for a subset of interfaces identified by a regular expression:

show snmp interface regular-expression

To display interface names and indices assigned to interfaces that match a regular expression, use the show snmp interface regular-expression command in EXEC mode.

show snmp interface regular-expressionexpression

Syntax Description

expression

Specifies a subset of interfaces matching a regular expression, for which to display information.

Command Default

None

Command Modes

EXEC

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

All characters that are part of a regular expression are considered regular characters with no special meaning. In order to enter special characters, such as "\" or "?," they must be preceded by the backslash character "\." For example, to enter the regular expression ([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1, you would enter ([A-Z][A-Z0-9]*)\\b[^>]*>(.*\?)</\\1.

Refer to the Understanding Regular Expressions, Special Characters, and Patterns
module in Cisco IOS XR Getting Started Guide for the Cisco CRS Router for more information regarding regular expressions.

Task ID

Task ID

Operation

snmp

read

Examples

This example illustrates how to display information for interfaces that match the given regular expression:

show snmp
mib

To display a list of
MIB module object identifiers (OIDs) registered on the system, use the
showsnmpmib command in

EXEC

mode.

showsnmpmib
[ object-name | dll ]

Syntax Description

object-name

(Optional)
Specific MIB object identifier or object name.

dll

(Optional)
Displays a list of all MIB DLL filenames and the OID supported by each DLL
filename on the system.

Command Default

None

Command Modes

EXEC

Command History

Release

Modification

Release 2.0

This command
was introduced.

Release 3.8.0

The
detailed keyword was not supported.

Usage Guidelines

Use the
showsnmpmib command to display a list of the MIB module
instance identifiers registered on the system.

Although the
showsnmpmib command can be used to display a list of MIB
OIDs registered on the system, the use of a Network Management System (NMS)
application is the recommended alternative for gathering this information.

The
showsnmpmib command is intended only for network managers
who are familiar with Abstract Syntax Notation One (ASN.1) syntax and the
Structure of Management Information (SMI) of Open Systems Interconnection (OSI)
Reference Model.

SNMP management
information is viewed as a collection of managed objects residing in a virtual
information store termed the
MIB.
Collections of related objects are defined in MIB modules. These modules are
written using a subset of ASN.1 termed the
SMI.

The definitions
for the OIDs displayed by this command can be found in the relevant RFCs and
MIB modules. For example, RFC 1907 defines the system.x, sysOREntry.x, snmp.x,
and snmpTrap.x OIDs, and this information is supplemented by the extensions
defined in the CISCO-SYSTEM-MIB.

Use the
detailed
keyword to display a list of the MIB module instance identifiers registered on
the system. The output displays additional details, such as DLL and
configuration information.

Use the
dll keyword
to display a list of the MIB modules loaded into the agent. This command can be
used to find the supported MIBs.

Note

This command
produces a high volume of output if SNMP is enabled on the system. To exit from
a --More-- prompt, press
Crtl-Z.

Task ID

Task ID

Operations

snmp

read

Examples

The following
example shows sample output from the
showsnmpmib command:

Examples

show snmp
users

To display
information about the configured characteristics of Simple Network Management
Protocol (SNMP) users, use the
showsnmpusers command in

EXEC

mode.

showsnmpusers

Syntax Description

This command has no keywords or arguments.

Command Default

None

Command Modes

EXEC

Command History

Release

Modification

Release 2.0

This command
was introduced.

Usage Guidelines

An SNMP user must
be part of an SNMP group, as configured using the
snmp-serveruser command.

Use the
showsnmpusers command to display information about all
configured users.

When configuring
SNMP, you may see the logging message “Configuring snmpv3 USM user.” USM stands
for the User-Based Security Model (USM) for SNMP Version 3 (SNMPv3). For
further information about USM, see RFC 3414,
User-based
Security Model (USM) for version 3 of the Simple Network Management Protocol
(SNMPv3).

Syntax Description

(Optional)
Specifies that the entered
community-string is clear text and should be
encrypted when displayed by the
show running
command.

encrypted

(Optional)
Specifies that the entered
community-string is encrypted text and should be
displayed as such by the
show running
command.

community-string

Community
string that acts like a password and permits access to the SNMP protocol. The
maximum length of the
community-string argument is 32 alphabetic
characters.

If the
clear keyword
was used,
community-string is assumed to be clear text. If
the
encrypted
keyword was used,
community-string is assumed to be encrypted. If
neither was used,
community-string is assumed to be clear text.

viewview-name

(Optional)
Specifies the name of a previously defined view. The view defines the objects
available to the community.

(Optional)
Specifies read-write access. Authorized management stations are able both to
retrieve and to modify MIB objects.

SDROwner

(Optional)
Limits access to the owner service domain router (SDR).

SystemOwner

(Optional)
Provides system-wide access including access to all
non-owner SDRs.

access-list-name

(Optional)
Name of an access list of IP addresses allowed to use the community string to
gain access to the SNMP agent.

Command Default

By default, an
SNMP community string permits read-only access to all MIB objects.

By default, a
community string is assigned to the SDR owner.

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This
command was introduced.

Release 3.3.0

The
optional keywords
LROwner and
SystemOwner were added.

Release 3.6.0

The
LROwner keyword was changed to
SDROwner.

The
clear and
encrypted keywords were added.

Usage Guidelines

Use the
snmp-server
community command to configure the community access string to
permit access to SNMP.

To remove the
specified community string, use the
no form of
this command.

Use the
clear keyword to specify that the clear text community string you
enter is displayed encrypted in the
showrunning command output. To enter an encrypted string, use the
encrypted keyword. To enter a clear text community string that is not
encrypted by the system, use neither of these keywords.

When the
snmp-server
community command is entered with the
SDROwner
keyword, SNMP access is granted only to the MIB object instances in the owner
SDR.

When the
snmp-server
community command is entered with the
SystemOwner
keyword, SNMP access is granted to
all SDRs in the
system.

Note

In a non-owner
SDR, a community name provides access only to the object instances that belong
to that SDR, regardless of the access privilege assigned to the community name.
Access to the owner SDR and system-wide access privileges are available only
from the owner SDR.

Task ID

Task ID

Operations

snmp

read,
write

Examples

This example shows
how to assign the string comaccess to SNMP, allowing read-only access, and to
specify that IP access list 4 can use the community string:

RP/0/RP0/CPU0:router(config)# snmp-server community comaccess ro 4

The following
example shows how to assign the string mgr to SNMP, allowing read-write access
to the objects in the restricted view:

Syntax Description

(Optional)
Specifies that the
community-string argument is clear text.

encrypted

(Optional)
Specifies that the
community-string
argument is encrypted text.

community-string

Name of the
community.

context
context-name

(Optional)
Name of the SNMP context to which this community name is to be mapped.

security-name
security-name

(Optional)
Security name for this community. By default, the
string is the
security name.

target-listtarget

(Optional)
Name of the target list for this community.

Command Default

The value of the
community-string argument is also the security
name.

Command Modes

Global configuration

Command History

Release

Modification

Release 3.3.0

This
command was introduced.

Usage Guidelines

Use the
snmp-servercommunity-map command to map an SNMPv1 or SNMPv2c
community name to one or more of the following:

context
name—Maps a community name to a specific SNMP context name. This allows MIB
instances in an SNMP context to be accessed through SNMPv1 or SNMPv2c using
this community name.

security
name—By default, the community name is used to authenticate SNMPv1 and
SNMPv2c. Configure a security name for a community name to override the default
and authenticate SNMP with the security name.

target—Target list identifies a list of valid hosts from
which SNMP access can be made using a specific security name. When such mapping
is done for a particular community name, SNMP access is allowed only from hosts
included in the target list.

Use the
clear keyword
to specify that the clear text community string you enter is displayed
encrypted in the
show running
command output. To enter an encrypted string, use the
encrypted
keyword. To enter a clear text community string that is not encrypted by the
system, use neither of these keywords.

Task ID

Task ID

Operations

snmp

read,
write

Examples

This example maps
the community name “sample 2” to the SNMP context name “sample1”:

snmp-server
context

To create a Simple
Network Management Protocol (SNMP) context, use the
snmp-servercontext command in

global configuration

mode. To remove an SNMP context, use the
no form of
this command.

snmp-servercontextcontext-name

nosnmp-servercontextcontext-name

Syntax Description

context-name

Name of the
SNMP context.

Command Default

None

Command Modes

Global configuration

Command History

Release

Modification

Release 3.3.0

This command
was introduced.

Usage Guidelines

This command creates
an SNMP context. By default, all the SNMP MIB instances are in a default
context. Create an SNMP context and map it to a particular feature to enable
similar instances of the same object to co-exist in different SNMP contexts.

Usage Guidelines

Assumed to
be every object belonging to the Internet (1.3.6.1) object identifier (OID)
space, unless the user uses the
read option to override this state.

writeview

Nothing is
defined for the write view (that is, the null OID). You must configure write
access.

notifyview

Nothing is
defined for the notify view (that is, the null OID). If a view is specified,
any notifications in that view that are generated are sent to all users
associated with the group (provided an SNMP server host configuration exists
for the user).

Configuring
Notify Views

Do not specify a
notify view when configuring an SNMP group for the following reasons:

The
snmp-serverhost command autogenerates a notify view for the user, and then
adds it to the group associated with that user.

Modifying the notify view
of the group affects all users associated with that group.

The notify view
option is available for two reasons:

If a group has a notify
view that is set using SNMP, you may need to change the notify view.

The
snmp-serverhost command may have been configured before the
snmp-servergroup command. In this case, reconfigure the
snmp-serverhost command or specify the appropriate notify
view.

Instead of
specifying the notify view for a group as part of the
snmp-servergroup command, use the following commands in
global configuration mode:

snmp-serveruser—Configures an SNMP user.

snmp-servergroup—Configures an SNMP group, without adding a
notify view.

snmp-serverhost—Autogenerates the notify view by specifying
the recipient of a trap operation.

Working with
Passwords and Digests

No default values
exist for authentication or privacy algorithms when this command is configured.
In addition, no default passwords exist. The minimum length for a password is
one character, although we recommend using eight characters for security. A
plain-text password or localized Message Digest 5 (MD5) password can be
specified. Forgotten passwords cannot be recovered, and the user must be
reconfigured.

SNMP
Contexts

SNMP contexts
provide Virtual Private Network (VPN) users with a secure way of accessing MIB
data. When a VPN is associated with a context, that VPN’s specific MIB data
exists in that context. Associating a VPN with a context enables service
providers to manage networks with multiple VPNs. Creating and associating a
context with a VPN enables a provider to prevent the users of one VPN from
accessing information about users of other VPNs on the same networking device.

Task ID

Task ID

Operations

snmp

read,
write

Examples

The following
example shows how to configure an SNMP version 3 group named group1 that
requires the authentication of packets with encryption:

syslog—Controls error message notifications
(Cisco-syslog-MIB). Specify the level of messages to be sent with the
logging history command.

Command Default

This command is
disabled by default. No notifications are sent.

The default UDP
port is 161.

When this command
is entered without keywords, the default is to send all trap types to the host.

If no version
keyword is entered, the default is version 1.

If version 3 is
specified, but the security level is not specified, the default security level
is noauth.

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This
command was introduced.

Release 4.1.0

The
informs
keyword was added.

Usage Guidelines

SNMP notifications
can be sent as traps. Traps are unreliable because the receiver does not send
acknowledgments when it receives traps. The sender cannot determine if the
traps were received. Traps are discarded as soon as they are sent. Traps are
also sent only once.

When the
snmp-server
host command is not entered, no notifications are sent. To
configure the device to send SNMP notifications, configure at least one
snmp-server
host command. When the command is entered without keywords, all
trap types are enabled for the host.

To enable multiple
hosts, issue a separate
snmp-server
host command for each host. You can specify multiple notification
types in the command for each host.

When multiple
snmp-server
host commands are given for the same host and kind of
notification (trap), each succeeding
snmp-server
host command overwrites the previous command. Only the last
snmp-server
host command is in effect. For example, if an
snmp-server
host command with the
traps keyword
is entered for a host and then another command with the
traps keyword
is entered for the same host, the second command replaces the first.

Either a host name
or IP address can be used to specify the host.

The
snmp-server
host command is used with the
snmp-serverengineid command. Use the
snmp-servertraps command to specify which SNMP notifications
are sent globally. For a host to receive most notifications, at least one
snmp-servertraps command and the
snmp-server
host command for that host must be enabled.

However, some
notification types cannot be controlled with the
snmp-servertraps command. For example, some notification
types are always enabled. Other notification types are enabled by a different
command.

The availability
of a notification-type depends on the device type and Cisco software features
supported on the device.

To display which
notification types are available on the system, use the question mark (?) online help function at the end of the
snmp-server
host command.

The
nosnmp-serverhost command used with no keywords disables traps.

Use the
clear keyword
to specify that the clear text community string you enter is displayed
encrypted in the
showrunning command output. To enter an encrypted
string, use the
encrypted
keyword. To enter a clear text community string that is not encrypted by the
system, use neither of these keywords.

If the
informs
keyword is used, the SNMP version can be only SNMPv2C or SNMPv3.

Task ID

Task ID

Operations

snmp

read,
write

Examples

This example shows
how to send RFC 1157 SNMP traps to the host specified by the name
myhost.cisco.com. Other traps are enabled, but only SNMP traps are sent because
only the
snmp keyword
is specified in the
snmp-serverhost command. The community string is defined as
comaccess.

snmp-server ifindex persist

To enable ifIndex persistence globally on all Simple Network Management Protocol (SNMP) interfaces, use the snmp-serverifindexpersist command in global configuration mode. To disable global interface persistence, use the no form of this command.

snmp-serverifindexpersist

nosnmp-serverifindexpersist

Syntax Description

This command has no keywords or arguments.

Command Default

Global interface persistence is disabled.

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This command was introduced.

Usage Guidelines

Use the snmp-serverifindexpersist command to enable ifIndex persistence on all interfaces that have entries in the ifIndex table of the IF-MIB. When enabled, this command retains the mapping between the ifName object values and the ifIndex object values (generated from the IF-MIB) persistent during reloads, allowing for consistent identification of specific interfaces using SNMP. Applications such as device inventory, billing, and fault detection depend on this feature.

Displays the interface index identification numbers (ifIndex values) for all the interfaces or a specified interface.

snmp-server ifmib ifalias long

To enable the ifAlias IF-MIB object to accept an interface alias name that exceeds the 64-byte default, use the snmp-serverifmibifaliaslong command. Use the no form of this command to revert to the default length.

snmp-serverifmibifaliaslong

nosnmp-serverifmibifaliaslong

Syntax Description

This command has no keywords or arguments.

Command Default

Global interface persistence is disabled.

The alias name is 64 bytes in length.

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This command was introduced.

Usage Guidelines

Use the snmp-serverifmibifaliaslong command to enable the IF-MIB object ifAlias to accept an interface alias name that is greater than 64 bytes in length. The default length for the alias name is 64 bytes.

snmp-server ifmib stats cache

To enable retrieval of cached statistics instead of real-time statistics, use the snmp-serverifmibstatscache command. To revert to the default, use the no form of this command.

snmp-serverifmibstatscache

nosnmp-serverifmibstatscache

Syntax Description

This command has no keywords or arguments.

Command Default

Cached statistics are not enabled.

Command Modes

Global configuration

Command History

Release

Modification

Release 3.3.2

This command was introduced.

Release 3.4.0

This command was not supported.

Release 3.5.0

This command was supported

Usage Guidelines

Cisco IOS XR statistics infrastructure maintains a cache of statistics for all interfaces. This cache is updated every 30 seconds. Use the snmp-serverifmibstatscache command to enable the IF-MIB to retrieve these cached statistics rather than real-time statistics. Accessing cached statistics is less CPU-intensive than accessing real-time statistics.

snmp-server inform

To configure Simple Network Management Protocol (SNMP) inform message options, use the snmp-serverinform command in global configuration mode. To revert to the default informs options, use the no form of this command.

snmp-server interface

To enable an interface to send Simple Network Management Protocol (SNMP) trap notifications and enter SNMP interface configuration mode, use the snmp-serverinterface command in global configuration mode. To disable the sending of SNMP trap notifications on an interface, use the no form of this command.

snmp-serverinterfacetypeinterface-path-id

nosnmp-serverinterfacetypeinterface-path-id

Syntax Description

type

Interface type. For more information, use the question mark (?) online help function.

interface-path-id

Physical interface or virtual interface.

Note

Use the showinterfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (?) online help function.

Command Default

Ethernet interfaces are enabled to send SNMP trap notifications. SNMP trap notifications are disabled on all other physical and logical interfaces.

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This command was introduced.

Release 3.2

The following keywords were removed:

ifindex

clear

persist

enable

trap

link-status

Usage Guidelines

The snmp-server interface command enters SNMP interface configuration mode for you to configure the available SNMP options.

Note

In
references to a Management Ethernet interface located on a route
processor card, the physical slot number is
alphanumeric (RP0 or RP1) and the module is CPU0.
Example: interface
MgmtEth0/RP1/CPU0/0.

Task ID

Task ID

Operations

snmp

read, write

Examples

This example shows how to assign ifIndex persistence on Packet-over-SONET/SDH (POS) interface 0/0/1/0:

snmp-server interface subset

To enter snmp-server interface subset configuration mode for a set of interfaces, use the snmp-server interface subset command in global configuration mode. To revert to the default interface settings, use the no form of this command.

snmp-server interface subsetsubset-numberregular-expressionexpression

no snmp-server interface subsetsubset-number

Syntax Description

subset-number

Identifying number of the interface subset, which also indicates its relative priority.

regular-expressionexpression

Specifies for which subset of interfaces to enter snmp-server interface subset configuration mode. The expression argument must be entered surrounded by double quotes.

Command Default

None

Command Modes

Global configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

The subset-number argument is used to set the priority for an interface that matches more than one configured regular expressions. Lower values of the subset-number have a higher priority. If a single interface becomes part of a multiple-interface configured regular expression, the configuration with the lower subset-number value is applied.

Regular expressions have two constraints:

Regular expressions must always be entered within double quotes to ensure that the CLI interprets each character correctly.

All characters that are part of a regular expression are considered regular characters with no special meaning. In order to enter special characters, such as "\" or "?," they must be preceded by the backslash character "\." For example, to enter the regular expression ([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1, you would enter ([A-Z][A-Z0-9]*)\\b[^>]*>(.*\?)</\\1.

Refer to the Understanding Regular Expressions, Special Characters, and Patterns
module in Cisco IOS XR Getting Started Guide for the Cisco CRS Router for more information regarding regular expressions.

From the snmp-server interface mode of a subset of interfaces, SNMP linkUp and linkDown notifications can be enabled or disabled using the notification linkupdown disable command.

Task ID

Task ID

Operation

snmp

read, write

Examples

This example illustrates how to configure all Gigabit Ethernet interfaces:

Displays interface names and indices assigned to interfaces that match a regular expression.

snmp-server ipv4 dscp

To mark packets with a specific differentiated services code point (DSCP) value, use the snmp-serveripv4dscp command in global configuration mode. To remove matching criteria, use the no form of this command.

snmp-serveripv4dscpvalue

nosnmp-serveripv4dscp [value]

Syntax Description

value

Value of the DSCP. The DSCP value can be a number from 0 to 63, or it can be one of the following keywords: default, ef, af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, cs1, cs2, cs3, cs4, cs5, cs6, cs7.

Command Default

The IP DSCP default value for SNMP traffic is 0.

Command Modes

Global configuration

Command History

Release

Modification

Release 3.6.0

This command was introduced.

Usage Guidelines

Use the snmp-server ipv4 dscp command to specify an IP DSCP value to give SNMP traffic higher or lower priority in your network.

Task ID

Task ID

Operations

snmp

read, write

Examples

This example shows how to configure the DSCP value to af32:

RP/0/RP0/CPU0:router(config)# snmp-server ipv4 dscp af32

snmp-server ipv4 precedence

To mark packets with a specific precedence level to use for packet matching, use the snmp-serveripv4precedence command in global configuration mode. To restore the system to its default interval values, use the no form of this command.

snmp-serveripv4precedencevalue

nosnmp-serveripv4precedence [value]

Syntax Description

value

Value of the precedence. The precedence value can be a number from 0 to 7, or it can be one of the following keywords:

critical

Set packets with critical precedence (5)

flash

Set packets with flash precedence (3)

flash-override

Set packets with flash override precedence (4)

immediate

Set packets with immediate precedence (2)

internet

Set packets with internetwork control precedence (6)

network

Set packets with network control precedence (7)

priority

Set packets with priority precedence (1)

routine

Set packets with routine precedence (0)

Command Default

The IP Precedence default value for SNMP traffic is 0.

Command Modes

Global configuration

Command History

Release

Modification

Release 3.6.0

This command was introduced.

Usage Guidelines

Use the snmp-serveripv4precedence command to specify an IP Precedence value to give SNMP traffic higher or lower priority in your network.

Task ID

Task ID

Operations

snmp

read, write

Examples

This example shows how to set the precedence to 2:

RP/0/RP0/CPU0:router(config)# snmp-server ipv4 precedence 2

snmp-server
location

To specify the
system location for Simple Network Management Protocol (SNMP), use the
snmp-serverlocation command in

global configuration

mode. To remove the location string, use the
no form of
this command.

snmp-serverlocationsystem-location

nosnmp-serverlocation

Syntax Description

system-location

String
indicating the physical location of this device. The maximum string length is
255 alphanumeric characters.

snmp-server mibs cbqosmib persist

To enable persistent storage of the CISCO-CLASS-BASED-QOS-MIB data across process restarts, switchovers, and device reloads, use the snmp-server mibs cbqosmib persist command in global configuration mode. To disable persistent storage of the MIB data, use the no form of this command.

snmp-servermibscbqosmibpersist

nosnmp-servermibscbqosmibpersist

Syntax Description

This command has no keywords or arguments.

Command Default

None

Command Modes

Global configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

Task ID

Task ID

Operation

snmp

read, write

Examples

This example illustrates how to enable persistent storage of CISCO-CLASS-BASED-QOS-MIB data:

snmp-server mibs eventmib packet-loss

To configure the generation of SNMP traps when packet loss exceeds configured thresholds, use the snmp-servermibseventmibpacket-loss command in global configuration mode. To restore the default values, use the no form of this command.

Syntax Description

Interface type. For more information, use the question mark (?) online help function.

interface-path-id

Physical interface or virtual interface.

Note

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (?) online help function.

fallinglower-threshold

Specifies the lower threshold for which to determine whether an mteTriggerFalling SNMP Trap is generated.

intervalsampling-interval

Specifies how often the packet loss statistics are polled. The interval argument, in minutes, can be between 5 and 1440; it must be a multiple of 5.

risingupper-threshold

Specifies the upper threshold for which to determine whether an mteTriggerRising SNMP Trap is generated.

Command Default

None

Command Modes

Global configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

Note

A maximum of 100 interfaces can be monitored for packet loss.

Packet loss configurations using the snmp-server mibs eventmib packet-loss command cannot be modified using SNMP SET and vice versa.

When the packet loss between two intervals increases above the upper-threshold argument, an mteTriggerRising SNMP trap is generated. This trap is not generated until the packet loss drops below the lower threshold and then rises above the upper threshold.

When the packet loss between two intervals falls below the lower-threshold argument, and an SNMP mteTriggerRising trap was generated previously, an SNMP mteTriggerFalling trap is generated. The mteTriggreRising trap is not generated until the packet loss goes above the upper threshold and then falls back below the lower threshold.

The lower-threshold value (falling) should be set to a value less than or equal to the upper-threshold value (rising).

The snmp-server mibs eventmib packet-loss command is configured on a specific interface and is supported on the following cards:

8-port 10 Gigabit Ethernet PLIM

16-port OC-48c/STM-16 POS/DPT PLIM

1-port OC-768c/STM-256 POS PLIM

4-port OC-192c/STM-64 POS/DPT PLIM

All Ethernet SPAs

2-port and 4-port OC-3c/STM-1 POS SPAs

2-port, 4-port, and 8-port OC-12c/STM-4 POS SPAs

2-port and 4-port OC-48c/STM-16 POS/RPR SPAs

1-port OC-192c/STM-64 POS/RPR SPA

Task ID

Task ID

Operations

snmp

read, write

Examples

This example shows how to configure the generation of SNMP traps in response to packet loss:

Associates an SNMP community with an SNMP context, security name, or a target-list.

snmp-server
packetsize

To establish control
over the largest Simple Network Management Protocol (SNMP) packet size
permitted when the SNMP server is receiving a request or generating a reply,
use the
snmp-serverpacketsize command in

global configuration

mode. To restore the default value, use the
no form of
this command.

snmp-serverpacketsizesize

nosnmp-serverpacketsize

Syntax Description

size

Packet size,
in bytes. Range is from 484 to 65500. The default is 1500.

Command Default

size: 1500

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This command
was introduced.

Usage Guidelines

Use the
snmp-serverpacketsize command to establish control over the
largest SNMP packet size permitted when the SNMP server is receiving a request
or generating a reply.

Task ID

Task ID

Operations

snmp

read,
write

Examples

This example shows
how to set the maximum size of SNMP packets to 1024 bytes:

RP/0/RP0/CPU0:router(config)# snmp-server packetsize 1024

snmp-server
queue-length

To establish the
message queue length for each trap host for Simple Network Management Protocol
(SNMP), use the
snmp-serverqueue-length command in

global configuration

mode. To restore the default value, use the
no form of
this command.

snmp-serverqueue-lengthlength

nosnmp-serverqueue-length

Syntax Description

length

Integer that
specifies the number of trap events that can be held before the queue must be
emptied. Range is from 1 to 5000.

Command Default

length: 100

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This command
was introduced.

Usage Guidelines

Use the
snmp-server
queue-length command to define the length of the message queue
for each trap host. After a trap message is successfully sent,
Cisco IOS XR software continues to empty the queue at a throttled rate to prevent trap
flooding.

Task ID

Task ID

Operations

snmp

read,
write

Examples

This example shows
how to set the SNMP notification queue to 20 events:

RP/0/RP0/CPU0:router(config)# snmp-server queue-length 20

snmp-server target
list

To create a Simple
Network Management Protocol (SNMP) target list, use the
snmp-servertargetlist command in

global configuration

mode. To remove an SNMP target list, use the
no form of
this command.

snmp-servertargetlisttarget-list
{ vrfvrf-name | hosthostname }

nosnmp-servertargetlisttarget-list

Syntax Description

target-list

Name of the
target list.

vrfvrf-name

Specifies
the name of the VRF hosts included in the target list.

hosthostname

Assigns a
hostname to the target list. The
hostname
variable is a name or IP address.

Command Default

None

Command Modes

Global configuration

Command History

Release

Modification

Release 3.3.0

This command
was introduced.

Usage Guidelines

Use this command
to create an SNMP target list and assign hosts to the list. When a target list
is mapped to a community name using the
snmp-servercommunity-map command, SNMP access is restricted
to the hosts in the target list (for that community name).

Task ID

Task ID

Operations

snmp

read,
write

Examples

In this example, a
new target list “sample3” is created and assigned to the vrf server “server2:”

Controls error message notifications (Cisco-syslog-MIB). Specify
the level of messages to be sent with the
logginghistory command.

system

Enables SNMP SYSTEMMIB-MIB traps.

vpls

Enables virtual private LAN service (VPLS) traps.

vrrp
events

Enables Virtual Router Redundancy Protocol (VRRP) traps.

Note

To
display the trap notifications supported on a platform, use the online help
(?) function.

Command Default

SNMP notifications
are disabled by default.

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This
command was introduced.

Release 3.2

The
enable keyword was removed from the command name.

Release 3.5.0

The
following traps were introduced:

flash

ipsec

l2vpn

mpls

Release 3.6.0

The RF-MIB
trap was introduced.

Release 3.8.0

The
bfd,
bridgemib, and
system keywords were introduced.

Release 3.9.0

The
ds1,
ds3,
otn,
, and
vrrpevents keywords were introduced.

Usage Guidelines

Use the
snmp-servertraps command to enable trap requests for the
specified notification types. To configure the router to send SNMP
notifications, specify at least one
snmp-servertraps command. When the command is entered with no
keyword, all notification types are enabled. When a notification type keyword
is specified, only the notification type related to that keyword is enabled. To
enable multiple types of notifications, issue a separate
snmp-servertraps command for each notification type.

snmp-server traps bgp

To enable Border Gateway Protocol (BGP) state-change Simple Network Management Protocol (SNMP) notifications, use the snmp-servertrapsbgp command in global configuration mode. To disable BGP state-change SNMP notifications, use the no form of this command.

snmp-servertrapsbgp

nosnmp-servertrapsbgp

Syntax Description

This command has no keywords or arguments.

Command Default

SNMP notifications are disabled by default.

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This command was introduced.

Release 3.2

The enable keyword was removed from the command name.

Usage Guidelines

SNMP notifications can be sent as traps.

Use the snmp-servertrapsbgp command to enable or disable BGP server state-change notifications, as defined in the BGP4-MIB (enterprise 1.3.6.1.2.1.15.7). The notifications types are:

snmp-server traps mpls l3vpn

To enable the sending of MPLS Layer 3 VPN Simple Network Management Protocol (SNMP) notifications, use the snmp-servertrapsmplsl3vpn command in global configuration mode. To disable MPLS Layer 3 VPN SNMP notifications, use the no form of this command.

snmp-server traps ospf errors

To enable Open Shortest Path First (OSPF) error Simple Network Management Protocol (SNMP) notifications, use the snmp-servertrapsospferrors command in global configuration mode. To disable OSPF error SNMP notifications, use the no form of this command.

snmp-server traps ospf lsa

To enable Open Shortest Path First (OSPF) link-state advertisement Simple Network Management Protocol (SNMP) notifications, use the snmp-servertrapsospflsa command in global configuration mode. To disable OSPF link state SNMP notifications, use the no form of this command.

snmp-server traps ospf retransmit

To enable Open Shortest Path First (OSPF) retransmission Simple Network Management Protocol (SNMP) notifications, use the snmp-servertrapsospfretransmit command in global configuration mode. To disable OSPF retransmission SNMP notifications, use the no form of this command.

snmp-server traps ospf state-change

To enable Simple Network Management Protocol (SNMP) notifications for Open Shortest Path First (OSPF) neighbor state change, use the snmp-servertrapsospfstate-change command in global configuration mode. To disable OSPF state-change SNMP notifications, use the no form of this command.

snmp-server traps pim interface-state-change

To enable Protocol Independent Multicast (PIM) interface status notification, use the snmp-servertrapspiminterface-state-change command in global configuration mode. To disable this command so no notification is sent, use the no form of this command.

Syntax Description

Command Default

Command Modes

Command History

Release

Modification

Release 3.3.2

This command was introduced.

Usage Guidelines

Use the snmp-serverhost command to specify which host or hosts receive SNMP notifications.

Use the snmp-servertrapspiminterface-state-change command to send notifications when a PIM interface changes status from up to down. When the status is up, the notification signifies the restoration of a PIM interface. When the status is down, the notification signifies the loss of a PIM interface.

snmp-server traps pim invalid-message-received

To enable notifications for monitoring invalid Protocol Independent Multicast (PIM) protocol operations, such as invalid register received and invalid join or prune received, use the snmp-servertrapspiminvalid-message-received command in global configuration mode. To disable this command so that no notification is sent, use the no form of this command.

Syntax Description

Syntax Description

Command Default

Command Modes

Command History

Release

Modification

Release 3.3.2

This command was introduced.

Usage Guidelines

Use the snmp-serverhost command to specify which host or hosts receive SNMP notifications.

A router can receive a join or prune message in which the RP specified in the packet is not the RP for the multicast group. Or a router can receive a register message from a multicast group in which it is not the RP.

snmp-server traps pim neighbor-change

To enable Protocol Independent Multicast (PIM) neighbor status down notifications, use the snmp-servertrapspimneighbor-change command in global configuration mode. To disable PIM neighbor down notifications, use the no form of this command.

Syntax Description

Command Default

Command Modes

Global configuration

Command History

Release

Modification

Release 3.2

This command was introduced.

Usage Guidelines

Use the snmp-servertrapspimneighbor-change command to send notifications when a PIM neighbor changes status from up to down on an interface. Use the snmp-serverhost command to specify which host or hosts receive SNMP notifications.

snmp-server traps pim rp-mapping-change

To enable notifications indicating a change in the rendezvous point (RP) mapping information due to either Auto-RP or bootstrap router (BSR) messages, use the snmp-servertrapspimrp-mapping-change command in global configuration mode. To disable this command so no notification is sent, use the no form of this command.

snmp-servertrapspimrp-mapping-change

nosnmp-servertrapspimrp-mapping-change

Syntax Description

This command has no keywords or arguments.

Command Default

PIM SNMP notifications are disabled by default.

Command Modes

Global configuration

Command History

Release

Modification

Release 3.3.2

This command was introduced.

Usage Guidelines

Use the snmp-serverhost command to specify which host or hosts receive SNMP notifications.

snmp-server traps rsvp

To enable the sending of Resource Reservation Protocol
(RSVP) notifications, use the snmp-servertrapsrsvp command in global configuration mode. To disable RSVP notifications, use the no form of this command.

snmp-servertrapsrsvp
{ all | lost-flow | new-flow }

Syntax Description

all

Enables the sending of both new flow lost flow traps.

lost-flow

Enables the sending of traps when a flow is deleted.

new-flow

Enables the sending of traps when a flow is created.

Command Default

None

Command Modes

Global configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

Task ID

Task ID

Operation

mpls-te

read, write

ouni

read, write

snmp

read, write

Examples

snmp-server traps
snmp

To enable the
sending of RFC 1157 Simple Network Management Protocol (SNMP) notifications,
use the
snmp-servertrapssnmp command in the appropriate configuration
mode. To disable RFC 1157 SNMP notifications, use the
no form of
this command.

Command Modes

Command History

The
authentication,
linkup,
linkdown,
coldstart,
and
warmstart
keywords were added.

Usage Guidelines

The
snmp-servertrapssnmp command is used with the
snmp-serverhost command. Use the
snmp-serverhost command to specify which host or hosts
receive SNMP notifications.

The optional
authentication keyword controls the sending of
SNMP authentication failure notifications. In order to send notifications, you
must configure at least one
snmp-server
host command. An authentication Failure (4) trap signifies that
the sending device is the addressee of a protocol message that is not properly
authenticated. The authentication method depends on the version of SNMP being
used. For SNMPv1 or SNMPv2c, authentication failure occurs for packets with an
incorrect community string. For SNMPv3, authentication failure occurs for
packets with an incorrect Secure Hash Algorithm (SHA) or Message Digest 5 (MD5)
authentication key or for a packet that is outside the window of the
authoritative SNMP engine.

The optional
linkup
keyword controls the sending of SNMP linkUp notifications. The linkUp(3) trap
signifies that the sending device recognizes one of the communication links
represented in the agent's configuration coming up.

The optional
linkdown
keyword controls the sending of SNMP linkDown notifications. The linkDown(2)
trap signifies that the sending device recognizes a failure in one of the
communication links represented in the agent's configuration.

The
snmp-server traps
snmp command with the
linkup or
linkdown
keywords globally enables or disables SNMP linkUp and linkDown traps. After
enabling either of these traps globally, you can enable or disable these traps
on specific interfaces using the
no notification linkupdown
disable command in interface configuration mode. According to RFC
2863, linkUp and linkDown traps are enabled for interfaces that do not operate
on top of any other interface (as defined in the ifStackTable), and are
disabled otherwise. This means that you do not have to enable linkUp and
linkdown notifications on such interfaces. However, linkUp and linkDown
notifications will not be sent unless you enable them globally using the
snmp-server traps
snmp command.

The optional
coldstart
keyword controls the sending of SNMP coldStart notifications. The coldStart(0)
trap signifies that the sending device is reinitializing itself such that the
agent's configuration or the protocol entity implementation may be altered.

The optional
warmstart
keyword controls the sending of SNMP coldStart notifications. The warmStart(1)
trap signifies that the sending device is reinitializing itself such that
neither the agent configuration nor the protocol entity implementation is
altered.

Task ID

Task ID

Operations

snmp

read,
write

Examples

This example shows
how to enable the device to send all traps to the host myhost.cisco.com using
the community string defined as public:

snmp-server traps
syslog

To enable Simple
Network Management Protocol (SNMP) notifications of Cisco-syslog-MIB error
messages, use the
snmp-servertrapssyslog command in the appropriate configuration
mode. To disable these types of notifications, use the
no form of
this command.

snmp-servertrapssyslog

nosnmp-servertrapssyslog

Syntax
Description

Syntax Description

This command has no keywords or arguments.

Command Default

SNMP notifications
are disabled by default.

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This command
was introduced.

Release 3.2

The
enable keyword was removed from the command name.

Usage Guidelines

The
snmp-servertrapssyslog command is used with the
snmp-serverhost command. Use the
snmp-serverhost command to specify which host or hosts
receive SNMP notifications.

Task ID

Task ID

Operations

snmp

read,
write

Examples

The following
example shows how to enable Cisco-syslog-MIB error message notifications to the
host at the address myhost.cisco.com, using the community string defined as
public:

snmp-server
trap-source

To specify the
interface (and hence the corresponding IP address) from which a Simple Network
Management Protocol (SNMP) trap should originate, use the
snmp-servertrap-source command in

global configuration

mode. To remove the source designation, use the
no form of
this command.

snmp-servertrap-sourcetypeinterface-path-id

nosnmp-servertrap-source

Syntax Description

type

Interface
type. For more information, use the question mark (?) online help function.

interface-path-id

Physical
interface or virtual interface.

Note

Use the
showinterfaces
command to see a list of all interfaces currently configured on the router.

For more
information about the syntax for the router, use the question mark (?) online help function.

Command Default

No interface is
specified.

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This command
was introduced.

Usage Guidelines

When an SNMP trap
is sent from a Cisco SNMP device, it has a notification address of the
interface it happened to exit at that time. Use the
snmp-server
trap-source command to monitor notifications from a particular
interface.

Note

In
references to a Management Ethernet interface located on a route
processor card, the physical slot number is
alphanumeric (RP0 or RP1) and the module is CPU0.
Example: interface
MgmtEth0/RP1/CPU0/0.

Task ID

Task ID

Operations

snmp

read,
write

Examples

The following
example shows how to specify that the IP address for interface 0/0/1/0 is the
source for all SNMP notifications:

snmp-server
trap-timeout

To define how often
to try resending trap messages on the retransmission queue, use the
snmp-servertrap-timeout command in

global configuration

mode. To restore the default value, use the
no form of
this command.

snmp-servertrap-timeoutseconds

nosnmp-servertrap-timeoutseconds

Syntax Description

seconds

Integer that
sets the interval for resending the messages, in seconds). Value can be from 1
to 1000.

Command Default

seconds: 30

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This command
was introduced.

Usage Guidelines

Before
Cisco IOS XR software tries to send a trap, it looks for a route to the destination
address. If there is no known route, the trap is saved in a retransmission
queue. Use the
snmp-servertrap-timeout command to determine the number of
seconds between retransmission attempts.

Task ID

Task ID

Operations

snmp

read,
write

Examples

The following
example shows how to set an interval of 20 seconds to try resending trap
messages on the retransmission queue:

Command Modes

Command History

The
0 and
7 keywords were replaced by the
clear and
encrypted keywords, respectively.

Release 3.3.0

Optional
keywords
LROwner and
SystemOwner were added.

Release 3.6.0

The
LROwner keyword was changed to the
SDROwner keyword.

Release 3.9.0

AES and
3DES encryption formats were supported.

Usage Guidelines

To use 3DES and
AES encryption standards, you must have installed the security package (k9sec).
For information on installing software packages, see
Upgrading and
Managing Cisco IOS XR Software in
Cisco IOS XR System Management
Configuration Guide for the Cisco CRS Router.

Table 7 snmp-server
user Default Descriptions

Characteristic

Default

passwords

Text
strings are assumed.

access
lists

Access
from all IP access lists is permitted.

SDR and
System-wide Access

When the
snmp-serveruser command is entered with the
SDROwner
keyword, SNMP access is granted only to the MIB object instances in the owner
SDR.

When the
snmp-serveruser command is entered with the
SystemOwner
keyword, SNMP access is granted to
all SDRs in the system
.

Note

In a non-owner
SDR, user access is provided only to the object instances in that SDR,
regardless of the access privilege assigned. Access to the owner SDR and
system-wide access privileges are available only from the owner SDR.

Task ID

Task ID

Operations

snmp

read,
write

Examples

The following
example shows how to enter a plain-text password for the string
abcd for
user2 in group2:

To learn if this
user has been added to the configuration, use the
showsnmpuser command.

If the localized
Message Digest 5 (MD5) or Secure Hash Algorithm (SHA) digest is known, specify
that string instead of the plain-text password. The digest should be formatted
as AA:BB:CC:DD where AA, BB, CC, and DD are hexadecimal values. The digest
should also be exactly 16 octets long.

This example shows
how to specify the command with a digest name of
00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:

Configures a new SNMP group, or a table that maps SNMP users to SNMP views.

snmp-server
view

To create or update
a Simple Network Management Protocol (SNMP) view entry, use the
snmp-serverview command in

global configuration

mode. To remove the specified server view entry, use the
no form of
this command.

snmp-serverviewview-nameoid-tree
{ excluded | included }

nosnmp-serverviewview-nameoid-tree
{ excluded | included }

Syntax Description

view-name

Label for
the view record being updated or created. The name is used to reference the
record.

oid-tree

Object
identifier (OID) of the ASN.1 subtree to be included or excluded from the view.
To identify the subtree, specify a text string consisting of numbers, such as
1.3.6.2.4, or a word, such as
system. Replace a single subidentifier with the asterisk (*)
wildcard to specify a subtree family; for example 1.3.*.4.

excluded

Excludes the
MIB family from the view.

included

Includes the
MIB family in the view.

Command Default

No view entry
exists.

Command Modes

Global configuration

Command History

Release

Modification

Release 2.0

This command
was introduced.

Usage Guidelines

Other SNMP
commands require a view as a keyword. Use the
snmp-serverview command to create a view to be used as
keywords for other commands that create records including a view.

Instead of
defining a view explicitly, you can rely on the following predefined views,
which are supported by the SNMP agent:

all

Predefined
view indicating that a user can see all objects.

CfgProt

Predefined
view indicating that a user can see all objects except the SNMPv3 configuration
tables.

vacmViewTreeFamilyEntry

Predefined
view indicating that a user can see the default configuration of
vacmViewTreeFamilyEntry.

The predefined
views supported on
Cisco IOS XR software, however, do not match the predefined views specified in RFC
3415.

Task ID

Task ID

Operations

snmp

read,
write

Examples

This example
creates a view that includes all objects in the MIB-II subtree:

Syntax Description

(Optional)
Specifies the name or IP address of the host (the targeted recipient).

clear

(Optional)
Specifies that the
community-string argument is clear text.

encrypted

(Optional)
Specifies that the
community-string argument is encrypted text.

traps

(Optional)
Specifies that notifications should be sent as traps. This is the default.

version {1 |
2c |
3}

(Optional)
Specifies the version of the SNMP used to send the traps. The default is
SNMPv1. When the
version keyword
is used, one of these keywords must be specified:

1—SNMPv1

2c—SNMPv2C

3—SNMPv3

security-level

(Optional)
Security level for SNMPv3. Options are:

auth—authNoPriv

noauth—noAuthNoPriv

priv—authPriv

community-string

Specifies
the community string for SNMPv1 and SNMPv2, or the SNMPv3 user.

udp-portport

(Optional)
Specifies the UDP port to which notifications should be sent.

contextcontext-name

(Optional)
Name of the context that must be mapped to VRF identified by value of the
vrf-name
argument.

Command Default

None

Command Modes

Global configuration

Command History

Release

Modification

Release 3.3.0

This
command was introduced.

Usage Guidelines

Use this command
to enter SNMP VRF configuration mode and configure an SNMP notification
recipient on a VRF. You can also map a VRF to an SNMP context.

SNMP notification
recipient that is reachable by way of a VRF can be configured. Notification is
forwarded to the recipient represented by its address using the routing table
instance identified by the VRF name.

The
address
argument can be either a host name or an IP address.

Use the
clear keyword
to specify that the clear text community string you enter is displayed
encrypted in the
showrunning command output. To enter an encrypted
string, use the
encrypted
keyword. To enter a clear text community string that is not encrypted by the
system, use neither of these keywords.

An SNMP context
identified by the value of the
context-name
argument can be mapped to a VRF in this mode. This context must be created
using
snmp-servercontext command.

Syntax Description

Sends a
cefcPowerStatusChange trap for the CISCO-ENTITY-FRU-CONTROL-MIB.

module
status-change{up |
down}

Sends a
cefcModuleStatusChange trap for the CISCO-ENTITY-FRU-CONTROL-MIB.

fan-tray oper-status up

Sends a
cefcFanTrayOperStatus trap for the CISCO-ENTITY-FRU-CONTROL-MIB.

sensor

Sends a
sensor trap.

threshold-notification

Sends a
entSensorThresholdNotification trap for the CISCO-ENTITY-SENSOR-MIB.

entity-indexindex

Specifies
the physical index for which to generate the trap.

Command Default

None

Command Modes

EXEC

Command History

Release

Modification

Release 3.9.1

This command
was introduced.

Usage Guidelines

The
snmp test
trap entity command tests the sending of Entity MIB traps. It is not
intended for testing scalability, performance, or high availability scenarios.
To use the
snmp test
trap command, SNMP must be configured on the router.

Task ID

Task ID

Operation

snmp

read

Examples

This example
illustrates how to use the
snmp test trap
entity command:

Command Default

None

Command Modes

EXEC

Command History

Release

Modification

Release 3.9.1

This
command was introduced.

Usage Guidelines

The
snmp test
trap infra command tests the sending of Infra MIB traps. It is not
intended for testing scalability, performance, or high availability scenarios.
To use this command, SNMP must be configured on the router.

Syntax Description

Command Default

None

Command Modes

EXEC

Command History

Release

Modification

Release 3.9.1

This command
was introduced.

Usage Guidelines

The
snmp test trap
interface command tests the sending of IF-MIB traps. It is not
intended for testing scalability, performance, or high availability scenarios.
To use this command, SNMP must be configured on the router.

Task ID

Task ID

Operation

snmp

read

Examples

This example
illustrates how to use the
snmp test trap
interface command:

RP/0/RP0/CPU0:router# snmp test trap interface link-down

snmp test trap
snmp

To send a test
Simple Network Management Protocol (SNMP) trap message to the trap receivers,
use the
snmp test trap
snmp command in

EXEC

mode.

snmp test trap snmp
{ cold-start | warm-start }

Syntax Description

cold-start

Sends a
coldStart trap for the SNMPv2-MIB.

warm-start

Sends a
warmStart trap for the SNMPv2-MIB.

Command Default

None

Command Modes

EXEC

Command History

Release

Modification

Release 3.9.1

This command
was introduced.

Usage Guidelines

The
snmp test trap
snmp command tests the sending of MIB traps. It is not intended
for testing scalability, performance, or high availability scenarios. To use
this command, SNMP must be configured on the router.

Task ID

Task ID

Operation

snmp

read

Examples

The following
example illustrates how to use the
snmp test trap
snmp command: