Previous Topic: sendtrap Utility--Send a SNMP UDP Trap

Next Topic: snmpget Utility--Retrieve an OID value

varbinds—Specify Variable Bindings for sendtrap

You can specify optional variable bindings as standard input to sendtrap. Variable bindings are data fields in the SNMP Trap PDU. Each variable binding associates a particular object instance with its current value and contains an object-identifier, an object type, and a value. Variable bindings are passed as input to sendtrap as ASCII character strings. The sendtrap utility converts them to SNMPv1 format.

You must enter each variable binding on a separate input line. The variable bindings list is terminated by an end-of-file (EOF) character (^Z for Windows systems, or ^d for UNIX systems). If you do not want to provide variable bindings to sendtrap, redirect input from /dev/null or a zero-length file.

Note: If you are not using input from a file, you must provide the end-of-file character for each sendtrap command. Use ^Z for Windows systems or ^d for UNIX systems.

The OIDs are specified in dotted-notation format (for example, 1.3.6), and types are indicated from a set of constant, case-insensitive strings. The type may be one of the following:

Values are dependent on the type and are converted appropriately to internal format. If sendtrap encounters conversion errors, it skips the current variable binding, instead of abandoning trap generation.

You can script this utility to redirect variable bindings from standard input (stdin) to sendtrap.

Notes: The maximum number of varbinds that you can specify in a single trap is 100.

SpecificType

Specifies the integer to use in the enterprise-specific trap type field in the Trap PDU. SpecificType values less than 0 cause sendtrap to print an error message and exit.

Note: The sendtrap utility reports 0 for the Trap PDU's time-stamp field because it cannot know the real value. Due to internal limits, sendtrap can send a maximum of 32 variable bindings in a single Trap PDU. You must be able to represent object values as an ASCII character string to enable sendtrap to read, convert, and send them within Trap PDUs. sendtrap does not recognize or convert ASCII strings for the TrapType or SpecificType arguments. You can specify only integers for these fields.