snmp-agent target-host

Syntax

In non-FIPS mode:

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 trap address udp-domain { ip-address | ipv6 ipv6-address } params securityname security-string

In FIPS mode:

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

undo snmp-agent target-host trap address udp-domain { ip-address | ipv6 ipv6-address } params securityname security-string

View

System view

Default level

3: Manage level

Parameters

trap: Specifies the host to be the target host which receives traps and notifications from the device.

address: Specifies the destination IP address in the SNMP messages sent from the device.

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

ip-address: The IPv4 address of the trap target host.

ipv6 ipv6-address: Specifies the IPv6 address of the trap target host.

udp-port port-number: Specifies the number of the port on the target host to receive traps. The value defaults to 162.

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

v1: SNMPv1. This keyword must be the same as the SNMP version on the NMS; otherwise, the NMS cannot receive any trap.

v2c: SNMPv2c. This keyword must be the same as the SNMP version on the NMS; otherwise, the NMS cannot receive any trap.

v3: SNMPv3. This keyword must be the same as the SNMP version on the NMS; otherwise, the NMS cannot receive any trap.

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.


[NOTE: ]

NOTE:

  • According to the networking requirements, you can use this command for multiple times to configure different settings for a target host, enabling the device to send trap messages to different NMSs.

  • If udp-port port-number is not specified, port number 162 is used. Port 162 is the SNMP-specified port used for receiving traps on the NMS. Generally (such as using iMC or MIB Browser as the NMS), you can use the default port number. To change this parameter to another value, you need to make sure that the configuration is the same with that on the NMS.

  • If the key words v1, v2 and v3 are not specified, v1 is used.

  • If the key words authentication and privacy are not specified, the authentication mode is no authentication, no privacy.


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

    Examples

    # Enable the device to send SNMPv1 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