Home » Linux Administration

Troubleshooting tools: ping, pathping, httping and nmap

25 July 2007 No Comment

Too many times I have heard people determine that a host is not up because they can’t ping it. Most of us (myself included) run for ping and traceroute whenever we have an issue with connectivity – but ping and traceroute rely on icmp being permitted on the routers or hosts that you are traversing to reach your final destination and many firewalls blocks these.

This is where we bring in some handy tools:

HTTping is ping for http-requests. It’s pretty much like using ping except the basic switch is:

httping -h hostname.com

On debian / ubuntu distros:

sudo apt-get install httping

httping can also access alternative ports BUT remember it is still making http-requests.. so, it won’t help checking your mail server. We can use Telnet for a quick check on most other ports – but specifically, httping helps us check latency in this scenario.

If you need a constant graphed monitoring solution for the same, checkout Smokeping

Sometimes getting to know your environment can help you sort out what your dealing with. For example, php now has a config in php.ini that prevents you from viewing the output from your typical phpinfo:

< ? phpinfo() ?>

So, you don’t have shell access (shared server), how do you find it out? It’s pretty easy using a cross-platform security tool called nmap.

sudo apt-get install nmap

And here’s a starting point:

nmap -A www.hostname.com -p 80

Returns us:

Interesting ports on
80/tcp open http Apache httpd 2.2.0 ((Win32) DAV/2 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_autoindex_color PHP/4.4.1-pl1)

There’s some nice gui’s around for nmap and if you are getting interested in security scanning, then it’s also worth checking out Nessus

Now, back to performance and diagnostics – Sometimes, we see pings are slow and we do a traceroute but traceroutes do not provide the ability to see the response time over a timeframe. Microsoft came up with a hybrid of ping and traceoute called ‘pathping’ – There is no native utility in Linux (that I know of) but there is a nice perl script that does pretty much what pathping does.

You can get it for Linux (and I guess Mac also) by using this one liner as root:

wget -O /usr/bin/pathping http://calle.ioslo.net/professional/downloads/perl/pathping/pathping && \
chmod 755 /usr/bin/pathping

and to RTFM, if you haven’t already got it installed.

sudo apt-get install perl-doc

but not much to see there except the –numeric switch that prevents DNS lookups


pathping –numeric hostname.com

Hope the above helps.

Powered by ScribeFire.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.