One tool that I haven't seen on *nix that I see my Windows brethren using, is called portping. There is a little freeware app called portping for Windows, that is really a misnomer as it doesn't ping anything really, but simply does a tcp connection attempt to see if the port on the destination side is answering. This is actually a really cool tool in my book, so I wrote my own in PERL since I couldn't find something similar. Basically, you call the script, give it a destination, a protocol (TCP is used by default), and a payload to deliver if you want to send something, otherwise it simply tries to connect to the port specified. I have used it for a while now, and it has come in handy for troubleshooting network connections. Check it out ...
#!/usr/bin/perl
use IO::Socket;
$remote_host = $ARGV[0];
$remote_port = $ARGV[1];
$remote_prot = $ARGV[2];
$msg_to_send = $ARGV[3];
$usage = "Usage: perlportping.pl host_or_IP_address port TCP/udp \"something to send to the server\"\n";
if (($remote_host eq "") || ($remote_port eq "")) {
die ($usage);
}
if ($remote_prot eq "") {
$remote_prot = "tcp";
} elsif (($remote_prot ne "tcp") && ($remote_prot ne "udp")) {
die ($usage);
}
if ($socket = IO::Socket::INET->new(PeerAddr => $remote_host,
PeerPort => $remote_port,
Proto => $remote_prot,
Type => SOCK_STREAM)) {
print "Connection to $remote_host:$remote_port ($remote_prot) successful.\n";
if ($msg_to_send ne "") {
print $socket "$msg_to_send\n";
$answer = <$socket>;
# and terminate the connection when we're done
close($socket);
print "\n\n Sent: $msg_to_send\n\n Got back: $answer\n\n";
}
} else {
print "Couldn't connect to $remote_host:$remote_port ($remote_prot) : $@.\n";
}
Let me know if you have any questions or comments!