snmp-agent target-host (system view)

Function

The snmp-agent target-host inform command configures a target host for receiving Inform messages.

The undo snmp-agent target-host command deletes a target host configured to receive Inform messages.

By default, the target host is not set.

Format

snmp-agent target-host host-name host-name inform address udp-domain ip-address [ [ udp-port udp-portid ] | [ vpn-instance vpn-instance-name ] ] * params securityname { cipher-name { v2c | v3 [ authentication | privacy ] } | cipher cipher-name v2c } [ [ notify-filter-profile cipher-name ] ]

Parameters

Parameter Description Value
host-name

Specify the character string of target host name.

The value is a string of 1 to 32 case-sensitive characters, spaces not supported.

host-name

Specify the SNMP target host name.

-

address ip-address

Specify the transport address to be used in the generation of SNMP messages.

The value is in dotted decimal notation.

udp-port udp-portid

Set port to receive traps/notifications for this target host.

The value is an integer ranging from 0 to 65535. The default value is 162.

vpn-instance vpn-instance-name

Specify?the?VPN-Instance?name?of?target?host.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

On a VPN network, use the VPN instance specified using vpn-instance, IP address, and security name together to identify a target host.

inform

Specify the target to be inform host.

-

udp-domain

Specify transport domain over UDP for the target host.

-

params

Specify SNMP target information to be used in the generation of SNMP messages.

-

securityname cipher-name

Specify the name for the principal on whose behalf SNMP messages will be generated.

The value is a string of 1 to 32 case-sensitive characters, spaces not supported.

cipher-name

Specify the filter profile name.

The value is a string of 1 to 32 case-sensitive characters, spaces not supported.

v2c

Indicates SNMPv2c and SNMPv3, respectively.

-

v3

Indicates SNMPv2c and SNMPv3, respectively.

-

authentication

Specify the securityLevel of AuthNoPriv.

-

privacy

Specify the securityLevel of AuthPriv.

-

cipher cipher-name

Specify the security name with encrypted text.

The value is a string of 1 to 168 case-sensitive characters, spaces not supported.

notify-filter-profile

Notification filter profile.

-

Views

System view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
snmp write

Usage Guidelines

Usage Scenario

To set the target host to receive SNMP notifications, run the snmp-agent target-host command. When Inform messages are sent to notify the NMS of the network status, configure the engine ID for the NMS to ensure that the NMS receives Inform messages. The NMS receives an Inform message and returns an ACK message to the SNMP agent only if the engine ID contained in the Inform message and actual engine ID are the same. If the IDs are inconsistent, the NMS discards the Inform message.

If there are multiple target hosts, run the snmp-agent target-host inform command on each target host. If the snmp-agent target-host inform command is run for multiple times on the target host, only the last successful operation takes effect. For example, if you run the snmp-agent target-host inform command twice on a target host, the second operation overwrites the previous one.

Configuration Impact

After the snmp-agent target-host trap command is run, no matter whether a trap message sent by the SNMP agent reaches the NMS, the SNMP agent deletes the trap message to reduce the resource consumption.

After the snmp-agent target-host inform command is run, the SNMP agent, after sending an Inform message, waits for an Inform ACK message from the NMS and will retransmit the same Inform message only when no Inform ACK message is received from the NMS within the specified period. If the SNMP agent does not receive the Inform ACK message from the NMS during the retransmission period, the SNMP agent deletes this Inform message from the trap message queue. This ensures that the NMS can receive the SNMP Inform messages to the maximum extent. The transmission of Inform messages, however, consumes more resources than that of trap messages.

Precautions

To enable a device to propagate Inform messages, run at least one of the two commands, namely, snmp-agent target-host inform and snmp-agent trap enable on the router.

If you run the snmp-agent target-host trap command to configure a target host for receiving trap messages and then run the snmp-agent target-host inform command to configure a target host with the same host name and address, the configurations of the latter command overwrite those of the former command.

If the VPN instance specified by the vpn-instance vpn-instance-name parameter does not exist, the Inform messages cannot be sent to the target host.

If the security user name specified by the securityname security-name parameter does not exist, the Inform messages cannot be sent to the target host.

If the notify view is not configured for the SNMP user group to which the security user specified by the securityname security-name parameter belongs, the Inform messages cannot be sent to the target host.

Example

# Configure the notification mode for the BGP module as Inform, set the host name to 123 and SNMP version to 3, enable authentication and encryption, and set the BGP module to send Inform messages to the alarm host with the address of 192.168.0.1.
<HUAWEI> system-view
[~HUAWEI] snmp-agent trap enable
Warning: All switches of SNMP trap/notification will be open. Continue? [Y/N]:y
[*HUAWEI] snmp-agent target-host inform address udp-domain 192.168.0.1 params securityname 123 v3 privacy
# Configure the trap sending mode as Inform, set the security name of the host as public and SNMP version to v2c, set trap messages sent to the target host to carry extended bound variables, and set the SNMP module to send trap messages to the alarm host with the IP address of 2.2.2.2.
<HUAWEI> system-view
[~HUAWEI] snmp-agent trap enable
Warning: All switches of SNMP trap/notification will be open. Continue? [Y/N]:y
[*HUAWEI] snmp-agent target-host inform address udp-domain 2.2.2.2 params securityname public v2c ext-vb
# Configure the trap sending mode as Inform, set the security name of the host as 1 and SNMP version to v2c, and set the SNMP module to send trap messages to the alarm host with the IP address of 192.168.0.1.
<HUAWEI> system-view
[~HUAWEI] snmp-agent trap enable
Warning: All switches of SNMP trap/notification will be open. Continue? [Y/N]:y
[*HUAWEI] snmp-agent target-host host-name 1 inform address udp-domain 192.168.0.1 source GigabitEthernet0/1/1 params securityname 1 v2c
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >