Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Query HTTP server

Posted on 2003-11-11
5
Medium Priority
?
338 Views
Last Modified: 2010-03-18
Hi,

is there any way in bash to query the round trip time to a http server? I have to use the http protocol so ping is no good.  I have to compare this to ping. I thought wget might have something but I couldn't find what to use.

Thanks
0
Comment
Question by:Paulmul
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:asbharadwaj
ID: 9721499
Iam not aware of any bash command for this purpose. But
You can write a small program that sends a HTTP Get request to the server
and measures the response time
Its really very simple
All you need to do is open a socket, connect to the server port 80 (or whatever the
server is listening to), note the time, send the http get request, wait for response,
note down time, calculate difference and you have the round trip time.
0
 
LVL 1

Author Comment

by:Paulmul
ID: 9721509
Can this be done in perl?  I am using perl and bash for this.
0
 
LVL 2

Accepted Solution

by:
asbharadwaj earned 120 total points
ID: 9722100
Well Yes
It can be done in Perl
Im a beginner in Perl and I dont know much about it and
Im much more comfortable with C.
However a good starting point will be
http://www.cs.cf.ac.uk/Dave/PERL/node169.html#SECTION001910000000000000000

Its a brief overview of various capabilities of Perl. Iam using this for Perl basics :-)
0
 
LVL 1

Author Comment

by:Paulmul
ID: 9722426
I am also quite new to perl, I prefer it to C though
0
 

Expert Comment

by:jared71
ID: 9732964
try curl, works great.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Loops Section Overview

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question