
62
NOTE:
Each
view-name oid-tree pair represents a view record. If you specify the same record with different MIB
subtree masks multiple times, the last configuration takes effect. Except the four subtrees in the default MIB
view, you can create up to 16 unique MIB view records.
Configuring basic SNMPv1 or SNMPv2c settings
Follow these steps to configure basic SNMPv1 or SNMPv2c settings:
To do…
Use the command…
Remarks
Enter system view
system-view
—
Enable the SNMP agent
snmp-agent
Optional
Disabled by default.
You can also enable the SNMP
agent service by using any
command that begins with
snmp-agent
except the
snmp-agent
calculate-password
and
snmp-agent ifmib long-ifindex
enable
commands.
Configure system information
for the SNMP agent
snmp-agent sys-info
{
contact
sys-contact
|
location
sys-location
|
version
{
all
|{
v1
|
v2c
|
v3
}*
} }
Required
By default, the contact is
Hangzhou
H3C Tech. Co.,Ltd.
, the physical
location is
Hangzhou, China
, and
the protocol version is
SNMPv3
.
Configure the local engine ID
snmp-agent local-engineid
engineid
Optional
The default local engine ID is the
company ID plus the device ID.
Create or update a MIB view
snmp-agent mib-view
{
excluded
|
included
}
view
-
name
oid
-
tree
[
mask
mask-value
]
Optional
By default, the MIB view
ViewDefault is predefined and its
OID is 1.
Configure SNMP access right
Approach 1: Create an SNMP
community
snmp-agent community
{
read
|
write
}
community
-
name
[
acl
acl-number
|
mib-view
view-name
]*
Approach 2: Create an SNMP group,
and add a user to the SNMP group
1.
snmp-agent group
{
v1
|
v2c
}
group-name
[
read-view
read-view
] [
write-view
write-view
]
[
notify-view
notify-view
] [
acl
acl-number
]
2.
snmp-agent usm-user
{
v1
|
v2c
}
user-name
group-name
[
acl
acl-number
]
Required
Use either approach.
By default, no SNMP group exists.
In approach 2, the username is
equivalent to the community name
in approach 1, and must be the
same as the community name
configured on the NMS.