Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie help with snmp trap.

0 views
Skip to first unread message

Ray Van Dolson

unread,
Mar 31, 2005, 5:44:36 PM3/31/05
to
I'm trying to configure snmptrapd to handle an SNMP trap sent from
another device that will execute a script on the server running
snmptrapd. Unfortunately, it seems that snmptrapd is ignoring the
traps sent unless I use the "default" parameter in place of the OID.

There is obviously something I'm not understanding about how this is
supposed to work although I've read over the trap examples...

snmptrapd.conf:
traphandle .1.3.6.1.4.1.2789.2005.1 /usr/local/bin/disconnect_user.sh

So, am I correct in assuming that this will match SNMP traps with a
specific trap of .1.3.6.1.4.1.2789.2005.1 ?

I start snmptrapd with the following:

snmptrapd -c /etc/snmp/snmptrapd.conf -Dsnmptrapd:traphandler -O n -O
Q -Lf \
/var/log/snmptraps.log

And I sent the following trap (currently from the same server):

snmptrap -v 1 -c public localhost .1.3.6.1.4.1.2789.2005 localhost 6 0
'' \
.1.3.6.1.4.1.2789.2005.1 s "192.168.1.3"

So I am setting my enterprise-oid... not sure why I have to specify
localhost as the agent (before the 6), but it doesn't work with any
other value... and .1.3.6.1.4.1.2789.2005.1 is my specific trap which I
want to match against the oid in snmptrapd.conf.

I see the following in my logfile:

2005-03-31 14:01:34 localhost.localdomain [127.0.0.1] (via 127.0.0.1)
TRAP, SNMP v1, community public
.1.3.6.1.4.1.2789.2005 Enterprise Specific Trap (0) Uptime:
12:5:29:02.92
.1.3.6.1.4.1.2789.2005.1 = "192.168.1.3"

My disconnect_user.sh script is set to dump the information it receives
to a text file, but this text file is not generated. If I replace my
traphandle line in snmpd.conf with "default" instead of the OID the
script executes and creates the output file as it is supposed to do.

So obviously the OID of my request it not matching the OID in
snmptrapd.conf for some reason.

Can someone straighten me out?

0 new messages