snmptrapd 101

"Seger, Mark" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <9FCE3A46FE7C8045A6207AE4B42E9F9A4A93521B7A@GVW1119EXC.americas.hpqcorp.net>
I've successfully used this in the past with real devices sending traps to snmptrapd.  Now I find myself just trying to do some simple testing and generate my own traps and am failing miserably.  I'm guessing it's something very silly but have been staring at this for hours and am probably looking right past the problem.

Starting with the basics, I have /etc/snmp/snmptrapd.conf with one entry in it:

authCommunity execute public

if I comment it out, snmptrapd complains so it's clearly doing something with this.
Next I'm running snmptrapd -f -LO, which according to the documentation should report traps directly on the terminal

I also have the following 2 lines in my snmp.conf file:

rwcommunity  public
trapsink 192.168.1.105

and the machine I'm running on is the address of the sink.  I've also successfully executed snmpget, snmpset and snmpwalk so at least that level of the machinery is working.

As for a source of traps I've been looking at: http://net-snmp.sourceforge.net/docs/FAQ.html#How_do_I_send_traps_and_notifications_ from the faq and have tried ALL the different commands that are claimed to send traps, specifically:

snmptrap -v 1 -c public localhost "" "" 0 0  ""
snmptrap -v 1 -c public localhost "" "" 6 99 ""

snmptrap -v 2c -c public localhost "" UCD-SNMP-MIB::ucdStart

snmptrap -v 2c -c public localhost "" .1.3.6.1.4.1.2021.251.1

and I'm not seeing a thing.  Later on it shows how to build some customer MIBS as directed in http://net-snmp.sourceforge.net/tutorial/tutorial-5/commands/snmptrap.html

and those don't work either!  Finally I defined a customer trap handler in snmptrapd.conf with the entry:

traphandle default /tmp/snmplogger.pl

where snmplogger just takes its arguments and writes a timestamped record to a file in /tmp.  This worked like a champ for a previous project so I know the technique works but in this case I'm not seeing anything.

Since I know this stuff is pretty basic I'm wondering if I'm running snmptrapd with the wrong switches - I don't think so - and I also did try running it as a daemon with the traphandle enabled but still nothing.  The only other thing I can think of is maybe I'm missing some more settings in my conf files but I can't imagine what because as I said, I have been able to get this work correctly in the past and don't remember doing anything different.

Or maybe there is some other component I need to configure to make this all work correctly?  I'm really at a loss...

-mark

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.