Re: [Q]: non 162 straps & straps under NT

Brian Meagher (bmeagher@eurologic.ie)
Thu, 16 Jan 1997 21:08:11 +0000

Hi Juergen,

thanks for the fast response!

At 15:33 16/01/97 +0100, you wrote:
>What exactly do you need on NT? Is it sufficient to be able to receive
>traps from multiple ports in exactly one application,

No.

>or do you need
>to receive a single trap by multiple applications/scripts running
>concurrently on a NT box?

Yes.

>The answer to this question has a great impact on how to implement things.

I know! :-(

>Right. The uncoming replacement for straps is called nmtrapd and it is
>already capable to receive and forward traps from arbitrary ports.

Could I get an advance copy (by personal email or otherwise)?

>If it is not required to forward a trap to multiple application
>running concurrently on a NT box, than there is a simple way to get
>rid of straps on NT. You simple open the trap socket in the Tnm
>extension because NT does allow everyone to open every port number.
>My current implementation does it and it seems to work quite well.

As I mentioned above I do need a trap expander. :-(

Hmmm. Assuming that I use a TCP port to act as the channel to straps
clients, I now see two (other) solutions:

No. 1 No straps required under NT
===================================
Since NT allows anyone to open 162 I guess that we *could*
do something like the following in TnmSnmpTrapOpen:
Connect to TCP port 5000+<trap port number>
If failed then
start listening for clients on 5000+trap port number
open UDP <trap port number>
setup file handler so that incoming traps get forwarded
setup standard 5XXX callback handler
else
setup standard 5XXX callback handler
setup callback to rerun TnmSnmpTrapOpen if 5XXX server quits
(I'm assuming that the server quitting will cause a
TCL_EXCEPTION
event on the socket, I haven't checked this)
endif

However, this isn't very clean & we still require straps (or nmtrapd) under
UNIX.
We could decide to use straps only for 162 under UNIX and use the "inlined"
straps shown above for non-privileged ports under UNIX and all ports under NT.

No. 2 Single service under NT
===============================

straps could be rewritten, using a single TCP port number as the connect address
for clients that inform the server what UDP port numbers they want to receive
traps from. This will increase the complexity of the straps trap forwarder from
1-N to N-N, but once this code was wrapped in a service it could also be used in
NT and only a single service need be installed. Under UNIX only a single straps
process need run.

I'm leaning towards this solution as at least it's self-contained.

>Brian> **Late** last night when I was thinking about this it seemed
>Brian> that the obvious solution would be to use TCP sockets in a
>Brian> client server arrangement at some fixed offset from the port
>Brian> that straps wishes to forward.
>You are right, this would lead to a portable solution if the feature
>to receive a trap by multiple applications is really required on NT.
>(I hope your answer is no.)

Sorry, Juergen, I'm an awkward git! :-)

>I like this cron job problem very much. It should be easy to fix this
>problem by turning off cron. :-)

That's just what I told my customer! :-) (Seriously!!!!) If you want to
retain UNIX sockets & fix this, my first thought was to simply move the
location of the file ($TNM_LIBRARY/tmp/.straps-<pn>)

I'm not here tomorrow, but will start trying to implement one of the
solutions next week. Any advise and/or source code gratefully accepted! :-)

Regards,
-Brian.

---
Brian Meagher (bmeagher@eurologic.com)

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.