SNMP Server Commands
Use these M4500 CLI commands to configure SNMP system information, communities, engine ID, views, users, and groups, and display SNMP settings.
show snmp
This command displays SNMP community information and SNMP trap/inform receivers. Trap/Inform messages are sent across a network to an SNMP Network Manager. These messages alert the manager to events occurring within the switc
h or on the network.
You can add, change, or delete communities. The switch does not have to be reset for changes to take effect.
The SNMP agent of the switch complies with SNMP versions 1, 2c, and 3 (for more about the SNMP specification, see the SNMP RFCs). The SNMP agent sends traps through TCP/IP to an external SNMP manager based on the SNMP configuration (the trap receiver and other SNMP community parameters).
| Default | None |
| Format | show snmp |
| Mode | Privileged EXEC |
Display Message
| Parameter | Definition |
|---|---|
| Community-String | The community string to which this entry grants access. A valid entry is a case-sensitive alphanumeric string of up to 20 characters. Each row of this table must contain a unique community name. |
| Community-Access | The access level for this community string. |
| View Name | The view this community has access to. |
| IP Address | Access to this community is limited to this IP address. |
| Group Name | The community this mapping configures. |
| Target Address | An IP address (or portion thereof) from which this device will accept SNMP packets with the associated community. |
| Type | The type of message that will be sent, either traps or informs. |
| Community | The community traps will be sent to. |
| Version | The version of SNMP the trap will be sent as. |
| SNMP v1 | Uses SNMP v1 to send traps to the receiver. |
| SNMP v2 | Uses SNMP v2 to send traps to the receiver. |
| SNMP v3 | Uses SNMP v3 to send traps to the receiver. |
| UDP Port | The UDP port the trap or inform will be sent to. |
| Filter name | The filter the traps will be limited by for this host. |
| TO Sec | The number of seconds before informs will time out when sending to this host. |
| Retries | The number of times informs will be sent after timing out. |
| Username | The user this mapping configures. |
| Security Level | The authentication and encryption level for snmpv3. |
| NoAuth-N | No authentication checksum and no encryption algorithm assigned. |
| Auth-NoP | Md5 or sha authentication checksum assigned and no encryption algorithm assigned. |
| Auth-Pri | Md5 or sha authentication checksum and des encryption algorithm assigned. |
snmp-server sysname
This command sets the name of the switch. The range for name is from 1 to 64 alphanumeric characters.
| Default | None |
| Format | snmp-server sysname <name> |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <name> | Range is from 1 to 64 alphanumeric characters. |
snmp-server location
This command sets the physical location of the switch. The range for name is from 1 to 255 alphanumeric characters.
| Default | None |
| Format | snmp-server location <loc> |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <loc> | Range is from 1 to 255 alphanumeric characters. |
snmp-server contact
This command sets the name of the organization responsible for the network. The name can be from 1 to 255 alphanumeric characters.
| Default | None |
| Format | snmp-server contact <name> |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <name> | The name can be from 1 to 255 alphanumeric characters. |
snmp-server community
This command adds a new SNMP community, and optionally sets the access mode, allowed IP address, and creates a view for the community. The allowed IP address supports IPv4 and IPv6 address but does not support IP mask value to demote a range of IPv6 addresses.
| Default | None |
| Format | snmp-server community <community-string> [ipaddress <ipaddress> | ro | rw | su | view <viewname>] |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <Community-String> | A name associated with the switch and with a set of SNMP managers that manage it with a specified privileged level. The length of community-name can be up to 20 case-sensitive characters. |
| ipaddress | The associated community SNMP packet sending address and is used along with the client IP mask value to denote a range of IP addresses from which SNMP clients may use that community to access the device. A value of 0.0.0.0 allows access from any IP address. Otherwise, this value is ANDed with the mask to determine the range of allowed client IP addresses. |
| ro | rw | su | The access mode of the SNMP community, which can be public (Read-Only/RO), private (Read-Write/RW), or Super User (SU). |
| <viewname> | The name of the view to create or update. |
no snmp-server community <community-string>
This command deletes snmp community.
| Format | no snmp-server community <community-string> |
| Mode | Global Config |
snmp-server community-group
This command configures a community access string to permit access via the SNMPv1 and SNMPv2c protocols.
| Default | None |
| Format | snmp-server community-group <community-string> <group-name> [ipaddress <ip-address>] |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <community-string> | The community which is created and then associated with the group. The range is 1 to 20 characters. |
| <group-name> | The name of the group that the community is associated with. The range is 1 to 30 characters. |
| <ip-address> | Optionally, the IPv4 address that the community may be accessed from. |
no snmp-server community-group <community-string>
This command deletes snmp community group.
| Format | no snmp-server community-group <community-string> |
| Mode | Global Config |
show snmp engineid
This command displays the currently configured SNMP engineID.
| Default | None |
| Format | show snmp engineid |
| Mode | Privileged Exec |
Display Message
| Parameter | Definition |
|---|---|
| Local SNMP EngineID | The current configuration of the displayed SNMP engineID. |
Example: The following shows examples of the CLI display output for the commands.
(M4500-32C) (Config)#show snmp engineid
Local SNMP engineID : 80001c4c032c600c83ad47
snmp-server engineid
This command configures snmp engineID on the local device.
| Default | The engineID is configured automatically, based on the device MAC address. |
| Format | snmp-server engineid local {<engine-id> | default} |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <engine-id> | A hexadecimal string identifying the engine-id. Engine-id must be an even length in the range of 6 to 32 hexadecimal characters. |
| default | Sets the engine-id to the default string, based on the device MAC address. |
no snmp-server engineid
This command removes snmp engineID.
| Format | no snmp-server engineid local |
| Mode | Global Config |
show snmp filters
This command displays the configured filters used when sending traps.
| Default | None |
| Format | show snmp filters [<filter-name>] |
| Mode | Privileged Exec |
Display Message
| Parameter | Definition |
|---|---|
| Name | The filter name for this entry. |
| OID Tree | The OID tree this entry will include or exclude. |
| Type | Indicates if this entry includes or excludes the OID Tree. |
Example: The following shows examples of the CLI display output for the commands.
(M4500-32C) (Config)#show snmp filters
Name OID Tree Type
------------------------------ ------------------------------ ----------
test fastPathSwitching Included
snmp-server filter
This command creates a filter entry for use in limiting which traps will be sent to a host.
| Default | None |
| Format | snmp-server filter <filter-name> <oid-tree> [excluded | included] |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <filter-name> | The label for the filter being created. The range is 1 to 30 characters. |
| <oid-tree> | The OID subtree to include or exclude from the filter. Subtrees may be specified by numerical (1.3.6.2.4) or keywords (system), and asterisks may be used to specify a subtree family (1.3.*.4). |
| excluded | The tree is excluded from the filter. |
| included | The tree is included in the filter. |
no snmp-server filter <filter-name> [<oid-tree >]
This command removes the specified filter.
| Format | no snmp-server filter <filter-name> [<oid-tree >] |
| Mode | Global Config |
show snmp user
This command displays the currently configured SNMPv3 users.
| Default | None |
| Format | show snmp user [<username>] |
| Mode | Privileged Exec |
Display Message
| Parameter | Definition |
|---|---|
| Name | The name of the user. |
| Group Name | The group that defines the SNMPv3 access parameters. |
| Auth Method | The authentication algorithm configured for this user. |
| Privilege Method | The encryption algorithm configured for this user. |
| Remote Engine ID | The engineID for the user defined on the client machine. |
Example: The following shows examples of the CLI display output for the commands.
(M4500-32C) (Config)#show snmp user
Name Group Name Auth Priv
Meth Meth Remote Engine ID
----------------- ---------------------- ------- ------- --------------------------------
test DefaultRead MD5 DES 80001c4c032c600c83ad47
snmp-server user
This command creates an SNMPv3 user for access to the system.
| Default | None |
| Format | snmp-server user <name> <group-name> [remote <engine-idstring>] {[auth-md5 | auth-md5-key <md5-key> | auth-sha | auth-sha-key <sha-key>] [priv-des-key <des-key>]} |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <name> | The username the SNMPv3 user will connect to the switch as. The range is 1 to 30 characters. |
| <group-name> | The name of the group the user belongs to. The range is 1 to 30 characters. |
| <engineid-string> | The engine-id of the remote management station that this user will be connecting from. The range is 6 to 32 characters. |
| auth-md5 | The keyword to enable you to set the plain-text password for MD5 authentication. |
| auth-sha | The keyword to enable you to set the plain-text password for SHA authentication. |
| <md5-key> | A pregenerated MD5 authentication key. The length is 32 characters. |
| <sha-key> | A pregenerated SHA authentication key. The length is 48 characters. |
| <priv-des-key> | A pregenerated DES encryption key. The length is 32 characters. |
no snmp-server user
This command removes the specified SNMPv3 user.
| Format | no snmp-server user <name> [remote <engine-idstring>] |
| Mode | Global Config |
show snmp group
This command displays the configured groups.
| Default | None |
| Format | show snmp group [<groupname>] |
| Mode | Privileged Exec |
Display Message
| Parameter | Definition |
|---|---|
| Name | The name of the group. |
| Security Model | Indicates which protocol can access the system via this group. |
| Security Level | Indicates the security level allowed for this group. |
| Read View | The view this group provides read access to. |
| Write View | The view this group provides write access to. |
| Notify View | The view this group provides trap access to. |
Example: The following shows examples of the CLI display output for the commands.
(M4500-48XF8C) #show snmp group
Name Context Security Views
Prefix Model Level Read Write Notify
--------------------- ---------- ----- ------------- -------- -------- --------
DefaultRead "" V1 NoAuth-NoPriv Default "" Default
DefaultRead "" V2 NoAuth-NoPriv Default "" Default
DefaultRead "" V3 NoAuth-NoPriv Default "" Default
DefaultRead "" V3 Auth-NoPriv Default "" Default
DefaultRead "" V3 Auth-Priv Default "" Default
DefaultSuper "" V1 NoAuth-NoPriv DefaultS DefaultS DefaultS
uper uper uper
DefaultSuper "" V2 NoAuth-NoPriv DefaultS DefaultS DefaultS
uper uper uper
DefaultSuper "" V3 NoAuth-NoPriv DefaultS DefaultS DefaultS
uper uper uper
DefaultWrite "" V1 NoAuth-NoPriv Default Default Default
DefaultWrite "" V2 NoAuth-NoPriv Default Default Default
DefaultWrite "" V3 NoAuth-NoPriv Default Default Default
DefaultWrite "" V3 Auth-NoPriv Default Default Default
DefaultWrite "" V3 Auth-Priv Default Default Default
snmp-server group
This command creates an SNMP access group.
| Default | Generic groups are created for all versions and privileges using the default views. |
| Format | snmp-server group <group-name> [v1 | v2 | v3 {auth | priv}] {[read <readview>] | [write <writeview>] | [context <contextprefix>] | [notify <notifyview>]} |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <group-name> | The group name to be used when configuring communities or users. The range is 1 to 30 characters. |
| v1 | This group can only access via SNMPv1. |
| v2 | This group can only access via SNMPv2c. |
| v3 | This group can only access via SNMPv3. |
| <readview> | The view this group will use during GET requests. The range is 1 to 30 characters. |
| <writeview> | The view this group will use during SET requests. The range is 1 to 30 characters. |
| <notifyview> | The view this group will use when sending out traps. The range is 1 to 30 characters. |
no snmp-server group
This command removes the specified group.
| Format | no snmp-server group <group-name> [v1 | v2 | v3 {auth | noauth | priv}] { [context <contextprefix>] | [notify <notifyview>]} |
| Mode | Global Config |
show snmp views
This command displays the currently configured views.
| Default | None |
| Format | show snmp views [<viewname>] |
| Mode | Privileged Exec |
Display Message
| Parameter | Definition |
|---|---|
| Name | The view name for this entry. |
| OID Tree | The OID tree that this entry will include or exclude. |
| Type | Indicates if this entry includes or excludes the OID tree. |
Example: The following shows examples of the CLI display output for the commands.
(M4500-32C) (Config)#show snmp views
Name OID Tree Type
------------------------- ------------------------------- ------------
Default iso Included
Default snmpVacmMIB Excluded
Default usmUser Excluded
Default snmpCommunityTable Excluded
DefaultSuper iso Included
snmp-server view
This command creates or modifies an existing view entry that is used by groups to determine which objects can be accessed by a community or user.
| Default | Views are created by default to provide access to the default groups. |
| Format | snmp-server view <view-name> <oid-tree> [excluded | included] |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| <view-name> | The label for the view being created. The range is 1 to 30 characters. |
| <oid-tree> | The OID subtree to include or exclude from the filter. Subtrees may be specified by numerical (1.3.6.2.4) or keywords (system), and asterisks may be used to specify a subtree family (1.3.*.4). |
| excluded | The tree is excluded from the view. |
| included | The tree is included in the view. |
no snmp-server view
This command removes the specified view.
| Format | no snmp-server view <view-name> [<oid-tree>] |
| Mode | Global Config |