Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Excuse me, is that port taken?by coec (Chaplain) |
on Aug 17, 2002 at 14:53 UTC ( [id://190863]=perlquestion: print w/replies, xml ) | Need Help?? |
coec has asked for the wisdom of the Perl Monks concerning the following question:
Hi all At work, we have a very brain dead system whereby our stores (each of which have a unique 4 digit numerical identifier) connect to port on the main AIX cluster for the purpose of getting the latest prices for trade customers. The silly thing about this system is that sockets are not correctly used and many ports are in use on the AIX cluster where, in a perfect world, only one port should be in use.
I have had to write control scripts(start, stop, monitor in ksh as my Perl is not quite up to the task as yet) for this system. The start script: I was thinking today that rather than doing a 'ps -ef | grep ...' it would be better to check and see if anything is listening on that port. There are generally 10,000+ processes at any one time so the ps/grep combination is very slow. I have no idea how to get a Perl script to see if a port has a program bound to it. So a pointer in that direction would be great.
Thanks
Back to
Seekers of Perl Wisdom
|
|