SNMP Notification Logging

Systems that support Simple Network Management Protocol (SNMP) often need a mechanism for recording notification information as a hedge against lost notifications, whether those are traps or informs that exceed retransmission limits. The Notification Log MIB provides a common infrastructure for other MIBs in the form of a local logging function. The SNMP Notification Logging feature adds Cisco command line interface commands to change the size of the notification log, to set the global ageout value for the log, and to display logging summaries at the command line.

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/​go/​cfn. An account on Cisco.com is not required.

Information About SNMP Notification Logging

SNMP Notification Logging

Systems that support SNMP often need a mechanism for recording notification information. This mechanism protects against notifications being lost because they exceeded retransmission limits. The Notification Log MIB provides a common infrastructure for other MIBs in the form of a local logging function. The SNMP Notification Logging feature adds Cisco command line interface commands to change the size of the notification log, to set the global ageout value for the log, and to display logging summaries at the command line. The Notification Log MIB improves notification tracking and provides a central location for tracking all MIBs.

You can globally enable or disable authenticationFailure, linkUp, linkDown, warmStart, and coldStart traps or informs individually. (These traps constitute the “generic traps” defined in RFC 1157.) Note that linkUp and linkDown notifications are enabled by default on specific interfaces but will not be sent unless they are enabled globally.


Note


The Notification Log MIB supports notification logging on the default log only.


Benefits

Benefits of using SNMP notification logging are as follows:

  • Improves notification tracking.

  • Provides a central location for tracking all MIBs.

How to Configure SNMP Notification Logging

Configuring SNMP Notifications

To configure a device to send SNMP traps or informs, perform the tasks described in the following sections:


Note


Many snmp-server commands use the keyword traps in their command syntax. Unless there is an option within the command to specify either traps or informs, the keyword traps should be taken to mean traps, informs, or both. Use the snmp-server host command to specify whether you want SNMP notifications to be sent as traps or informs. To use informs, the SNMP manager (also known as the SNMP proxy manager) must be available and enabled on a device. Earlier, the SNMP manager was available only with Cisco IOS PLUS images. However, the SNMP manager is now available with all Cisco software releases that support SNMP. Use Cisco Feature Navigator for information about SNMP manager support for Cisco software releases. To access Cisco Feature Navigator, go to http:/​/​www.cisco.com/​go/​cfn.


Configuring the Device to Send SNMP Notifications

Perform this task to configure the device to send traps or informs to a host.

SUMMARY STEPS

    1.    enable

    2.    configure terminal

    3.    snmp-server engineID remote remote-ip-address remote-engineID

    4.    snmp-server user username groupname [remote host [udp-port port] {v1 | v2c | v3 [encrypted] [auth {md5 | sha} auth-password]} [access access-list]

    5.    snmp-server group groupname {v1 | v2c | v3 {auth | noauth | priv}} [read readview] [write writeview] [notify notifyview] [access access-list]

    6.    snmp-server host host [traps | informs] [version {1 | 2c | 3 [auth | noauth | priv]}] community-string [notification-type]

    7.    snmp-server enable traps [notification-type [notification-options]]

    8.    end


DETAILED STEPS
     Command or ActionPurpose
    Step 1 enable


    Example:
    Device> enable
     

    Enables privileged EXEC mode.

    • Enter your password if prompted.

     
    Step 2 configure terminal


    Example:
    Device# configure terminal
     

    Enters global configuration mode.

     
    Step 3snmp-server engineID remote remote-ip-address remote-engineID


    Example:
    Device(config)# snmp-server engineID remote 
    172.16.20.3 80000009030000B064EFE100
     

    Specifies the SNMP engine ID and configures the VRF name traps-vrf for SNMP communications with the remote device at 172.16.20.3.

     
    Step 4 snmp-server user username groupname [remote host [udp-port port] {v1 | v2c | v3 [encrypted] [auth {md5 | sha} auth-password]} [access access-list]


    Example:
    Device(config)# snmp-server user abcd public v3 encrypted auth md5 cisco123
     

    Configures a local or remote user to an SNMP group.

    Note   

    You cannot configure a remote user for an address without first configuring the engine ID for that remote host. This restriction is imposed in the design of these commands; if you try to configure the user before the host, you will receive a warning message and the command will not be executed. Use the snmp-server engineid remote command to specify the engine ID for a remote host.

     
    Step 5 snmp-server group groupname {v1 | v2c | v3 {auth | noauth | priv}} [read readview] [write writeview] [notify notifyview] [access access-list]


    Example:
    Device(config)# snmp-server group GROUP1 v2c auth read viewA write viewA notify viewB
     

    Configures an SNMP group.

     
    Step 6 snmp-server host host [traps | informs] [version {1 | 2c | 3 [auth | noauth | priv]}] community-string [notification-type]


    Example:
    Device(config)# snmp-server host example.com informs version 3 public
     

    Specifies whether you want the SNMP notifications sent as traps or informs, the version of SNMP to use, the security level of the notifications (for SNMPv3), and the recipient (host) of the notifications.

    • The snmp-server host command specifies which hosts will receive SNMP notifications, and whether you want the notifications sent as traps or informs.

     
    Step 7 snmp-server enable traps [notification-type [notification-options]]


    Example:
    Device(config)# snmp-server enable traps bgp
     

    Enables sending of traps or informs and specifies the type of notifications to be sent.

    • If a notification-type is not specified, all supported notification are enabled on the device.

    • To discover which notifications are available on your device, enter the snmp-server enable traps ? command.

    • The snmp-server enable traps command globally enables the production mechanism for the specified notification types (such as Border Gateway Protocol [BGP] traps, config traps, entity traps, Hot Standby Device Protocol [HSDP] traps, and so on).

     
    Step 8end

    Example:
    Device(config)# end
     

    Exits global configuration mode and returns to privileged EXEC mode.

     

    Changing Notification Operation Values

    You can specify a value other than the default for the source interface, message (packet) queue length for each host, or retransmission interval.

    Perform this task to change notification operation values as needed.

    SUMMARY STEPS

      1.    enable

      2.    configure terminal

      3.    snmp-server trap-source interface

      4.    snmp-server queue-length length

      5.    snmp-server trap-timeout seconds

      6.    snmp-server informs [retries retries] [timeout seconds] [pending pending]


    DETAILED STEPS
       Command or ActionPurpose
      Step 1 enable


      Example:
      Device> enable
       

      Enables privileged EXEC mode.

      • Enter your password if prompted.

       
      Step 2 configure terminal


      Example:
      Device# configure terminal
       

      Enters global configuration mode.

       
      Step 3 snmp-server trap-source interface


      Example:
      Device(config)# snmp-server trap-source FastEthernet 2/1
       

      Sets the IP address for the Fast Ethernet interface in slot2, port 1 as the source for all SNMP notifications.

       
      Step 4 snmp-server queue-length length


      Example:
      Device(config)# snmp-server queue-length 50
       

      Establishes the message queue length for each notification.

      • This example shows the queue length set to 50 entries.

       
      Step 5 snmp-server trap-timeout seconds


      Example:
      Device(config)# snmp-server trap-timeout 30
       

      Defines how often to resend notifications on the retransmission queue.

       
      Step 6 snmp-server informs [retries retries] [timeout seconds] [pending pending]


      Example:
      Device(config)# snmp-server informs retries 10 timeout 30 pending 100
       

      Configures inform-specific operation values.

      • This example sets the maximum number of times to resend an inform, the number of seconds to wait for an acknowledgment before resending, and the maximum number of informs waiting for acknowledgments at any one time.

       

      Controlling Individual RFC 1157 SNMP Traps

      Perform this task to enable the authenticationFailure, linkUp, linkDown, warmStart, and coldStart notification types.

      SUMMARY STEPS

        1.    enable

        2.    configure terminal

        3.    snmp-server enable traps snmp [authentication] [linkup] [linkdown] [warmstart] [coldstart]

        4.    interface type slot/port

        5.    no snmp-server link-status

        6.    end

        7.    end

        8.    show snmp mib ifmibtraps


      DETAILED STEPS
         Command or ActionPurpose
        Step 1 enable


        Example:
        Device> enable
         

        Enables privileged EXEC mode.

        • Enter your password if prompted.

         
        Step 2 configure terminal


        Example:
        Device# configure terminal
         

        Enters global configuration mode.

         
        Step 3 snmp-server enable traps snmp [authentication] [linkup] [linkdown] [warmstart] [coldstart]


        Example:
        Device(config)# snmp-server enable traps snmp 
         

        Enables RFC 1157 generic traps.

        • When used without any of the optional keywords, enables authenticationFailure, linkUp, linkDown, warmStart, and coldStart traps.

        • When used with keywords, enables only the trap types specified. For example, to globally enable only linkUp and linkDown SNMP traps or informs for all interfaces, use the snmp-server enable traps snmp linkup linkdown form of this command.

         
        Step 4 interface type slot/port


        Example:
        Device(config)# interface FastEthernet 0/0
         

        Enters interface configuration mode for a specific interface.

        Note   

        To enable SNMP traps for individual interfaces such as Dialer, use the snmp trap link-status permit duplicates command in interface configuration mode. For example, to enter dialer interface configuration mode, enter the interface type as dialer.

         
        Step 5 no snmp-server link-status


        Example:
        Device(config-if)# no snmp-server link-status 
         

        Disables the sending of linkUp and linkDown notifications for all generic interfaces.

         
        Step 6 end


        Example:
        Device(config-if)# end
         

        Exits interface configuration mode.

         
        Step 7 end


        Example:
        Device(config)# end
         

        Exits global configuration mode and returns to privileged EXEC mode.

         
        Step 8show snmp mib ifmibtraps


        Example:
        Device# show snmp mib ifmib traps
         
         
        Examples

        The following example shows the status of linkup and linkdown traps for all interfaces configured for the system:

        Device# show snmp mib ifmib traps
        
        ifDescr			ifindex		TrapStatus
        ---------------------------------
        FastEthernet		3/6 14		enabled
        FastEthernet		3/19 27		enabled
        GigabitEthernet		5/1 57		enabled
        unrouted VLAN		1005 73		disabled
        FastEthernet		3/4 12		enabled
        FastEthernet		3/39 47		enabled
        FastEthernet		3/28 36		enabled
        FastEthernet		3/48 56		enabled
        unrouted VLAN		1003 74		disabled
        FastEthernet		3/2 10		enabled
        Tunnel			0 66		enabled
        SPAN RP Interface		64		disabled
        Tunnel			10 67		enabled
        FastEthernet		3/44 52		enabled
        GigabitEthernet		1/3 3		enabled
        FastEthernet		3/11 19		enabled
        FastEthernet		3/46 54		enabled
        GigabitEthernet		1/1 1		enabled
        FastEthernet		3/13 21		enabled
        unrouted VLAN		1 70		disabled
        GigabitEthernet		1/4 4		enabled
        FastEthernet		3/9 17		enabled
        FastEthernet		3/16 24		enabled
        FastEthernet		3/43 51		enabled

        Configuring SNMP Notification Log Options

        Perform this task to configure SNMP notification log options. These options allow you to control the log size and timing values. The SNMP log can become very large and long, if left unmodified.

        SUMMARY STEPS

          1.    enable

          2.    configure terminal

          3.    snmp mib notification-log default

          4.    snmp mib notification-log globalageout seconds

          5.    snmp mib notification-log globalsize size

          6.    end

          7.    show snmp mib notification-log


        DETAILED STEPS
           Command or ActionPurpose
          Step 1 enable


          Example:
          Device> enable
           

          Enables privileged EXEC mode.

          • Enter your password if prompted.

           
          Step 2 configure terminal


          Example:
          Device# configure terminal
           

          Enters global configuration mode.

           
          Step 3 snmp mib notification-log default


          Example:
          Device(config)# snmp mib notification-log default 
           

          Creates an unnamed SNMP notification log.

           
          Step 4 snmp mib notification-log globalageout seconds


          Example:
          Device(config)# snmp mib notification-log globalageout 20
           

          Sets the maximum amount of time for which the SNMP notification log entries remain in the system memory.

          • In this example, the system is configured to delete entries in the SNMP notification log that were logged more than 20 minutes ago.

           
          Step 5 snmp mib notification-log globalsize size


          Example:
          Device(config)# snmp mib notification-log globalsize 600
           

          Sets the maximum number of entries that can be stored in all SNMP notification logs.

           
          Step 6 end


          Example:
          Device(config)# end
           

          Exits global configuration mode.

           
          Step 7 show snmp mib notification-log


          Example:
          Device# show snmp mib notification-log
           

          Displays information about the state of the local SNMP notification logging.

           
          Examples

          This example shows information about the state of local SNMP notification logging:

          Device# show snmp mib notification-log
           
          GlobalAgeout 20, GlobalEntryLimit 600
          Total Notifications logged in all logs 0
          Log Name"", Log entry Limit 600, Notifications logged 0
          Logging status enabled
          Created by cli

          Additional References

          Related Documents

          Related Topic

          Document Title

          Cisco IOS commands

          Cisco IOS Master Command List, All Releases

          SNMP commands: complete command syntax, command mode, command history, defaults, usage guidelines, and examples

          Cisco IOS SNMP Command Reference

          Cisco implementation of RFC 1724, RIP Version 2 MIB Extensions

          RIPv2 Monitoring with SNMP Using the RFC 1724 MIB Extensions feature module

          DSP Operational State Notifications for notifications to be generated when a digital signaling processor (DSP) is used

          DSP Operational State Notifications feature module

          Standards and RFCs

          Standard/RFC

          Title

          CBC-DES (DES-56) standard

          Symmetric Encryption Protocol

          STD: 58

          Structure of Management Information Version 2 (SMIv2)

          RFC 1067

          A Simple Network Management Protocol

          RFC 1091

          Telnet terminal-type option

          RFC 1098

          Simple Network Management Protocol (SNMP)

          RFC 1157

          Simple Network Management Protocol (SNMP)

          RFC 1213

          Management Information Base for Network Management of TCP/IP-based internets:MIB-II

          RFC 1215

          Convention for defining traps for use with the SNMP

          RFC 1901

          Introduction to Community-based SNMPv2

          RFC 1905

          Common Management Information Services and Protocol over TCP/IP (CMOT)

          RFC 1906

          Telnet X Display Location Option

          RFC 1908

          Simple Network Management Protocol (SNMP)

          RFC 2104

          HMAC: Keyed-Hashing for Message Authentication

          RFC 2206

          RSVP Management Information Base using SMIv2

          RFC 2213

          Integrated Services Management Information Base using SMIv2

          RFC 2214

          Integrated Services Management Information Base Guaranteed Service Extensions using SMIv2

          RFC 2271

          An Architecture for Describing SNMP Management Frameworks

          RFC 2570

          Introduction to Version 3 of the Internet-standard Network Management Framework

          RFC 2578

          Structure of Management Information Version 2 (SMIv2)

          RFC 2579

          Textual Conventions for SMIv2

          RFC 2580

          Conformance Statements for SMIv2

          RFC 2981

          Event MIB

          RFC 2982

          Distributed Management Expression MIB

          RFC 3413

          SNMPv3 Applications

          RFC 3415

          View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP)

          RFC 3418

          Management Information Base (MIB) for the Simple Network Management Protocol (SNMP)

          MIBs

          MIB

          MIBs Link

          • Circuit Interface Identification MIB

          • Cisco SNMPv2

          • Ethernet-like Interfaces MIB

          • Event MIB

          • Expression MIB Support for Delta, Wildcarding, and Aggregation

          • Interfaces Group MIB (IF-MIB)

          • Interfaces Group MIB Enhancements

          • MIB Enhancements for Universal Gateways and Access Servers

          • MSDP MIB

          • NTP MIB

          • Response Time Monitor MIB

          • Virtual Switch MIB

          To locate and download MIBs for selected platforms, releases, and feature sets, use Cisco MIB Locator found at the following URL:

          http:/​/​www.cisco.com/​go/​mibs

          Technical Assistance

          Description

          Link

          The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.

          http:/​/​www.cisco.com/​cisco/​web/​support/​index.html

          Feature Information for SNMP Notification Logging

          The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.

          Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to . An account on Cisco.com is not required.
          Table 1 Feature Information for SNMP Notification Logging

          Feature Name

          Releases

          Feature Information

          SNMP Notification Logging

          12.0(22)S

          12.2(13)T

          The SNMP Notification Logging feature adds Cisco command line interface commands to change the size of the notification log, set the global ageout value for the log, and display logging summaries at the command line.