Check website status and connection time using curl

#!/bin/bash

curl -I -s -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n\n\nResponse code:\t%{http_code}\nHTTP connect:\t%{http_connect}\nNumber of connections:\t%{num_connects}\nDownloaded:\t%{size_download}\nsize_header:\t%{size_header}\nnum_redirects:\t%{num_redirects}\n' -o /dev/null http://www.google.ro

 

Response

Lookup time:	0.036
Connect time:	0.052
AppCon time:	0.000
Redirect time:	0.000
PreXfer time:	0.053
StartXfer time:	0.245

Total time:	0.246

Response code:	200
HTTP connect:	000
Number of connections:	1
Downloaded:	0
size_header:	638
num_redirects:	0

 

Top