Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check a Port

Status
Not open for further replies.

vtaixer

Technical User
Sep 20, 2002
27
0
0
US
Is there some way to check if a port is up? Or some way to ping the port from a remote system? We have our foriegn systems set to send HL7 msgs to the main system via port 5000. The interface systems says there is no response and I can't find anything wrong with netstat.

TIA.
 
you could always telnet ip port ie telnet 192.92.1.7 25

or if you like perl here is clip from Angel monitor;

require 5.002;
use strict;
use IO::Socket;
use Proc::Simple;

sub Check_tcp
{
## Global

my ($Default_timeout) = 10; ## 20 seconds to abort connectio
n
my ($remote,$service) = split("!", $_[0]);
my ($sock);

###

$sock = IO::Socket::INET->new(PeerAddr => $remote,
PeerPort => $s
ervice,
Proto => 't
cp',
Timeout => $D
efault_timeout);

if (!defined($sock))
{
return (2,"Connection refused or timeout [$service/tcp]");
}
else
{
return (0,"OK");
}
}
1;
 
hi ,

netstat -an | grep 5000

see if it says listen or established with an ip address

or if you have lsof ( share whare s/w) you can use this to check port status in detail

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top