The sys admin's daily grind – paping

A Better ping

Article from Issue 180/2015
Author(s):

Like every sys admin, Charly occasionally throws a pebble at a machine to see if it is still alive. If the other end does not respond to the ping, that does not always mean it's dead. Maybe the pebble just missed.

Hi there! Anybody home? Quite often, admins need to make sure that at least the physical connection between two computers is still up – or back up. Obviously, ping is the tool of choice when it comes to proving or refuting accessibility. However, there are cases in which a firewall blocks the ICMP ping. Anyone with a modicum of knowledge can save the energy they would otherwise waste cussing and instead type:

nmap -p <port>

Don't cheer too soon, though, because often an intrusion prevention system blocks the Nmap signature of the workaround.

Paping [1] establishes a connection to a configurable port and immediately terminates it again. This works almost anywhere. It measures the round-trip time in milliseconds, just like ping. The simplest form of the call is very intuitive:

paping <target>

The tool can handle optional parameters, too (Figure 1); a typical call looks like:

paping www.google.com -p 80 -c 4

The -p parameter specifies the TCP port to target – 80 in this case – which will return the expected results for a web server. By using -c <no_of_checks>, I can define how often Paping checks out the target.

Figure 1: Paping pinging port 80 on Google's web server. No matter what lies in between, the web server will respond – after an average of 48ms in this case.

Give Him a Break!

If you know that your target resides on a particularly slow or fast line, you might want to tune the -t <timeout_in_msec> parameter; that is, the time in which Paping abandons its task. Without the option, the tool throws in the towel after 1 second (1,000ms).

Purists who find the attractive output shown in Figure 1 too psychedelic, or cave dwellers sitting in front of terminals or dot matrix printers, can use the --nocolor option. This kicks Paping back into the monochrome era.

So, will Paping's programmer Mike Lovell be building an API for Android apps? No way: The open source tool has apparently reached the end of its design cycle – nobody has touched the C++ code for two years, but that is not surprising for such a simple tool.

If your Linux distribution does not include Paping in its repositories, you can grab the source or Linux version built for 32- and 64-bit systems [1].

Firewall in the way during ping testing? I don't care!

The Author

Charly Kühnast is a Unix operating system administrator at the Data Center in Moers, Germany. His tasks include firewall and DMZ security and availability. He divides his leisure time into hot, wet, and eastern sectors, where he enjoys cooking, freshwater aquariums, and learning Japanese, respectively.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Charly's Column

    If you do not receive a response to a ping, or if the response is seriously delayed, you might like to take this as a warning. But who wants to ping all day? You need a ping-based monitoring utility like Smokeping.

  • Highway Through Hell

    When digging into BGP routing information, Charly avoids the highway through parameter hell thanks to the ASN tool. In addition to a system's AS number, ASN delivers other information, such as its peering partners upstream and downstream.

  • Charly's Column: My Traceroute

    Charly takes the name of the “My Traceroute” tool very literally. The journey is the reward for this alternative TTL-measuring utility.

  • Charly's Column: GestióIP

    A tidy house, a tidy mind they say, and I’ll leave it up to you to consider what being disorganized might mean. Anybody who has tried to manage hundreds of IP addresses using just a sheet of paper or a spreadsheet will probably appreciate some help.

  • Two Types of Round Trip

    Due to the COVID-19 lockdown, Charly has time to devote to gadgets like graphical ping tools, flashing space stations, and space walks.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News