The sendtrap utility sends a SNMP trap PDU from the node you are on to any node on your network. By default, SNMP trap PDUs are sent to the SNMP Trap port (UDP/162) on the specified host. The sendtrap utility can send SNMPv1, SNMPv2c, and SNMPv3 UDP traps.
This utility has the following format:
sendtrap
[-f from_addr | from_host]
[-h dest_addr | dest_host]
[-i] [-r retries]
[-p port]
[-c community]
[-v 1 | 2c | 3]
[-u secName]
[-s secLevel]
[-n contextName]
[-a authPassword] [-A MD5 | SHA]
[ -x privPassword] [-X DES | AES | 3DES]
[-m FIPS_mode]
[-t timeout]
[-d logLevel]
[enterprise-oid] [trap-type] [subtype] [data-oid] [oid-type] [oid-value]
Changes the source address in the SNMP Trap PDU. The default value is an IP address of the host that is running sendtrap.
Specifies the destination host name or IP address to which the trap is being sent.
Sends inform requests (INFORM REQUEST) and waits for acknowledgement. These are also known as confirmed traps. Specify -i only if the -v (trap version) argument is 2c (SNMPv2c) or 3 (SNMPv3).
Specifies the number of retries to deliver an inform request until it is acknowledged.
Specifies the UDP port that the agent is running on (for example, 1691).
Default: 161
Specifies a community string that the agent uses. Valid for SNMPv1 and SNMPv2c only.
Note: Specify a read/write community string for snmpset.
Default: public
Indicates the version of SNMP that the agent is running. Specify 1 for SNMPv1, 2c for SNMPv2c, or 3 for SNMPv3.
Default: 1
Specifies the User-based Security Model (USM) user name used for SNMPv3 security.
Default: none
Specifies one of the following security levels for SNMPv3 communication:
3 - AuthPriv (SNMPv3 only)
Specifies the instance name for MIBMuxed agent.
Default: none
Specifies the authentication password if the agent is configured for SNMPv3 with secLevel 2 (AuthNoPriv) or 3 (AuthPriv).
Note: This option is not required for SNMPv3 communication.
Default: none
Specifies the authentication protocol to use if the agent is configured for SNMPv3 with secLevel 2 (AuthNoPriv) or 3 (AuthPriv). Currently only MD5 (Message Digest Algorithm) and SHA (Secure Hash Algorithm) are used.
Default: MD5
Specifies the privacy (encryption) password if the agent is configured for SNMPv3 with secLevel 3 (AuthPriv).
Default: none
Specifies the privacy protocol if the SNMPv3 user is configured with secLevel 3 (AuthPriv). Specify DES for Data Encryption Standard, AES for Advanced Encryption Standard using cryptographic keys of 128 bits (AES128), and 3DES for Triple Data Encryption Standard.
Default: none
Note: Install the SystemEDGE Advanced Encryption package if you specify AES or 3DES. For more information, see the appendix “SystemEDGE Advanced Encryption”.
Controls the FIPS mode of operation. Accepted values are 0, 1, and 2.
Indicates Non-FIPS mode.
Indicates FIPS co-existence mode.
Indicates FIPS only mode.
Default: 1
Note: FIPS mode requires you to install the SystemEDGE Advanced Encryption package. For more information, see the appendix "SystemEDGE Advanced Encryption".
Specifies the duration before the SNMP receiver considers the request as timed out.
Default: 10 seconds
Specifies the log level of the SNMP messages. Accepted values are 0 to 5.
Logs fatal messages.
Logs critical messages.
Logs warning messages.
Logs informational messages.
Logs all of the messages.
Logs all of the messages including debugging messages.
Default: 0
Specifies the top-level enterprise object identifier that represents this trap.
Specifies the generic trap type in the SNMP Trap PDU. Defined in RFC 1157, this field can accept one of the following values (integers 0 - 6):
Values less than 0 (zero) cause sendtrap to print an error message and exit. Values greater than 6 cause sendtrap to issue a warning message.
Specifies an enterprise-specific trap subtype. An accepted value for this field is an integer. You should only specify this if the trap type is 6 (Enterprise specific trap).
Specifies the Object Identifier (OID) that is included in the SNMP Trap PDU.
Specifies the type of the OID value to be set. OID type can be one of the following:
integer
octet string. Valid on character strings, binary and string IPv4 and IPv6 addresses, and string host names.
string
object identifier
IPv4 address only
counter value
64 bit counter value
gauge
time ticks
Specifies the value of the OID to be set. The type of the OID value should match OID-type.
Notes:
sendtrap Examples
./sendtrap -h box1.domain.com -f from.domain.com -v 2c -c admin -p 1692 1.2.3.4 6 1023 1.3.6.1.2.1.2.2.1.1.1 -i 3 1.3.7.8.9.10.11 -s “Trap value”
Sends the trap to this host name.
Sends the trap with from.domain.com in the from address in the trap PDU.
Specifies the port number to send the trap.
Specifies the enterprise OID.
Specifies the trap type (enterprise specific trap).
Specifies the enterprise specific trap sub-type.
Specify the data OIDs.
Specify the oid types.
Specify the OID values of the respective OIDs.
The following example sends an authentication failure (trap_type: 4) SNMPv1 trap with varbinds 1.3.6.1.2.1.2.2.1.1.1 and 1.3.7.8.9.10.11 to port 162 on the host with IP address Ea2f:fe90:abcd:0000:230:a2f:200:ad01:
./sendtrap -h Ea2f:fe90:abcd:0000:230:a2f:200:ad01 -v 1 -c admin 1.2.3.4 4 1.3.6.1.2.1.2.2.1.1.1 -i 3 1.3.7.8.9.10.11 -s “Trap value”
The following example sends an authentication failure (trap_type: 4) SNMPv3 Inform request with varbinds 1.3.6.1.2.1.2.2.1.1.1 and 1.3.7.8.9.10.11 to port 162 on the host with IP address 130.10.100.101. It waits for acknowledgement with a timeout of 30 seconds and retries 2 times.
./sendtrap -h 130.10.100.101 -p 2009 -i -r 2 -t 30 -u user1v3 -A SHA -a osa -X AES -x osp -v 3 -s 3 -t 30 -h 130.10.100.101 1.2.3.4 4 1.3.6.1.2.1.2.2.1.1.1 -i 3 1.3.7.8.9.10.11 -s “Trap value”
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |