Home Page : Downloads : CryPing : Examples
CryPing is a command line utility that extends the functionality of the traditional ping command to include the ability to ping http services and individual ports.
Examples of use:
The simplest use of CryPing is to test the network connection between the current PC and a remote network device (typically another PC). You can specify what to ping using either a DNS name or an IP address.
For example, to ping by name:
C:\>cryping www.cryer.co.uk
CryPing - from www.cryer.co.uk v1.2 (build Jan 2008)
Pinging www.cryer.co.uk [80.189.94.38] with 32 bytes of data:
Reply from 80.189.94.38: bytes=32 time=12ms TTL=248
Reply from 80.189.94.38: bytes=32 time=12ms TTL=248
Reply from 80.189.94.38: bytes=32 time=12ms TTL=248
Reply from 80.189.94.38: bytes=32 time=12ms TTL=248
Ping statistics for 80.189.94.38:
Requests: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times:
Minimum = 12ms, Maximum = 12ms, Average = 12ms
or by IP address:
C:\>cryping 80.189.94.38
CryPing - from www.cryer.co.uk v1.2 (build Jan 2008)
Pinging 80.189.94.38 [80.189.94.38] with 32 bytes of data:
Reply from 80.189.94.38: bytes=32 time=60ms TTL=248
Reply from 80.189.94.38: bytes=32 time=38ms TTL=248
Reply from 80.189.94.38: bytes=32 time=13ms TTL=248
Reply from 80.189.94.38: bytes=32 time=12ms TTL=248
Ping statistics for 80.189.94.38:
Requests: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times:
Minimum = 12ms, Maximum = 60ms, Average = 31ms
If you can ping a remote device by IP address but not by name then this implies a problem with DNS.
Should CryPing be unable to connect to the remote network address this may be for any number of reasons. Typically it is one of:
CryPing is identical to the standard ping utility when used like this.
To monitor a network connection for failure, sounding an audible alarm (beep) when the connection fails use the two flags "-t" and "-alarm". The "-t" flag tells CryPing to continue until stopped (you can stop it by typing control-C), and the "-alarm" flag (or "-a" for short) tells CryPing to sound an alarm should the ping test fail.
For example:
C:>cryping -t -alarm www.cryer.co.uk
CryPing - from www.cryer.co.uk v1.2 (build Jan 2008)
Pinging www.cryer.co.uk [80.189.92.38] with 32 bytes of data:
Reply from 80.189.92.38: bytes=32 time=13ms TTL=248
Reply from 80.189.92.38: bytes=32 time=13ms TTL=248
Reply from 80.189.92.38: bytes=32 time=13ms TTL=248
.
.
Should the network connection fail then the computer will emit a beep. Ensure that sound is enabled!
You can invert this to give a beep each time ping succeeds and be quiet on failure using "-beep" instead of "-alarm", for example:
C:>cryping -t -beep www.cryer.co.uk
CryPing - from www.cryer.co.uk v1.2 (build Jan 2008)
Pinging www.cryer.co.uk [80.189.92.38] with 32 bytes of data:
Reply from 80.189.92.38: bytes=32 time=13ms TTL=248
.
.
CryPing can be used to check the connection to an individual port. This is useful as a simple means of testing that a connection can be made to a port.
For example, port 21 is one of the ports used by FTP so to check whether something is listening on port 21 use the command line switch "-port 21":
C:\>cryping -port 21 www.cryer.co.uk
CryPing - from www.cryer.co.uk v1.2 (build Jan 2008)
Pinging port 21 on www.cryer.co.uk:
Successful connection to www.cryer.co.uk port=21 time=349ms
Successful connection to www.cryer.co.uk port=21 time=215ms
Successful connection to www.cryer.co.uk port=21 time=242ms
Successful connection to www.cryer.co.uk port=21 time=315ms
Ping port statistics for port 21 on www.cryer.co.uk:
Requests: Made = 4, Successful = 4, Failed = 0 (0% loss),
Approximate round trip times:
Minimum = 215ms, Maximum = 349ms, Average = 280ms
Port 5900 is used by the popular VNC remote desktop tool:
C:\>cryping -port 5900 www.cryer.co.uk
CryPing - from www.cryer.co.uk v1.2 (build Jan 2008)
Pinging port 5900 on www.cryer.co.uk:
Failed to connect to www.cryer.co.uk
Failed to connect to www.cryer.co.uk
Failed to connect to www.cryer.co.uk
Failed to connect to www.cryer.co.uk
Ping port statistics for port 5900 on www.cryer.co.uk:
Requests: Made = 4, Successful = 0, Failed = 4 (100% loss)
Which shows that VNC is not used on our server.
CryPing can be used to test whether a web-server is responding to HTTP requests. The -http flag indicates that CryPing should connect using HTTP.
C:\>cryping -http www.cryer.co.uk
CryPing - from www.cryer.co.uk v1.2 (build Jan 2008)
Pinging www.cryer.co.uk for http status:
Reply from www.cryer.co.uk: 200 OK time=72ms
Reply from www.cryer.co.uk: 200 OK time=42ms
Reply from www.cryer.co.uk: 200 OK time=40ms
Reply from www.cryer.co.uk: 200 OK time=39ms
HTTP ping statistics for www.cryer.co.uk:
Requests: Sent = 1, Responses = 1, Lost = 0 (0% loss),
200 OK 4 times (100%)
Approximate round trip times:
Minimum = 39ms, Maximum = 72ms, Average = 48ms
As well as pinging a webserver, it is also possible to ping an individual page. For example:
C:\>cryping -n 1 -http www.cryer.co.uk/index.htm
CryPing - from www.cryer.co.uk v1.2 (build Jan 2008)
Pinging www.cryer.co.uk/index for http status:
Reply from www.cyrer.co.uk/index.htm: 200 OK time=144ms
HTTP ping statistics for www.cryer.co.uk/index.htm:
Requests: Sent = 1, Responses = 1, Lost = 0 (0% loss),
200 OK 1 times (100%)
Approximate round trip times:
Minimum = 144ms, Maximum = 144ms, Average = 144ms
Should the page not exist then the response will be different, for example:
C:\>cryping -n 1 -http www.cryer.co.uk/index
CryPing - from www.cryer.co.uk v1.2 (build Jan 2008)
Pinging www.cryer.co.uk/index for http status:
Reply from www.cryer.co.uk/index: 404 Not Found time =58ms
HTTP ping statistics for www.cryer.co.uk/index:
Requests: Sent = 4, Responses = 4, Lost = 0 (0% loss),
404 Not Found 1 times (100%)
Approximate round trip times:
Minimum = 58ms, Maximum = 58ms, Average = 58ms
Should you wish to view the full HTTP headers when pinging a website then add the -v flag (in addition to -http), for example:
C:\>cryping -http -v -n 1 www.cryer.co.uk
CryPing - from www.cryer.co.uk v1.2 (build Jan 2008)
Pinging www.cryer.co.uk for http status:
Reply from www.cryer.co.uk: 200 OK time=55ms
HTTP/1.1 200 OK
Server: Zeus/4.1
Date: Fri, 01 Feb 2008 14:12:18 GMT
Connection: close
Content-Length: 8358
Accept-Ranges: bytes
Content-Type: text/html
Last-Modified: Sat, 12 Jan 2008 09:59:11 GMT
HTTP ping statistics for www.cryer.co.uk:
Requests: Sent = 1, Responses = 1, Lost = 0 (0% loss),
200 OK 1 times (100%)
Approximate round trip times:
Minimum = 55ms, Maximum = 55ms, Average = 55ms