The PS utilities in the Sysinternals Suite from Microsoft have long been a great way to manage both local and remote systems from the command line. This month Mark Russinovich has introduced a new utility to the PsTools lineup called PsPing. In this post, I’ll look at PsPing, how it works, and what it can do for you.

Download PsPing here. Once downloaded, the PsPing utility behaves just like the other tools. There is no installation required, but the first time the application is run, an End User License Agreement appears. To use the tool, simply navigate to the directory where the utility is stored (C:\pstools\) in a command prompt and enter psping.

What does PSPing do?

PSPing sends traffic to other specified hosts to determine if they are online or not. This is similar to the test-connection cmdlet in PowerShell or the standard Ping command. In addition to simply determining if a host is online, like the traditional ping method does, PsPing has other features as well.

Usage for PsPing

Entering psping on the command line will display the syntax similar to the other pstools utilities. Individual usages for TCP, ICMP, Latency, and Bandwidth can be displayed by entering help for that parameter, for example, psping -? I will display information for ICMP.

The utility has four main options and each of those options has a series of switches for different actions.

The -I option is for using PsPing to send ICMP traffic, and has the following options:

  • -h<buckets>: Print a histogram with the defined number of buckets (20 is the default)
  • -i: interval in seconds between attempts (use 0 for a fast ping)
  • -l: request size
  • -n: number of pings
  • -q: supress output during pings
  • -t: ping until operation is stopped with Ctrl+C, press Ctrl+Break for statistics
  • -w: specify the number of warmup iterations (defaults to 1)
  • -4: force IPv4
  • -6: force IPv6

An example of PsPing for ICMP might look like the following:

Psping -n 10 -w 2 derek-pc

This ping will run for 10 iterations with 2 warmup iterations against the computer named derek-pc.

Figure A below shows PsPing ICMP.

The –T option is for using psping with TCP traffic, and has the following options:

  • -h<buckets>: Print a histogram with the defined number of buckets (20 is the default)
  • -i: interval in seconds between attempts (use 0 for a fast ping)
  • -l: request size
  • -n: number of pings
  • -q: supress output during pings
  • -t: ping until operation is stopped with Ctrl+C, press Ctrl+Break for statistics
  • -w: specify the number of warmup iterations (defaults to 1)
  • -4: force IPv4
  • -6: force IPv6

An example of PsPing for TCP might look like the following:

Psping -h -n 25 -w 4 derek-pc:80

The features for ICMP and TCP usage are the same, however for TCP, a destination port is specified.

Figure B below shows PsPing TCP.

The -B option will allow psping to monitor bandwidth over a designated connection and uses the following options:

  • -b: bandwidth test
  • -r: receive data instead of sending
  • -h<buckets>: Print a histogram with the defined number of buckets (20 is the default)
  • -i: number of outstanding I/Os (defaults to a minimum of 16 and 2x CPU)
  • -l: request size
  • -n: number of sends/receives
  • -w: specify the number of warmup iterations (defaults to 2x CPU cores)
  • -4: force use of IPv4
  • -6: force use of IPv6

This option will remain active until stopped by Ctrl+C.

An example of a PsPing bandwidth test might look like the following:

Psping -b -l 4096 -n 15000 -h 50 192.168.20.15:25000

Figure C below shows PsPing Bandwidth.

The -L option is for latency checking, which requires a buffer size to be used and supports the following options:

  • -h<buckets>: Print a histogram with the defined number of buckets (20 is the default)
  • -l: request size
  • -n: number of sends/receives used
  • -r: Receive data instead of sending
  • -w: specify the number of warmup iterations (defaults to 5)
  • -4: force IPv4
  • -6: force IPv6

This option will remain active until stopped by Ctrl+C.

An example of a PsPing bandwidth test might look like the following:

Psping -l 3072 -n 15000 -h 50 192.168.20.15:25000

Figure D below shows PsPing Latency.

Because of the ability to check bandwidth usage of a host and features beyond that of the simple ping, psping is definitely a worthwhile addition to the PsTools suite. I know that checking TCP ports with a simple ping style command is something that will come in handy for me. Knowing if the computer is online is one thing, but being able to test for the availability of a specific port without using a huge set of tools takes this tool to another level entirely.

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays