SmartNA-X 1G/10G Modular | Command Line Reference |
155
SmartNA-X
™
1G/10G User Guide 1.4
©
2015 Network Critical Solutions Limited
snmp create view
Use the
snmp create view
command to create a viewName.
A viewName is a mapping between SNMP objects and the access MIB rights (as reference by the OID range) that are
available to those objects. An object can have different access rights in each view (access rights are created with the
snmp
create access
command). Access rights indicate whether the object is accessible by either a community string or a user.
For example, if you create a viewName that excludes access to the OID root (.1) then users within such a group will have
zero read, write or notify access to the MIB.
Syntax
snmp create view
viewName
{
include
|
exclude
}
oid-string
[
mask
]
Parameters
•
viewName
Specify a viewName to create. The viewName must be alphanumeric, of length 1-32, and the first letter
must be a letter. viewNames are case sensitive (groupname and Groupname are not the same).
•
Include, Exclude
Choose whether the viewName is to include or exclude the specified OID range.
•
oid-string
Specify the OID string that applies to this view. The string must be specified in standard OID format, for
example,
.1.3.6.1.2.1.1
(this is the OID string of the system subtree).
•
mask
Specify which sub identifiers in the view OID to match against, as a series of hex octets separated by ‘.’ or
‘:’ (XX:XX:XX or XX.XX.XX...). If
mask
is not specified the system exactly matches the
oid-string
parameter, that
is, without a mask all bits are set.
The
mask
parameter can be used to define a view covering a particular row (or rows) in a table by matching against
the appropriate table index value but skipping the column sub-identifier. For more information, see http://www.net-
snmp.org/wiki/index.php/ Vacm#VACM_Masks.2C_or_How_to_restrict_access_to_a_particular_index_.28ro
w.29_in_a_Table.
Examples
• Create a viewName with access to the OID subtree starting from
.1
(the MIB root level). Users in such a group will
have read, write, or notify access to the entire MIB depending on the type of access set by the snmp create access
command for the group.
CONTROLLER>
snmp create
viewName
All include .1
CONTROLLER>
apply
• Create a viewName with excluded access to the OID subtree starting from
.1
(the MIB root lever). Effectively, any
user in this group will have zero read, write or notify access to the MIB.
CONTROLLER>
snmp create view
viewName
exclude .1
CONTROLLER>
apply
• Create a viewName with access to the OID subtree starting at
.1.3.6.1.4.1.31645
(Network Critical proprietary MIBs).
CONTROLLER>
snmp create view
viewName
include .1.3.6.1.4.1.31645
CONTROLLER>
apply
• Create a viewName that is excluded from the MIB subtree starting at
.iso.org.dod.mgmt
.
CONTROLLER>
snmp create view
viewName
exclude .iso.org.dod.mgmt
CONTROLLER>
apply
• Create a viewName with access to OID subtree
.1.3.6.1.2.1.2.2.1.0.4
with sub identifier 0xff:a0 in the view OID to
match against).
CONTROLLER>
snmp create view
viewName
include .1.3.6.1.2.1.2.2.1.0.4 0xff:a0
CONTROLLER>
apply
• In this example the first two commands define the same viewName covering the whole of the
.iso
subtree. The third
command ignores the sub-identifiers not covered by the mask: