[Previous] [Contents] [Index] [Next]

snmptrap

Send an SNMP TRAP message to a host

Syntax:

snmptrap [-d] -v 1 host community trap_type
         specific_type device_description
         [-a agent_addr]

snmptrap [-d] [-v 2] host noAuth trap_type
         specific_type device_description
         [-a agent_addr]

snmptrap [-d] [-v 2] host srcparty dstparty
         context trap_type specific_type
         device_description [-a agent_addr]

Options:

-a agent_addr
Change the address that the trap reports it's being sent from. By default, snmptrap uses the sending host's address.
-d
Dump the output packet.
-v 1|2
SNMP version (default is 2).
community
The community name for the transaction with the remote system.
context
The collection of object resources available to the dstparty.
device_description
A textual description of the device sending this trap. The description is used as the value of a system.sysDescr.0 variable.
dstparty
The name of the party performing the action.
host
An Internet address specified in dot notation or a host name.
srcparty
The name of the party requesting an action.
specific_type
An integer that specifies user-defined additional information about trap_type.
trap_type
An integer that specifies the type of trap message being sent. Trap types are defined in the table below.

Description:

The snmptrap utility forms and sends an SNMP TRAP message to a host.

This trap type: Signifies that the sending protocol entity:
0 (coldStart) Is reinitializing itself -- the agent's configuration or the protocol entity implementation may be altered.
1 (warmStart) Is reinitializing itself -- neither the agent's configuration nor the protocol entity implementation is altered.
2 (linkDown) Recognizes a failure in one of the communication links represented in the agent's configuration.
3 (linkUp) Recognizes that one of the communication links represented in the agent's configuration has come up.
4 (authenticationFailure) Is the addressee of a protocol message that isn't properly authenticated.
5 (egpNeighborLoss) Had an EGP neighbor as an EGP peer, and the neighbor has been marked down so that the peer relationship no longer exists.
6 (enterpriseSpecific) Recognizes that some enterprise-specific event has occurred. The specific trap field identifies the particular trap that occurred.

If you're using SNMP version 2, you must configure the following files:

For a description on how to configure the files, see the documentation for each of the configuration files listed above. If you wish to change the location of your configuration files, you must include a snmpd.conf file.

Examples:

Send a cold start trap to the specified host:

Using SNMPv1

snmptrap -v 1 nic.andrew.cmu.edu public 0 0 \
'SUN 3/60: SUNOS4.0'

Using SNMPv2

snmptrap nic.andrew.cmu.edu manager_party \
agent_party agent_context 0 0 'SUN 3/60: SUNOS4.0'

Environment variables:

MIBFILE
Specify the location of the mib.txt file. For example, MIBFILE=path/mib.txt (the default path is /etc).
SUFFIX
If SUFFIX exists in your environment, all object IDs with a symbolic name are printed with only the last element. Examples:

This ID:

system.syscontact.0
      

is printed as:

syscontact.0
      

This ID:

udp.udpTable.udpEntry.udpLocalAddress.0.0.0.161
      

is printed as:

udpLocalAddress.0.0.0.161
      

See also:

snmpd, snmpget, snmpgetnext, snmpnetstat, snmpstatus, snmpset, snmptest, snmptranslate, snmptrapd, snmpwalk

/etc/acl.conf, /etc/context.conf, /etc/mib.txt, /etc/party.conf, /etc/snmpd.conf, /etc/view.conf files

RFC 1065, RFC 1066, RFC 1067
RFC 1441, RFC 1445, RFC 1446
RFC 1448, RFC 1449

Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised 2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)


[Previous] [Contents] [Index] [Next]