Table Of Contents
snmp-server manager session-timeout
SNMP Manager
Description
The SNMP Manager feature allows a router to serve as an SNMP manager. As an SNMP manager, the router can send SNMP requests to agents and receive SNMP responses and notifications from agents. When the SNMP manager process is enabled, the router can query other SNMP agents and process incoming SNMP traps.
Security Considerations
Most network security policies assume that routers will be accepting SNMP requests, sending SNMP responses, and sending SNMP notifications.
With the SNMP manager functionality enabled, the router may also be sending SNMP requests, receiving SNMP responses, and receiving SNMP notifications. Your security policy implementation may need to be updated prior to enabling this feature.
SNMP requests are typically sent to UDP port 161. SNMP responses are typically sent from UDP port 161. SNMP notifications are typically sent to UDP port 162.
SNMP Sessions
Sessions are created when the SNMP manager in the router sends SNMP requests, such as inform requests, to a host or receives SNMP notifications from a host. One session is created for each destination host. If there is no further communication between the router and host within the session timeout period, the session will be deleted.
The router tracks statistics, such as the average round-trip time required to reach the host, for each session. Using the statistics for a session, the SNMP manager in the router can set reasonable timeout periods for future requests, such as informs, for that host. If the session is deleted, all statistics are lost. If another session with the same host is later created, the request timeout value for replies will return to the default value.
Sessions consume memory. A reasonable session timeout value should be large enough that regularly used sessions are not prematurely deleted, yet small enough such that irregularly used, or one-shot sessions, are purged expeditiously.
Configuration Tasks
To configure the router to act as an SNMP manager, perform the tasks in the following sections:
Enable the SNMP Manager
To enable the SNMP manager process and optionally set the session timeout value, perform the following tasks in global configuration mode:
Task CommandEnable the SNMP Manager.
snmp-server manager
(Optional) Change the session timeout value.
snmp-server manager session-timeout seconds
Monitor the SNMP Manager
To monitor the SNMP manager process, perform the following tasks in EXEC mode:
Task CommandDisplay global SNMP information.
show snmp
Display information about current sessions.
show snmp sessions [brief]
Display information about current pending requests.
show snmp pending
Configuration Examples
The following example enables the SNMP manager and sets the session timeout to a larger value than the default:
snmp-server managersnmp-server manager session-timeout 1000Command Reference
This section documents new or modified commands. All other commands used with this feature are documented in the Cisco IOS Release 11.3 command references.
show snmp
To check the status of SNMP communications, use the show snmp EXEC command.
show snmp
Syntax Description
This command has no arguments or keywords.
Command Mode
EXEC
Usage Guidelines
This command first appeared in Cisco IOS Release 10.0.
This command provides counter information for SNMP operations. It also displays the chassis ID string defined with the snmp-server chassis-id command.
Sample Display
The following is sample output from the show snmp command:
Router# show snmpChassis: 0150619937 SNMP packets input0 Bad SNMP version errors4 Unknown community name0 Illegal operation for community name supplied0 Encoding errors24 Number of requested variables0 Number of altered variables0 Get-request PDUs28 Get-next PDUs0 Set-request PDUs78 SNMP packets output0 Too big errors (Maximum packet size 1500)0 No such name errors0 Bad values errors0 General errors24 Response PDUs13 Trap PDUsSNMP logging: enabledLogging to 171.69.58.33.162, 0/10, 13 sent, 0 dropped.SNMP Manager-role output packets4 Get-request PDUs4 Get-next PDUs6 Get-bulk PDUs4 Set-request PDUs23 Inform-request PDUs30 Timeouts0 DropsSNMP Manager-role input packets0 Inform response PDUs2 Trap PDUs7 Response PDUs1 Responses with errorsSNMP informs: enabledInforms in flight 0/25 (current/max)Logging to 171.69.217.141.1624 sent, 0 in-flight, 1 retries, 0 failed, 0 droppedLogging to 171.69.58.33.1620 sent, 0 in-flight, 0 retries, 0 failed, 0 droppeddescribes the fields shown in the display.
Related Commands
show snmp pending
show snmp sessions
snmp-server chassis-id
snmp-server manager
snmp-server manager session-timeout
snmp-server queue-lengthshow snmp pending
To display the current set of pending SNMP requests, use the show snmp pending EXEC command.
show snmp pending
Syntax Description
This command has no arguments or keywords.
Command Mode
EXEC
Usage Guidelines
This command first appeared in Cisco IOS Release 11.3 T.
After the SNMP manager sends a request, the request is "pending" until the manager receives a response or the request timeout expires.
Sample Display
The following is sample output from the show snmp pending command:
Router# show snmp pendingreq id: 47, dest: 171.69.58.33.161, V2C community: public, Expires in 5 secsreq id: 49, dest: 171.69.58.33.161, V2C community: public, Expires in 6 secsreq id: 51, dest: 171.69.58.33.161, V2C community: public, Expires in 6 secsreq id: 53, dest: 171.69.58.33.161, V2C community: public, Expires in 8 secsdescribes the fields shown in the display.
Related Commands
show snmp
show snmp sessions
snmp-server manager
snmp-server manager session-timeoutshow snmp sessions
To display the current SNMP sessions, use the show snmp sessions EXEC command.
show snmp sessions [brief]
Syntax Description
Command Mode
EXEC
Usage Guidelines
This command first appeared in Cisco IOS Release 11.3 T.
Sessions are created when the SNMP manager in the router sends SNMP requests, such as inform requests, to a host or receives SNMP notifications from a host. One session is created for each destination host. If there is no further communication between the router and host within the session timeout period, the corresponding session will be deleted.
Sample Display
The following is sample output from the show snmp sessions command:
Router# show snmp sessionsDestination: 171.69.58.33.162, V2C community: publicRound-trip-times: 0/0/0 (min/max/last)packets output0 Gets, 0 GetNexts, 0 GetBulks, 0 Sets, 4 Informs0 Timeouts, 0 Dropspackets input0 Traps, 0 Informs, 0 Responses (0 errors)Destination: 171.69.217.141.162, V2C community: public, Expires in 575 secsRound-trip-times: 1/1/1 (min/max/last)packets output0 Gets, 0 GetNexts, 0 GetBulks, 0 Sets, 4 Informs0 Timeouts, 0 Dropspackets input0 Traps, 0 Informs, 4 Responses (0 errors)The following is sample output from the show snmp sessions brief command:
Router# show snmp sessions briefDestination: 171.69.58.33.161, V2C community: public, Expires in 55 secsdescribes the fields shown in these displays.
Related Commands
show snmp
show snmp pending
snmp-server manager
snmp-server manager session-timeoutsnmp-server manager
To start the SNMP manager process, use the snmp-server manager global configuration command. The no form of this command stops the SNMP manager process.
snmp-server manager
no snmp-server managerSyntax Description
This command has no arguments or keywords.
Default
Disabled
Command Mode
Global configuration
Usage Guidelines
This command first appeared in Cisco IOS Release 11.3 T.
The SNMP manager process sends SNMP requests to agents and receives SNMP responses and notifications from agents. When the SNMP manager process is enabled, the router can query other SNMP agents and process incoming SNMP traps.
Most network security policies assume that routers will be accepting SNMP requests, sending SNMP responses, and sending SNMP notifications. With the SNMP manager functionality enabled, the router may also be sending SNMP requests, receiving SNMP responses, and receiving SNMP notifications. The security policy implementation may need to be updated prior to enabling this functionality.
SNMP requests are typically sent to UDP port 161. SNMP responses are typically sent from UDP port 161. SNMP notifications are typically sent to UDP port 162.
Example
The following example enables the SNMP manager process:
snmp-server managerRelated Commands
show snmp
show snmp pending
show snmp sessions
snmp-server manager session-timeoutsnmp-server manager session-timeout
To set the amount of time before a non-active session is destroyed, use the snmp-server manager session-timeout global configuration command. The no form of this command returns the value to its default.
snmp-server manager session-timeout seconds
no snmp-server manager session-timeoutSyntax Description
Default
Idle sessions time out after 600 seconds (10 minutes).
Command Mode
Global configuration
Usage Guidelines
This command first appeared in Cisco IOS Release 11.3 T.
Sessions are created when the SNMP manager in the router sends SNMP requests, such as inform requests, to a host or receives SNMP notifications from a host. One session is created for each destination host. If there is no further communication between the router and host within the session timeout period, the session will be deleted.
The router tracks statistics, such as the average round-trip time required to reach the host, for each session. Using the statistics for a session, the SNMP manager in the router can set reasonable timeout periods for future requests, such as informs, for that host. If the session is deleted, all statistics are lost. If another session with the same host is later created, the request timeout value for replies will return to the default value.
However, sessions consume memory. A reasonable session timeout value should be large enough such that regularly used sessions are not prematurely deleted, yet small enough such that irregularly used, or one-shot sessions, are purged expeditiously.
Example
The following example sets the session timeout to a larger value than the default:
snmp-server managersnmp-server manager session-timeout 1000Related Commands
show snmp pending
show snmp sessions
snmp-server managerDebug Commands
This section documents new or modified debug commands. All other debug commands used with this feature are documented in the Cisco IOS Release 11.3 Debug Command Reference.
debug snmp requests
To display information about every SNMP request made by the SNMP manager, use the debug snmp requests EXEC command. The no form of this command disables debugging output.
[no] debug snmp requests
Sample Display
shows sample output from the debug snmp requests command.
Figure 1 Sample Debug SNMP Requests Output
Router# debug snmp requestsSNMP Manager API: requestdest: 171.69.58.33.161, community: publicretries: 3, timeout: 30, mult: 2, use session rttuserdata: 0x0describes the fields shown in the display.
Related Command
debug snmp sessions
To display information when an SNMP session is created or destroyed, use the debug snmp sessions EXEC command. The no form of this command disables debugging output.
[no] debug snmp sessions
Sample Display
shows sample output from the debug snmp sessions command. The first line of output indicates that a session was created with the host at 171.69.58.33.161 using the community string public; the second line indicates that the session was destroyed.
Figure 2 Sample Debug SNMP Sessions Output
Router# debug snmp sessionscreating proxy session: dest=171.69.58.33.161, community=publicdestroying proxy session: dest=171.69.58.33.161, community=publicRelated Command