Send an SNMP TRAP message to a host
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]
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.
Send a cold start trap to the specified host:
snmptrap -v 1 nic.andrew.cmu.edu public 0 0 \ 'SUN 3/60: SUNOS4.0'
snmptrap nic.andrew.cmu.edu manager_party \ agent_party agent_context 0 0 'SUN 3/60: SUNOS4.0'
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
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)