Re: Can't receive broadcast traps

"Andrew Gregory" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Organization Southern Cross Software Solutions
Message-ID <[email protected]>
On Sat, 01 Nov 2008 23:26:11 +0900, Andrew Gregory <[email protected]>  
wrote:

> I have a QNAP hard drive enclosure that can listen out for APC compatible
> UPS (uninterruptable power supply) SNMP traps and shut down automatically
> if the power fails. That works fine. However, I'm trying to enable that
> same functionality on a Linux box on the same network. Currently, the  
> SNMP
> traps are broadcast to 192.168.1.255. The QNAP is receiving those just
> fine. I also wrote a small UPS utility for Windows, and that works too.
>
> However, now that I'm trying to use snmptrapd from net-snmp I've just run
> out of luck! I've tried some debug arguments from the wiki "-f -Lo" to  
> see
> if any traps are being received at all, but there is nothing. There is
> packet filtering on the Linux box, but I temporarily disabled that, with
> no success (tested by telneting to the box, which is normally blocked).
>
> Can snmptrapd even receive broadcast traps? What can I try to get this
> working? I've tried all the currently supported versions of net-snmp
> (5.2.5, 5.3.2.2 and 5.4.2).

Have I posted my question to the correct mailing list?

I've now tried an even earlier version, 4.2.7.1, and found a -d dump  
option in snmptrapd that I don't remember seeing in the later versions.  
Using that option, I can see that the broadcast packets are being dumped  
and therefore received by snmptrapd, but my defined traphandler still  
isn't being called. I've triple-checked the OID is correct (although I  
guess I could still have got it wrong). What could be stopping snmptrapd  
 from recognizing the traps?

Here is the dump:

Received 42 bytes from 192.168.1.10:162
0000: 30 28 02 01  00 04 06 70  75 62 6C 69  63 A4 1B 06     
0(.....public...
0016: 07 2B 06 01  04 01 82 3E  04 04 C0 A8  01 0A 02 01     
.+.....>........
0032: 06 02 01 05  43 04 95 DF  3F A1                       ....C...?.

Received 42 bytes from 192.168.1.10:162
0000: 30 28 02 01  00 04 06 70  75 62 6C 69  63 A4 1B 06     
0(.....public...
0016: 07 2B 06 01  04 01 82 3E  04 04 C0 A8  01 0A 02 01     
.+.....>........
0032: 06 02 01 0B  43 04 95 DF  3F A3                       ....C...?.

Received 42 bytes from 192.168.1.10:162
0000: 30 28 02 01  00 04 06 70  75 62 6C 69  63 A4 1B 06     
0(.....public...
0016: 07 2B 06 01  04 01 82 3E  04 04 C0 A8  01 0A 02 01     
.+.....>........
0032: 06 02 01 09  43 04 95 DF  62 C9                       ....C...b.

Received 42 bytes from 192.168.1.10:162
0000: 30 28 02 01  00 04 06 70  75 62 6C 69  63 A4 1B 06     
0(.....public...
0016: 07 2B 06 01  04 01 82 3E  04 04 C0 A8  01 0A 02 01     
.+.....>........
0032: 06 02 01 0B  43 04 95 DF  62 CB                       ....C...b.

And here is my conf:

traphandle .1.3.6.1.4.1.318.0.5 /sbin/ups_handler F
traphandle .1.3.6.1.4.1.318.0.9 /sbin/ups_handler O
traphandle .1.3.6.1.4.1.318.0.7 /sbin/ups_handler L

Does an MIB *have* to be defined somehow in order for the OID to be  
accepted?

This is my first time using net-snmp, and I have to say it's been rather  
frustrating!

Thanks in advance for any help.
-- 
Andrew Gregory

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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.