SNMP Traps - can I monitor them?

Dar Scott dsc at swcp.com
Fri Mar 22 18:47:00 EST 2002


On Friday, March 22, 2002, at 03:15 PM, Ian Summerfield wrote:

> The opensockets() function shows I have other sockets open, but 
> 162 never
> gets opened.  Also no socketerror message is received,  it just 
> doesn't do
> anything!

result()?  sysError()?

It may be that you need certain priv/permissions to accept on a 
port lower than some value.  Somebody who knows unix/darwin/osx 
better than I would be better to comment.

A valid accept seems to put the port into open sockets immediately, 
so that may be all you need to detect failure.

> I'm on OS X on a Mac, I keyed netstat -a into the terminal on OS X 
> and it
> gave lots of interesting stuff but nothing to indicate my port 162 
> was open.

I was thinking Windows and just lucked out that that it works on OS X.

> I'm well out of my depth anyway.

Me, too.  Fools rush in...

> I don't think I need to monitor traps any
> more, I've just noticed my APC UPS sends datagrams every 26 
> seconds, but if
> something important happens it sends a datagram immediately...and 
> there's me
> thinking I'd need to get a TRAP from it.  So I can program my 
> whole system
> just listening to datagrams.

Cool.

> My next problem is knowing if I can ping an IP number just to see 
> whether it
> exists before I try and open a separate communication channel to it?

A few devices and computers will not respond to pings, but most do.

You can ping from the terminal.  Type ping and it will give you 
help.  On Windows, the shell function can be used to ping.  The 
dictionary on my Revolution has OS X crossed out for "shell" and 
"read from process", but curiously not for "open process".  You 
might be able to run something that leaves a file you can look at.  
Who knows?

You can also try to open a TCP connection to a bogus port and see 
if the sysError() or other result you get back is different 
depending on whether there is a system there.

If you get something to work I'd like to hear about it.  Or you 
might want to put shell on your wish list and skip pings for now.

Dar Scott





More information about the use-livecode mailing list