[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1961
  • Last Modified:

Manually send an SNMP trap

Is there source code somewhere for a program that can generate an snmp trap from the command line e.g.
trapsend host community oid string. There was a command on old SCO 3.2.4 that did just this called "trapsend"
0
mnewnham
Asked:
mnewnham
1 Solution
 
muiseCommented:
See  http://ucd-snmp.ucdavis.edu/ (and ftp://ucd-snmp.ucdavis.edu/ for the distribution).  When built, you get a binary called snmptrap that does exactly what you want.  The license permits unlimited cost-free use.  I've used it extensively and it works well.

You're describing a v1 SNMP trap; the syntax will be:

snmptrap -v 1 TRAP_RECIPIENT COMMUNITY OID LOCAL_IP GENERIC_TRAP SPECIFIC_TRAP s "string goes here"

.... e.g. sending from 10.1.1.1 (to 10.2.2.2):

snmptrap -v 1 10.2.2.2 public .1.3.6.1.2.1.0 10.1.1.1 1 6 0 0.0.0 s     "This is a test"

mike
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now