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"
LVL 1
mnewnhamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.