in reply to Ping and check for server running on port 27015
What do you think, will this work?#!/usr/local/bin/perl use IO::Socket; ## Array of ports that you want to check. $port = "27015"; $remoteip = "www.your_server.com"; print "\nChecking for service at $remoteip\n"; print " "; print "=" x (length($remoteip) + 25); print "\n\n"; $connected = 0; $checkport = IO::Socket::INET->new( PeerAddr => "$remoteip", PeerPort => "$port", Proto => 'tcp', Timeout => '0') or $connected = 1; if (!($connected)) { print " Port $port is up.\n"; } else { print " Port $port is down.\n"; } close $checkport;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Ping and check for server running on port 27015
by Maclir (Curate) on Jan 24, 2001 at 03:32 UTC |