H3C S9500 Command Manual-Release2132[V2.03]-08 System Volume

HomeSupportSwitchesH3C S9500 Series SwitchesReference GuidesCommand ReferencesH3C S9500 Command Manual-Release2132[V2.03]-08 System Volume
09-SNMP Commands
Title Size Download
09-SNMP Commands 111.98 KB

Chapter 1  SNMP Configuration Commands

1.1  SNMP Configuration Commands

1.1.1  debugging snmp-agent

Syntax

debugging snmp-agent { header | packet | process | trap }

undo debugging snmp-agent { header | packet | process | trap }

View

User view

Default Level

2: System level

Parameters

header: Enables SNMP packet header debugging.

packet: Enables SNMP packet debugging.

process: Enables SNMP packet process debugging.

trap: Enables trap packet debugging.

Description

Use the debugging snmp-agent command to enable debugging for SNMP agent.

Use the undo debugging snmp-agent command to disable debugging for SNMP agent.

By default, debugging for SNMP agent is disabled.

Table 1-1 debugging snmp-agent header command output description

Field

Description

Incoming

SNMP packets received

SNMPversion packet

SNMP packets of a specific version (At present, three SNMP versions are available: v1, v2c, and v3)

community name: communityName

SNMPv1/v2c community name

security model: v3

SNMPv3 security model

security level: securityLevel

SNMPv3 security level, which falls into three types:

noAuthNoPriv: No authentication, no privacy

authNoPriv: Authentication without privacy

authPriv: Authentication with privacy

user name: userName

SNMPv3 username

snmpEngineID: engineID

SNMP engine ID

snmpEngineBoots: n

Number of reboot times of SNMP engine

snmpEngineTime: n

Running time of SNMP engine

 

Table 1-2 debugging snmp-agent packet command output description

Field

Description

PACKETS

Information contained in SNMP packets

PACKETS_SRC:Packet received from address via UDP

SNMP packets received through UDP from address. Address represents the source address of the SNMP packets.

PACKETS_DES: Packet sent to address via UDP

SNMP packets sent through UDP to address. Address represents the destination address of the SNMP packets.

PACKETS_BULK:

Information contained in the SNMP GetBulk Request

get request

SNMP Get packets (including request and response)

reqid: reqid

Request ID, SNMP request ID, used to match a request to a response.

errstat: errstat

Error State, SNMP packet error type

erridx: erridx

Error Index, SNMP packet error index, indicating the poison of a wrong variable in the list of the bound variables.

VBLIST

Variable List, variable list of the operation objects

set request

SNMP Set packet, including Set request and Set response

get-next request

SNMP GetNext packet, including GetNext request and GetNext response

get-bulk request

SNMP GetBulk packet, including GetBulk request and GetBulk response

nonrptr: nonrptr

Non Repeaters: Parameter of the GetBulk operation

Maxreps: maxreps

Max Repetitions: Parameter of the GetBulk operation

 

Table 1-3 debugging snmp-agent process command output description

Field

Description

PROCESS: object-name

Debugging information during SNMP processing. object-name is the object to be processed by SNMP.

operation: operation

SNMP operation type, such as Get, Set, and Get Next.

error type: errtype

Error type of an SNMP operation, such as toobig, no error and so on

 

Table 1-4 debugging snmp-agent trap command output description

Field

Description

TRAPversion:

SNMP trap messages of a specific SNMP version

trap-name trap<version> send to:address

A trap message was sent, where trap-name represents the name of the trap message, version represents the version (including v1 and v2) of the trap message, address represents the destination address of the trap message.

reqid: request ID

The reqid field is an invalid value and is always 0 in a trap message.

errorstate: errorState

The errorstate field is an invalid value and is always 0 in a trap message.

errorIndex: errorIindex

The errorIndex field is an invalid value and is always 0 in a trap message.

udp_port: port number

UDP port for the destination host to receive SNMP traps

send OK

SNMP Trap was successfully sent

VBLIST

Variable List, list of the variables bound with SNMP trap messages

 

Examples

# Enable debugging for SNMP agent packet header on a device enabled with SNMPv1/v2c/v3 and configured with related community names, and use MIB Browser to perform Get/Set operations.

<Sysname> debugging snmp-agent header

0.3557781 Sysname SNMP/7/V12HEADERS:

   Incoming SNMPv2c packet

   community name:public

// SNMP Agent received SNMPv2c Get packet headers with the community name public.

*0.3621250 Sysname SNMP/7/V12HEADERS:

   Incoming SNMPv2c packet

   community name:private

// SNMP Agent received SNMPv2c Set packet headers with the community name private.

*0.56365500 Sysname-Comware SNMP/7/V3HEADERS:

   Incoming SNMPv3 packet

   security model:v3

   security level:AuthNoPriv

   user name:John

   snmpEngineID:800063A203000056000000

   snmpEngineBoots:0   snmpEngineTime:0

// SNMP Agent received SNMPv3 Get/Set packet headers. The security model is v3, security level is authentication without privacy, username is John, SNMP engine ID is 800063A203000056000000, number of SNMP engine reboot times is 0 and SNMP engine running time is 0.

# Enable SNMP agent packet debugging on a device enabled with SNMPv1/v2c/v3 and configured with related community name, and use MIB Browser to perform Get operation.

<Sysname> debugging snmp-agent packet

*0.176281 Sysname SNMP/7/PACKETS_SRC:Packet received from 169.254.76.211 via UDP

*0.176281 Sysname SNMP/7/PACKETS:

   get request  

   reqid:77,errstat:0,erridx:0

*0.176281 Sysname SNMP/7/VBLIST:

   sysObjectID.0 =

// SNMP agent received UDP packets from 169.254.76.211. The operation type is Get request, request ID is 77, error state is 0, error index is 0, and the bound variable is sysObjectID.

*0.176281 Sysname SNMP/7/PACKETS:

   get request

   reqid:77,errstat:0,erridx:0

*0.176281 Sysname SNMP/7/VBLIST:

   sysObjectID.0 = 1.3.6.1.4.1.2011

*0.176281 Sysname SNMP/7/PACKETS_DES:Packet sent to 169.254.76.211 via UDP

// SNMP agent sent UDP packets to 169.254.76.211. The operation type is Get response, request ID is 77, error state is 0, error index is 0, and the bound variable is sysObjectID. The value retrieved in this Get operation is 1.3.6.1.4.1.2011.

# Enable SNMP agent packet processing debugging on a device enabled with SNMPv1/v2c/v3 and configured with related community name, and use MIB Browser to perform Get/Set operations.

<Sysname> debugging snmp-agent process

    *0.1317000 Sysname SNMP/7/PROCESS:sysDescr

     operation:get request   error type:no error

// SNMP agent received debugging information of the Get request. The operation type is Get request and the error type is no error.

# Enable SNMP Trap packet debugging on a device enabled with SNMPv1/v2c/v3 and configured with related community name.

<Sysname> debugging snmp-agent trap

*0.4065343 Sysname SNMP/7/TRAPV2:

   warmStart trap<v2> send to:169.254.76.211

   reqid:0

   errorstate:0

   errorIndex:0

   udp_port:162

   send OK

*0.4065343 Sysname SNMP/7/VBLIST:

   sysUpTime.0 = 406320

 

*0.4065343 Sysname SNMP/7/VBLIST:

   snmpTrapOID.0 = 1.3.6.1.6.3.1.1.5.2

// SNMP sent UDP packets to the host with the IP address 169.254.76.211. The packet is a warmStart Trap message. The ID of the request corresponding to the trap message is 0, error state is 0, error index is 0, and the UDP port of the destination host is 162. The trap message was successfully sent to the destination host. The values of the bound variables sysUpTime and snmpTrapOID are 406320 and 1.3.6.1.6.3.1.1.5.2.

1.1.2  display snmp-agent community

Syntax

display snmp-agent community [ read | write ]

View

Any view

Default Level

1: Monitor level

Parameters

read: Displays the information of communities with read-only access right.

write: Displays the information of communities with read and write access right.

Description

Use the display snmp-agent community command to display community information for SNMPv1 or SNMPv2c.

Examples

# Display the information for all the current communities.

<Sysname> display snmp-agent community

   Community name:aa

       Group name:aa

       Acl:2001

       Storage-type: nonVolatile

   Community name:bb

       Group name:bb

       Storage-type: nonVolatile     

Table 1-5 display snmp-agent community command output description

Field

Description

Community name

Community name

Group name

SNMP group name

Acl

The number of the ACL in use

Storage-type

Storage type, which could be:

l      volatile: Information will be lost if the system is rebooted

l      nonVolatile: Information will not be lost if the system is rebooted

l      permanent: Modification permitted, but deletion forbidden

l      readOnly: Read only, that is, no modification, no deletion

l      other: Other storage types

 

1.1.3  display snmp-agent group

Syntax

display snmp-agent group [ group-name ]

View

Any view

Default Level

1: Monitor level

Parameters

group-name: Specifies the SNMP group name, a string of 1 to 32 characters, case sensitive.

Description

Use the display snmp-agent group command to display information for the SNMP agent group, including group name, security model, MIB view, storage type, and so on. Absence of the group-name parameter indicates that information for all groups will be displayed.

Examples

# Display the information of all SNMP agent groups.

<Sysname> display snmp-agent group

   Group name: mygroup

       Security model: v1 noAuthnoPriv

       Readview: ViewDefault

       Writeview: <no specified>

       Notifyview:<no specified>

       Storage-type: nonVolatile

   Group name: managev3group

       Security model: v3 noAuthnoPriv

       Readview: ViewDefault

       Writeview: internet

       Notifyview :<no specified>

       Storage-type: nonVolatile 

Table 1-6 display snmp-agent group command output description

Field

Description

Group name

SNMP group name

Security model

Security model of the SNMP group, which can be: authPriv (authentication with privacy), authNoPriv (authentication without privacy), or noAuthNoPriv (no authentication no privacy).

Readview

The read only MIB view associated with the SNMP group

Writeview

The writable MIB view associated with the SNMP group

Notifyview

The notify MIB view associated with the SNMP group, the view with entries that can generate Trap messages

Storage-type

Storage type, which includes: volatile, nonVolatile, permanent, readOnly, and other. For detailed information, refer to Table 1-5.

 

1.1.4  display snmp-agent local-engineid

Syntax

display snmp-agent local-engineid

View

Any view

Default Level

1: Monitor level

Parameters

None

Description

Use the display snmp-agent local-engineid command to display the local SNMP agent engine ID.

SNMP engine ID uniquely identifies an SNMP entity within an SNMP domain. SNMP engine is an indispensable part of an SNMP entity. It provides SNMP message allocation, message handling, authentication, and access control.

Examples

# Display the local SNMP agent engine ID.

<Sysname> display snmp-agent local-engineid

SNMP local EngineID: 000063A27F00000100006822

1.1.5  display snmp-agent mib-view

Syntax

display snmp-agent mib-view [ exclude | include | viewname view-name ]

View

Any view

Default Level

1: Monitor level

Parameters

exclude: Specifies to display SNMP MIB views of the “excluded" type.

include: Specifies to display SNMP MIB views of the “included" type.

viewname view-name: Name of the specified MIB view.

Description

Use the display snmp-agent mib-view command to display SNMP MIB view information. Absence of the view-name parameter indicates that information for all MIB views will be displayed.

Examples

# Display the current SNMP MIB views.

<Sysname> display snmp-agent mib-view

   View name:ViewDefault

       MIB Subtree:iso

       Subtree mask:

       Storage-type: nonVolatile

       View Type:included

       View status:active

 

   View name:ViewDefault

       MIB Subtree:snmpUsmMIB

       Subtree mask:

       Storage-type: nonVolatile

       View Type:excluded

       View status:active

 

   View name:ViewDefault

       MIB Subtree:snmpVacmMIB

       Subtree mask:

       Storage-type: nonVolatile

       View Type:excluded

       View status:active

 

   View name:ViewDefault

       MIB Subtree:snmpModules.18

       Subtree mask:

       Storage-type: nonVolatile

       View Type:excluded

       View status:active

Table 1-7 display snmp-agent mib-view command output description

Field

Description

View name

MIB view name

MIB Subtree

MIB subtree

Subtree mask

MIB subtree mask

Storage-type

Storage type

View Type

View type, which can be “included” or “excluded”

Included indicates that all nodes of the MIB subtree are included in current view.

Excluded indicates that not all nodes of the MIB subtree are included in current view.

View status

The status of MIB view

 

1.1.6  display snmp-agent statistics

Syntax

display snmp-agent statistics

View

Any view

Default Level

1: Monitor level

Parameters

None

Description

Use the display snmp-agent statistics command to display SNMP statistics.

Examples

# Display the statistics on the current SNMP.

<Sysname> display snmp-agent statistics

  0 Messages delivered to the SNMP entity

  0 Messages which were for an unsupported version

  0 Messages which used a SNMP community name not known

  0 Messages which represented an illegal operation for the community supplied

  0 ASN.1 or BER errors in the process of decoding

  0 Messages passed from the SNMP entity

  0 SNMP PDUs which had badValue error-status

  0 SNMP PDUs which had genErr error-status

  0 SNMP PDUs which had noSuchName error-status

  0 SNMP PDUs which had tooBig error-status (Maximum packet size 1500)

  0 MIB objects retrieved successfully

  0 MIB objects altered successfully

  0 GetRequest-PDU accepted and processed

  0 GetNextRequest-PDU accepted and processed

  0 GetBulkRequest-PDU accepted and processed

  0 GetResponse-PDU accepted and processed

  0 SetRequest-PDU accepted and processed

  0 Trap PDUs accepted and processed

  0 Alternate Response Class PDUs dropped silently

  0 Forwarded Confirmed Class PDUs dropped silently

Table 1-8 display snmp-agent statistics command output description

Field

Description

Messages delivered to the SNMP entity

Number of packets delivered to the SNMP agent

Messages which were for an unsupported version

Number of packets from a device with an SNMP version that is not supported by the current SNMP agent

Messages which used a SNMP community name not known

Number of packets that use an unknown community name

Messages which represented an illegal operation for the community supplied

Number of packets with operations that breach the access right of a community

ASN.1 or BER errors in the process of decoding

Number of packets with ASN.1 or BER errors

Messages passed from the SNMP entity

Number of packets sent by an SNMP Agent

SNMP PDUs which had badValue error-status

Number of SNMP PDUs with a badValue error

SNMP PDUs which had genErr error-status

Number of SNMP PDUs with a genErr error

SNMP PDUs which had noSuchName error-status

Number of PDUs with a noSuchName error

SNMP PDUs which had tooBig error-status (Maximum packet size 1500)

 Number of PDUs with a tooBig error (the maximum packet size is 1,500 bytes)

MIB objects retrieved successfully

Number of MIB objects that have been successfully retrieved

MIB objects altered successfully

Number of MIB objects that have been successfully modified

GetRequest-PDU accepted and processed

Number of get requests that have been received and processed

GetNextRequest-PDU accepted and processed

Number of getNext requests that have been received and processed

GetBulkRequest-PDU accepted and processed

Number of getBulk requests that have been received and processed

GetResponse-PDU accepted and processed

Number of get responses that have been received and processed

SetRequest-PDU accepted and processed

Number of set requests that have been received and processed

Trap PDUs accepted and processed

Number of Trap messages that have been received and processed

Alternate Response Class PDUs dropped silently

Number of dropped response packets

Forwarded Confirmed Class PDUs dropped silently

Number of forwarded packets that have been dropped

 

1.1.7  display snmp-agent sys-info

Syntax

display snmp-agent sys-info [ contact | location | version ] *

View

Any view

Default Level

1: Monitor level

Parameters

contact: Displays the contact information of the current network administrator.

location: Displays the location information of the current device.

version: Displays the version of the current SNMP agent.

Description

Use the display snmp-agent sys-info command to display the current SNMP system information.

If no keyword is specified, all SNMP agent system information will be displayed.

Examples

# Display the current SNMP agent system information.

<Sysname> display snmp-agent sys-info

   The contact person for this managed node:

          Hangzhou H3C Technologies Co., Ltd.

   The physical location of this node:

           Hangzhou, China

   SNMP version running in the system:

           SNMPv3

1.1.8  display snmp-agent trap-list

Syntax

display snmp-agent trap-list

View

Any view

Default Level

1: Monitor level

Parameters

None

Description

Use the display snmp-agent trap-list command to display the modules that can send the Trap messages and whether their Trap sending is enabled or not. If a module comprises of multiple sub-modules, then as long as one sub-module has the sending of Trap messages enabled, the whole module will be displayed as being enabled with the Trap sending.

Related commands: snmp-agent trap enable.

Examples

# Display the modules that can send the Trap messages and whether their Trap sending is enabled or not.

<Sysname> display snmp-agent trap-list

 

   bgp trap enable

   configuration trap enable

   flash trap enable

   isdn trap enable

   mpls trap enable

   ospf trap enable

   standard trap enable

   system trap enable

   vrrp trap enable

 

   Enable traps: 8; Disable traps: 0

In the above output, enable indicates that the module is enabled with the Trap sending whereas disable indicates the Trap sending is disabled. By default, Trap sending is enabled on all modules that can send Trap messages. Use the snmp-agent trap enable command to manually configure whether the Trap sending is enabled or not.

1.1.9  display snmp-agent usm-user

Syntax

display snmp-agent usm-user [ engineid engineid | username user-name | group group-name ] *

View

Any view

Default Level

1: Monitor level

Parameters

engineid engineid: Displays SNMPv3 user information for a specified engine ID.

username user-name: Displays SNMPv3 user information for a specified user name. It is case sensitive.

group group-name: Displays SNMPv3 user information for a specified SNMP group name. It is case sensitive.

Description

Use the display snmp-agent usm-user command to display SNMPv3 user information.

Examples

 # Display SNMPv3 information for the user aa.

<Sysname> display snmp-agent usm-user username aa

   User name: aa

   Group name: mygroupv3

       Engine ID: 800007DB0000000000006877

       Storage-type: nonVolatile

       UserStatus: active

Table 1-9 display snmp-agent usm-user command output description

Field

Description

User name

SNMP user name

Group name

SNMP group name

Engine ID

Engine ID for an SNMP entity

Storage-type

Storage type

UserStatus

SNMP user status

 

1.1.10  enable snmp trap updown

Syntax

enable snmp trap updown

undo enable snmp trap updown

View

Interface view

Default Level

2: System level

Parameters

None

Description

Use the enable snmp trap updown command to enable the sending of Trap messages for interface state change (linkup/linkdown SNMP Trap messages).

Use the undo enable snmp trap updown command to disable the sending of linkup/linkdown SNMP Trap messages on an interface.

By default, the sending of linkup/linkdown SNMP Trap messages is enabled.

Note that:

To enable an interface to send SNMP Trap packets when its state changes, you need to enable the Link up/down Trap packet transmission function on an interface and globally. Use the enable snmp trap updown command to enable this function on an interface, and use the snmp-agent trap enable [ standard [ linkdown | linkup ] * ] command to enable this function globally.

Related commands: snmp-agent target-host, snmp-agent trap enable.

Examples

# Enable the sending of linkup/linkdown SNMP Trap messages on the port Ethernet 6/1/1 and use the community name public.

<Sysname> system-view

[Sysname] snmp-agent trap enable

[Sysname] snmp-agent target-host trap address udp-domain 10.1.1.1 params securityname public

[Sysname] interface ethernet 6/1/1

[Sysname-Ethernet6/1/1] enable snmp trap updown

1.1.11  snmp-agent

Syntax

snmp-agent

undo snmp-agent

View

System view

Default Level

3: Manage level

Parameters

None

Description

Use the snmp-agent command to enable SNMP agent.

Use the undo snmp-agent command to disable SNMP agent.

By default, SNMP agent is disabled.

Examples

# Disable the current SNMP agent.

<Sysname> system-view

[Sysname] undo snmp-agent

1.1.12  snmp-agent community

Syntax

snmp-agent community { read | write } community-name [ acl acl-number | mib-view view-name ] *

undo snmp-agent community community-name

View

System view

Default Level

3: Manage level

Parameters

read: Indicates that the community has read only access right to the MIB objects, that is, the community can only inquire MIB information.

write: Indicates that the community has read and write access right to the MIB objects, that is, the community can configure MIB information.

community-name: Community name, a string of 1 to 32 characters.

mib-view view-name: MIB view name, a string of 1 to 32 characters. If no keyword is specified, the default view is ViewDefault (The view created by the system after SNMP Agent is enabled).

acl acl-number: ACL for the community name, in the range 2,000 to 2,999.

Description

Use the snmp-agent community command to configure a new SNMP community. Default Level

2: System level

Parameters to be configured include access right, community name, ACL, and accessible MIB views.

Use the undo snmp-agent community command to delete a specified community.

The community name configured with this command is only valid for the SNMP v1 and v2c agent.

Examples

# Configure a community with the name of comaccess that has read-only access right.

<Sysname> system-view

[Sysname] snmp-agent community read comaccess

# Delete the community comaccess.

<Sysname> system-view

[Sysname] undo snmp-agent community comaccess

1.1.13  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

The following syntax applies to SNMPv3:

snmp-agent group v3 group-name [ authentication | privacy ] [ read-view read-view ] [ write-view write-view ] [ notify-view notify-view ] [ acl acl-number ]

undo snmp-agent group v3 group-name [ authentication | privacy ]

View

System view

Default Level

3: Manage level

Parameters

v1: SNMPv1.

v2c: SNMPv2c.

v3: SNMPv3.

group-name: Group name, a string of 1 to 32 characters.

authentication: Specifies the security model of the SNMP group to be authentication only (without privacy).

privacy: Specifies the security model of the SNMP group to be authentication and privacy.

read-view read-view: Read view, a string of 1 to 32 characters.

write-view write-view: Write view, a string of 1 to 32 characters.

notify-view notify-view: Notify view, for sending Trap messages, a string of 1 to 32 characters.

acl acl-number: Specifies an ACL by its number, in the range 2000 to 2999.

Description

Use the snmp-agent group command to configure a new SNMP group and specify its access right.

Use the undo snmp-agent group command to delete a specified SNMP group.

By default, SNMP groups configured by the snmp-agent group v3 command use a no-authentication-no-privacy security model.

Related commands: snmp-agent mib-view, snmp-agent usm-user.

Examples

# Create an SNMP group group1 on an SNMPv3 enabled device, no authentication, no privacy.

<Sysname> system-view

[Sysname] snmp-agent group v3 group1

1.1.14  snmp-agent local-engineid

Syntax

snmp-agent local-engineid engineid

undo snmp-agent local-engineid

View

System view

Default Level

3: Manage level

Parameters

engineid: Engine ID, an even number of hexadecimal characters, in the range 10 to 64. Its length must not be an odd number, and the all-zero and all-F strings are invalid.

Description

Use the snmp-agent local-engineid command to configure a local engine ID for an SNMP entity.

Use the undo snmp-agent local-engineid command to restore the default local engine ID.

By default, the engine ID of a device is the combination of company ID and device ID. Note that if the newly configured engine ID is not the same as the one used for creating the USM user, the user is invalid.

Related commands: snmp-agent usm-user.

Examples

# Configure the local engine ID to be 123456789A.

<Sysname> system-view

[Sysname] snmp-agent local-engineid 123456789A

1.1.15  snmp-agent mib-view

Syntax

snmp-agent mib-view { included | excluded } view-name oid-tree [ mask mask-value ]

undo snmp-agent mib-view view-name

View

System view

Default Level

3: Manage level

Parameters

included: Indicates that all nodes of the MIB tree are included in current view.

excluded: Indicates that not all nodes of the MIB tree are included in current view.

view-name: View name, a string of 1 to 32 characters.

oid-tree: MIB subtree. It can only be an OID string of 1 to 25 characters, such as 1.4.5.3.1, or an object name string, such as “system”. OID is made up of a series of integers, which marks the position of the node in the MIB tree and uniquely identifies a MIB object.

mask mask-value: Mask for an object tree, in the range 1 to 32 hexadecimal digits.

Description

Use the snmp-agent mib-view command to create or update MIB view information so that MIB objects can be specified.

Use the undo snmp-agent mib-view command to delete the current configuration.

By default, MIB view name is ViewDefault.

Related commands: snmp-agent group.

Examples

# Create a MIB view mibtest, which includes all objects of the subtree mib2.

<Sysname> system-view

[Sysname] snmp-agent mib-view included mib2 1.3.6.1

1.1.16  snmp-agent packet max-size

Syntax

snmp-agent packet max-size byte-count

undo snmp-agent packet max-size

View

System view

Default Level

3: Manage level

Parameters

byte-count: Maximum number of bytes of an SNMP packet that can be received or sent by an agent, in the range 484 to 17,940. The default value is 1,500 bytes.

Description

Use the snmp-agent packet max-size command to configure the maximum number of bytes in an SNMP packet that can be received or sent by an agent.

Use the undo snmp-agent packet max-size command to restore the default packet size.

Examples

# Configure the maximum number of bytes that can be received or sent by an SNMP agent to 1,042 bytes.

<Sysname> system-view

[Sysname] snmp-agent packet max-size 1042

1.1.17  snmp-agent sys-info

Syntax

snmp-agent sys-info { contact sys-contact | location sys-location | version { all | { v1 | v2c | v3 }* } }

undo snmp-agent sys-info { contact | location | version { all | { v1 | v2c | v3 }* } }

View

System view

Default Level

3: Manage level

Parameters

contact sys-contact: A string that describes the contact information for system maintenance.

location sys-location: A string that describes the location of the device.

version: The SNMP version in use.

l           v1: SNMPv1.

l           v2c: SNMPv2c.

l           v3: SNMPv3.

l           all: Specifies SNMPv1, SNMPv2c, and SNMPv3.

Description

Use the snmp-agent sys-info command to configure system information, including the contact information, the location, and the SNMP version in use.

Use the undo snmp-agent sys-info command to restore the default configuration.

By default, the location information is Hangzhou, China, version is <NONE>, and the contact is Hangzhou H3C Technologies Co., Ltd.

Related commands: display snmp-agent sys-info.

 

&  Note:

Network maintenance engineers can use the system contact information to get in touch with the manufacturer in case of network failures. The system location information is a management variable under the system branch as defined in RFC 1213-MIB, it identifies the location of the managed object.

 

Examples

# Configure the contact information as “Dial System Operator at beeper # 27345”.

<Sysname> system-view

[Sysname] snmp-agent sys-info contact Dial System Operator at beeper # 27345

1.1.18  snmp-agent target-host

Syntax

snmp-agent target-host trap address udp-domain { ip-address | ipv6 ipv6-address } [ udp-port port-number ] params securityname security-string [ v1 | v2c | v3 [ authentication | privacy ] ]

undo snmp-agent target-host { ip-address | ipv6 ipv6-address } securityname security-string

View

System view

Default Level

3: Manage level

Parameters

trap: Specifies the host to be the Trap host.

address: Specifies the IP address of the target host for the SNMP messages.

udp-domain: Indicates that the Trap message is transmitted using UDP.

ip-address: The IPv4 address of the Trap host.

ipv6: Specifies that the target host that receives Trap messages uses the IPv6 address.

ipv6-address: The IPv6 address of the Trap host.

port-number: Specifies the number of the port that receives Trap packets.

params securityname security-string: Specifies authentication related parameters, which is SNMPv1 or SNMPv2c community name or an SNMPv3 user name, a string of 1 to 32 characters.

v1: SNMPv1.

v2c: SNMPv2c.

v3: SNMPv3.

authentication: Specifies the security model to be authentication without privacy.

privacy: Specifies the security model to be authentication with privacy.

Description

Use the snmp-agent target-host command to configure the related settings for a Trap target host.

Use the undo snmp-agent target-host command to remove the current settings.

To enable the device to send Traps, you need to use the snmp-agent target-host command in combination with the snmp-agent trap enable and the enable snmp trap updown commands.

Related commands: enable snmp trap updown, snmp-agent trap enable, snmp-agent trap source, snmp-agent trap life.

Examples

# Enable the device to send SNMP Traps to 10.1.1.1, using the community name of “public”.

<Sysname> system-view

[Sysname] snmp-agent trap enable standard

[Sysname] snmp-agent target-host trap address udp-domain 10.1.1.1 params securityname public

1.1.19  snmp-agent trap enable

Syntax

snmp-agent trap enable [ bgp | configuration | flash | mpls | ospf [ process-id ] [ ospf-trap-list ] | standard [ authentication | coldstart | linkdown | linkup | warmstart ]* | system | vrrp [ authfailure | newmaster ] ]

undo snmp-agent trap enable [ bgp | configuration | flash | mpls | ospf [ process-id ] [ ospf-trap-list ] | standard [ authentication | coldstart | linkdown | linkup | warmstart ]* | system | vrrp [ authfailure | newmaster ] ]

View

System view

Default Level

3: Manage level

Parameters

bgp: Enables the sending of BGP Trap packets.

configuration: Enables the sending of configuration Trap packets.

flash: Enables the sending of FLASH Trap packets.

mpls: Enables the sending of LSP Trap packets.

ospf [ process-id ] [ ospf-trap-list ]: Enables the sending of OSPF Trap packets. The parameter process-id is the process ID and spf-trap-list is the Trap packet list.

standard: Enables the sending of standard Trap packets.

l           authentication: Enables the sending of authentication failure Trap packets in the event of authentication failure.

l           coldstart: Sends coldstart Trap packets when the device restarts.

l           linkdown: Sends linkdown Trap packets when the port is in a linkdown status. It should be configured globally.

l           linkup: Sends linkup Trap packets when the port is in a linkup status. It should be configured globally.

warmstart: Sends warmstart Trap packets when the SNMP restarts.

system: Sends H3C-SYS-MAN-MIB (a private MIB) Trap packets.

vrrp [ authfailure | newmaster ]: Sends VRRP Trap packets.

l           authfailure: Sends authentication failure VRRP Trap packets.

l           newmaster: Enables the sending of VRRP newmaster Trap packets when the device becomes the Master.

Description

Use the snmp-agent trap enable command to enable the device to send Trap messages globally.

Use the undo snmp-agent trap enable command to disable the device from sending Trap messages.

By default, the device is enabled to send Trap messages.

Note that:

To enable an interface to send SNMP Trap packets when its state changes, you need to enable the Link up/down Trap packet transmission function on an interface and globally. Use the enable snmp trap updown command to enable this function on an interface, and use the snmp-agent trap enable [ standard [ linkdown | linkup ] * ] command to enable this function globally.

Related commands: snmp-agent target-host, enable snmp trap updown.

Examples

# Enable the device to send SNMP authentication failure packets to 10.1.1.1, using the community name of “public”.

<Sysname> system-view

[Sysname] snmp-agent target-host trap address udp-domain 10.1.1.1 params securityname public

[Sysname] snmp-agent trap enable standard authentication

1.1.20  snmp-agent trap life

Syntax

snmp-agent trap life seconds

undo snmp-agent trap life

View

System view

Default Level

3: Manage level

Parameters

seconds: Time-out time, in the range 1 to 2,592,000 seconds.

Description

Use the snmp-agent trap life command to configure the life time for Traps, which will be discarded when their life time expires.

Use the undo snmp-agent trap life command to restore the default life time for Trap packets.

By default, the life time for SNMP Traps is 120 seconds.

Related commands: snmp-agent trap enable, snmp-agent target-host.

Examples

# Configure the life time for Trap packets as 60 seconds.

<Sysname> system-view

[Sysname] snmp-agent trap life 60

1.1.21  snmp-agent trap queue-size

Syntax

snmp-agent trap queue-size size

undo snmp-agent trap queue-size

View

System view

Default Level

3: Manage level

Parameters

size: The queue size for the Trap messages, in the range 1 to 1,000.

Description

Use the snmp-agent trap queue-size command to configure the size of the Trap queue.

Use the undo snmp-agent trap queue-size command to restore the default queue size.

By default, up to 100 Trap messages can be stored in the Trap queue.

Related commands: snmp-agent trap enable, snmp-agent target-host, snmp-agent trap life.

Examples

# Configure the size of the Trap queue to 200.

<Sysname> system-view

[Sysname] snmp-agent trap queue-size 200

1.1.22  snmp-agent trap source

Syntax

snmp-agent trap source { interface-type interface-number }

undo snmp-agent trap source

View

System view

Default Level

3: Manage level

Parameters

interface type interface-number: Interface type and interface number.

Description

Use the snmp-agent trap source command to specify the source IP address contained in the Trap message.

Use the undo snmp-agent trap source command to restore the default.

By default, SNMP chooses the IP address of an interface to be the source IP address of the Trap message.

Use this command to trace a specific event by the source IP address of a Trap message.

Note: Before you can configure the IP address of a particular interface as the source IP address of the Trap message, ensure that the interface already exists and that it has a legal IP address. Otherwise, it is likely that the configurations will either fail or be invalid.

Related commands: snmp-agent trap enable, snmp-agent target-host.

Examples

# Configure the IP address for the port Ethernet 1/1/1 as the source address for Trap packets.

<Sysname> system-view

[Sysname] snmp-agent trap source ethernet 1/1/1

1.1.23  snmp-agent usm-user

Syntax

The following syntax applies to SNMPv1 and SNMPv2c:

snmp-agent usm-user { v1 | v2c } user-name group-name [ acl acl-number ]

undo snmp-agent usm-user { v1 | v2c } user-name group-name

The following syntax applies to SNMPv3:

snmp-agent usm-user v3 user-name group-name [ authentication-mode { md5 | sha } auth-password  [ privacy-mode { des56 | aes128 } priv-password ] ] [ acl acl-number ]

undo snmp-agent usm-user v3 user-name group-name { local | engineid engineid-string }

View

System view

Default Level

3: Manage level

Parameters

v1: SNMPv1.

v2c: SNMPv2c.

v3: SNMPv3.

user-name: User name, a string of 1 to 32 characters. It is case sensitive.

group-name: Group name, a string of 1 to 32 characters. It is case sensitive.

authentication-mode: Specifies that the security mode is authentication.

md5: Specifies the authentication protocol to be HMAC-MD5-96.

sha: Specifies the authentication protocol to be HMAC-SHA-96.

auth-password: Authentication password, a string of 1 to 64 characters.

privacy: Specifies that the security mode is privacy.

des56: Specifies the privacy protocol to be data encryption standard (DES).

aes128: Specifies the privacy protocol to be advanced encryption standard (AES).

priv-password: The privacy password, a string of 1 to 64 characters.

acl-number: Basic ACL, in the range 2,000 to 2,999.

local: Represents a local SNMP entity user.

engineid-string: The engine ID string, an even number of hexadecimal characters, in the range 10 to 64. Its length must not be an odd number, and the all-zero and all-F strings are invalid.

Description

Use the snmp-agent usm-user command to add a user to an SNMP group.

Use the undo snmp-agent usm-user command to delete a user from an SNMP group.

Engine ID is used in authentication after you configure a user for a remote agent. If the engine ID is changed after a user is configured, the user corresponding to the original engine ID is invalid.

Note that the validity of a user depends on the engine ID of the SNMP agent. If the engine ID used for creating the user is not identical to the current engine ID, the user is invalid.

For SNMPv1 and SNMPv2c, this command means adding of a new SNMP group. For SNMPv3, this command adds a new user to an SNMP group.

Related commands: snmp-agent group, snmp-agent community, snmp-agent local-engineid.

Examples

# Add a user John to the SNMP group Johngroup. Configure the security mode as authentication, the authentication protocol as HMAC-MD5-96, and the authentication password as hello.

<Sysname> system-view

[Sysname] snmp-agent group v3 Johngroup

[Sysname] snmp-agent usm-user v3 John Johngroup authentication-mode md5 hello

# Specify SNMPv2c users to access the SNMP agent through reading v2cReadCommunity.

<Sysname> system-view

[Sysname] snmp-agent usm-user v2c v2cReadCommunity v2cGroup

[Sysname] snmp-agent group v2c v2cGroup read-view internet

[Sysname] snmp-agent mib-view included internet internet

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Intelligent Storage
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
  • Technical Blogs
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网