Broadband

New addition to the Sysinternals PsTools Suite: PsPing

Derek Schauland explains how the newly added Sysinterals PSPing utility provides an easy ping test, but also comes with additional features.

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.

About

Derek Schauland has been tinkering with Windows systems since 1997. He has supported Windows NT 4, worked phone support for an ISP, and is currently the IT Manager for a manufacturing company in Wisconsin.

12 comments
Derek Schauland
Derek Schauland

Microsoft is moving back to a command line focussed environment with tools like PowerShell. Windows Server Core is a hardened version of Windows that runs primarily from the command line. Because I might manage a bunch of computers with similar properties, using a tool like PowerShell is much more efficient than using remote desktop to access the computers one at a time. Since Windows XP support is ending fairly soon, I would imagine more tools like PSPing/PSTools will not provide new feature support for Windows XP as new things are introduced. I agree that there will be shops running Windows XP for some time, even after support has ended, but those computers will not be able to take advantage of the new and improved tools not only from Microsoft, but from other vendors as well. Administrators of these systems need to be aware of this as they make the choice to continue with an unsupported Operating System.

kdpawson
kdpawson

Works with all Windows versions and does 5000 more things!!

Wave_Sailor
Wave_Sailor

Unfortunately it only works in Vista and up?? Why???

michael.kregel
michael.kregel

Why didn't Microsoft make this with a GUI interface? The year is 2012...isn't it time to get away from command line when possible?

reggaethecat
reggaethecat

Microsoft have had the Portqry available for a while, it is another way to test the availability of a port, e.g. portqry -n 10.0.2.55 -e 80 will test for port 80 being open on that IP. You can download it from the Microsoft website.

david.tredinnick
david.tredinnick

Yes indeed - very handy Thanx for the run-through. Latency testing on a TCP port is a good one for me I think you may have got your bandwidth mixed up with your latency when/if you pasted and forgot to edit. "An example of a PsPing bandwidth test might look like the following: Psping -l 3072 -n 15000 -h 50 192.168.20.15:25000"

jcitron
jcitron

I had to support Win NT 4.0 sp6a up until the bitter end along with still very active Win 9x machines. The reason was due to some legacy applications that required that environment. Finally in 2007 we upgraded to Vista Business. It was actually the best version of Vista out there, and I was able to setup any legacy applications to run in virtual machines. We used Parallels for the VMs and they ran pretty well. It took a lot of convincing of the upper management to break away from the old technology, and this happened only after a critical machine died and we had no choice but to upgrade. :)

clintwalkerz
clintwalkerz

Why indeed? Is this a MS tactic to steer us away from XP quicker? Well in my opinion XP will be here for a few years more, or until bespoke 3rd party developers decide it is time to code properly for Windows 7. We still use XP Pro in the industry, It still works. Code this for XP please. Thx :)

jcitron
jcitron

The GUI isn't necessary for things like this, besides a quick batch using a command such as this is a lot faster particularly when you're testing several machines at once.

DGermantr@Real-World-Systems.com
DGermantr@Real-World-Systems.com

This is 2012 and putting a GUI interface in a script/command file/batch is really hard. Doing the same (and I mean the exact same) thing tomorrow and the next day with a GUI isn't assured. Invoking a GUI from a scheduled task and providing arguments isn't really an option. As they told you in kindergarten:"Stop pointing!"

Editor's Picks