5

Background : It's a common question as we can search at google "ping works but http does not"

ping is not a reliable test of network connectivity.

ping working just means enough of the IP stack is up to process ICMP Echo requests (that's not a huge portion of the system compared to what's required for SSH and web servers). We could have had what I call a "partial panic" (Kernel blew up, but the IP code kept running), run out of RAM, or our SSH/HTTPd processes could have fallen over for unspecified reasons.

Resources

My Question : Any command line tool for ping HTTP?

3 Answers 3

7

There's plenty of command line tools that are capable of being a command line HTTP or simple TCP client. netcat and telnet (and yes, nmap) can tell you if the TCP port is responding, and curl or wget can handle attempting a full HTTP request.

But why not get a real monitoring solution in place instead, if you're having problems with the service failing?

3
  • Would you prefer any real monitoring solution? Please suggest me. Nov 26, 2012 at 6:31
  • 1
    @MahbuburRAaman There's some good information on monitoring solutions here and here. Nov 26, 2012 at 6:34
  • Shane Madden, I have improved my question as your answer. Nov 26, 2012 at 6:47
13
curl --head http://ipaddress/

is the closest to a ping, in that it is the minimum check that the server is responding to HTTP requests.

Any monitoring system worth its salt has this functionality built in. Nagios is free IIRC

1
  • 1
    If you want to measure the time to connect, you can add some parameters to curl. curl --head -s -w %{time_total} om.de
    – abuzze
    Sep 13, 2021 at 6:16
1

There is a small program to test performances of a remote host using TCP packets it's named echoping. I think that what are you looking for

1
  • That website appears to have been hijacked to redirect to a site offering to "Write College Papers" for a fee. This may be the current site for that tool, which is unmaintained: framagit.org/bortzmeyer/echoping.
    – Kaypro II
    May 31, 2023 at 16:22

Not the answer you're looking for? Browse other questions tagged .