R3166-R3206-HP High-End Firewalls System Management and Maintenance Command Reference-6PW101

146
Related commands: snmp-agent mib-view.
Examples
# Create a community with the name of readaccess, allowing read-only access right using this
community name.
<Sysname> system-view
[Sysname] snmp-agent sys-info version v1 v2c
[Sysname] snmp-agent community read readaccess
Set the SNMP version on the NMS to SNMPv1 or SNMPv2c
Fill in the read-only community name readaccess
Establish a connection, and the NMS can perform read-only operations to the MIB objects in the
default view on the device
# Create a community with the name of writeaccess, allowing only the NMS with the IP address of 1.1.1.1
to configure the values of the agent MIB objects by using this community name; other NMSs are not
allowed to perform the write operations by using this community name.
<Sysname> system-view
[Sysname] acl number 2001
[Sysname-acl-basic-2001] rule permit source 1.1.1.1 0.0.0.0
[Sysname-acl-basic-2001] rule deny source any
[Sysname-acl-basic-2001] quit
[Sysname] snmp-agent sys-info version v2c
[Sysname] snmp-agent community write writeaccess acl 2001
Set the IP address of the NMS to 1.1.1.1
Set the SNMP version on the NMS to SNMPv2c
Fill in the write community name writeaccess; namely, the NMS can perform read-only operations
to the MIB objects in the default view on the device
# Create a community with the name of wr-sys-acc. The NMS can perform the read and write operations
to the MIB objects of the system subtree (with the OID of 1.3.6.1.2.1.1).
<Sysname> system-view
[Sysname] snmp-agent sys-info version v1 v2c
[Sysname] undo snmp-agent mib-view ViewDefault
[Sysname] snmp-agent mib-view included test system
[Sysname] snmp-agent community write wr-sys-acc mib-view test
Set the SNMP version on the NMS to SNMPv1 or SNMPv2c
Fill in the write community name wr-sys-acc
Establish a connection, and the NMS can perform read and write operations to the MIB objects in
system view on the device
snmp-agent group
Syntax
The following syntax applies to SNMPv1 and SNMP v2c:
snmp-agent group { v1 | v2c } group-name [ read-view read-view ] [ write-view write-view ]
[ notify-view notify-view ] [ acl acl-number ]
undo snmp-agent group { v1 | v2c } group-name