129
Step
Command
Remarks
12.
(Optional.) Assign a
user role to an
SNMPv3 user created
in RBAC mode.
snmp-agent
usm-user
v3
user-name
user-role
role-name
By default, an SNMPv3 user has
the user role assigned to it at its
creation.
13.
(Optional.) Create an
SNMP context.
snmp-agent context
context-name
By default, no SNMP contexts
exist
14.
(Optional.) Configure
the maximum SNMP
packet size (in bytes)
that the SNMP agent
can handle.
snmp-agent packet max-size
byte
-
count
By default, the maximum SNMP
packet size (in bytes) that the
SNMP agent can handle is 1500
bytes.
15.
(Optional.) Specify the
UDP port for receiving
SNMP packets.
snmp-agent
port port-num
By default, the device uses UDP
port 161 for receiving SNMP
packets.
16.
(Optional.) Configure
SNMP agent alive
notification sending
and set the sending
interval.
snmp-agent trap periodical-interval
interval
By default, sending SNMP agent
alive notifications is enabled and
the sending interval is 60 seconds.
Configuring SNMP logging
Enable SNMP logging only if necessary. SNMP logging is memory-intensive and might impact
device performance.
The SNMP agent logs Get requests, Set requests, Set responses, SNMP notifications, and SNMP
authentication failures, but does not log Get responses.
•
Get operation
—The agent logs the IP address of the NMS, name of the accessed node, and
node OID.
•
Set operation
—The agent logs the NMS' IP address, name of accessed node, node OID,
variable value, and error code and index for the Set operation.
•
Notification tracking
—The agent logs the SNMP notifications after sending them to the NMS.
•
SNMP authentication failure
—The agent logs related information when an NMS fails to be
authenticated by the agent.
The SNMP module sends these logs to the information center. You can configure the information
center to output these messages to certain destinations, such as the console and the log buffer. The
total output size for the node field (MIB node name) and the value field (value of the MIB node) in
each log entry is 1024 bytes. If this limit is exceeded, the information center truncates the data in the
fields. For more information about the information center, see "
Configuring the information center
To configure SNMP logging:
Step
Command
Remarks
1.
Enter system view.
system-view
N/A
2.
(Optional.) Enable SNMP
logging.
snmp-agent log
{
all
|
authfail
|
get-operation
|
set-operation
}
By default, SNMP logging is
disabled.
3.
(Optional.) Enable SNMP
notification logging.
snmp-agent
trap log
By default, SNMP notification
logging is disabled.