| Using the SNMP Utilities | |
| 4.2 Using the Trap Sender and Trap Receiver Programs | |
Table | Flags for the snmp_trapsnd Command | |
|
|
|
Flag | Description | |
|
|
|
| Specifies the host name or IP address (in ASN.1 dot notation format) of the | |
| destination host to receive the trap message. The default is localhost | |
| (127.0.0.1). |
|
Specifies a port number on the destination host where the message is to be sent. | ||
| The default is UDP 162. | |
Specifies that the TCP transport be used instead of the default UDP transport. | ||
| If a connection cannot be established, the program displays the warning | |
| connect | |
Specifies the SNMP version to use for sending the PDU. The valid versions are 2c | ||
| or 1 (default). You can specify the flag and value without including a space (for | |
| example, | |
|
|
|
4.2.1.3 Trap Sender Examples
In the following snmp_trapsnd command examples:
•The first line is the snmp_trapsnd command.
•The remainder is the display received when running the trap receiver program (snmp_traprcv) without flags included.
1.The following example generates a trap that originated on the localhost (specified by the agent parameter) using the default SNMP version (SNMP Version 1). The
$ snmp_trapsnd 0.0 local 0 0 0 |
|
Message received from 127.0.0.1 |
|
| |
community - 7075626C 6963 | public |
enterprise - 0.0 |
|
agent address - 0.0.0.0 |
|
trap type - Cold Start (0) |
|
timeticks - 51938978 |
|
2.The following example generates the same trap as in example 1, except that it specifies the use of SNMP Version 2.
$ snmp_trapsnd 0.0 local 0 0 0
Message received from 127.0.0.1
community - 7075626C 6963 | public |
sysUpTime.0 - 51938968 = 6 d 0:16:29 snmpTrapOID.0 - 0.0
3.The following example sends values to the node mynode with the community name special.
$ snmp_trapsnd 1.2.3 marley.dec.com 6 33 100
| |
community - 73706563 69616c | special |
Using the SNMP Utilities