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

Juergen Schoenwaelder (schoenw@cs.utwente.nl)
Thu, 16 Jan 1997 15:33:23 +0100

Brian Meagher <bmeagher@eurologic.ie> said:

Brian> I need the following modifications to scotty2.1.5
Brian> - trap reception on ports other than 162
Brian> - straps under NT

What exactly do you need on NT? Is it sufficient to be able to receive
traps from multiple ports in exactly one application, or do you need
to receive a single trap by multiple applications/scripts running
concurrently on a NT box? The answer to this question has a great
impact on how to implement things.

Brian> [Q1] Has someone out there has already made these modifications?

Some of these modifications are already in my current code base, but
it is not yet complete.

Brian> If not, then I'll implement them myself & provide Juergen with
Brian> patches.

So I will stop working on that and wait until you are finished. ;-)

Brian> Trap reception on ports other than 162
Brian> ======================================

Brian> This will require a small modification to Tnm_SnmptrapOpen and
Brian> straps in tnmSnmpNet.c to launch & connect to a different
Brian> straps for each port number. There may be some other changes
Brian> required, I haven't checked this yet.

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

Brian> straps under NT
Brian> ===============

Brian> As far as I know I will have to write a service to perform
Brian> traps forwarding. This isn't too difficult, but since I
Brian> cannot find a way of passing a parameter into a service other
Brian> than the executable name I have to copy the straps_nt.exe to
Brian> straps_nt_<port number>.exe before I install it. Sigh.

Brian> [Q2] Any better solutions?

This is closely related to my question at the beginning of this mail.
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.

Brian> The second difficulty is that UNIX domain sockets aren't
Brian> supported under WinSock, so an alternative IPC mechanism has
Brian> to be used. When I hacked this up before I used Named Pipes
Brian> as they seemed to have a good correspondence with AF_UNIX
Brian> sockets. The bad news was that I couldn't do a (then)
Brian> Tk_CreateFileHandler on these (this was before the new I/O
Brian> subsystem) & so I had to write a thread that created another
Brian> socket & passed the messages received at the named pipe
Brian> (client end) to the new socket for which I had added a file
Brian> handler.

Brian> To say that this was an ugly hack is something of an
Brian> understatement! It also has the disadvantage that Win95 can
Brian> on act as a CLIENT of a named pipe, so this solution would
Brian> only run under NT.

Yes, doing this is not trivial.

Brian> [Q3] Has anyone written a I/O channel module for named pipes?

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. However, I wouldn't consider
Brian> myself an expert on sockets programming, so my reasoning may
Brian> be flawed.

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.)

Brian> [Q4] Comments?

[...]

Brian> Another advantage with this is that apart from the service
Brian> installation, it pretty portable between NT & UNIX & ...
Brian> Also, I've run into some problems with a hacked version of the
Brian> current straps when a cron job runs and removes the
Brian> /tmp/.straps file.

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

-- 
Juergen Schoenwaelder schoenw@cs.utwente.nl http://www.cs.utwente.nl/~schoenw
Computer Science Department, University of Twente,   (Fax: +31-53-489-3247)
P.O. Box 217, NL-7500 AE Enschede, The Netherlands.  (Tel. +31-53-489-3678)
-
!! 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.