portcheck

scans specific ports on a machine 

Command


SYNOPSIS

portcheck [-t timeout_seconds] [-m timeout_microseconds] [-v] [-Q] [-s protocol] [-x] [-U username] [-P password] [-y url] [-a http_user_agent] [-D domain] [-F from_email] [-T to_email] [-p TCP_port] machine

portcheck [-t timeout_seconds] [-m timeout_microseconds] [-v] [-Q] [-s protocol] [-u UDP_port] machine

portcheck [-t timeout_seconds] [-m timeout_microseconds] [-v] [-Q] [-M Maximum_ports] machine

portcheck -h


DESCRIPTION

The portcheck utility can verify whether or not a specific port is in use or can check the status all of several ports on a machine. It supports TCP and UDP.

portcheck can also verify that sessions exist for the following protocols: http, ftp, smtp, and telnet. It does a connect based scan for all other ports.

Options

-a http_user_agent 

specifies the http user agent string to use in communication with an http proxy.

-D domain 

specifies the domain to use when doing a telnet probe.

-F from_email 

specifies the from e-mail address to use if testing smtp.

-h 

displays help.

-M Maximum_ports 

when scanning ports on a machine, sets the maximum port number to scan. The default is 1024.

-m timeout_microseconds 

specifies a timeout in microseconds. This is the total number of microseconds allowed to verify whether the socket is alive or not. Half a second is represented as 50000 microseconds.

-P password 

specifies an ftp or telnet password or the password for an http proxy.

-p TCP_port 

specifies the TCP port to verify.

-Q 

suppresses all standard output.

-s protocol 

if the protocol is http, ftp, smtp, or telnet and the port number specified by -p or -u is not the default for these protocols, specify the port here. For example, for if the http service should be listening on port 8080, specify -s http -p 8080 since http is usually at port 80.

-T to_email 

specifies the to e-mail address to use if testing smtp.

-t timeout_seconds 

specifies a timeout in seconds. This is the total amount of seconds allowed to verify whether the socket is alive or not.

-U username 

specifies an ftp or telnet user name or the user name for an http proxy.

-u UDP_port 

specifies the UDP port to verify

-v 

displays what is happening when the socket connection is made.

-y url 

specifies the URL to be used in communicating to an http proxy.

-x 

specifies that an http proxy is to be used.


EXAMPLES

Check ports up to 2048 ports on server:

portcheck -M 2048 server

Verify UDP port 161, snmp on server:

portcheck -u 161 server

Verify TCP port 8080, an HTTP service is up:

portcheck -p 8080 -s http -t 60 -v server

Check whether a telnet session is available on server:

portcheck -ptelnet -Ujsmith -Ppassword -Ddomainname -v server

DIAGNOSTICS

Possible exit status values are:

0 

Successful completion.

1 

Failure due to any of the following:

— the machine was not found
— to connect to the port specified by -p or -u
— to communicate correctly with the protocol, may be due to parameters passed or not passed.


PORTABILITY

Windows 7. Windows Server 2008 R2. Windows 8. Windows Server 2012. Windows 10. Windows Server 2016.


AVAILABILITY

PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


PTC MKS Toolkit 10.1 Documentation Build 15.