On our company servers due to security purposes our main SysAdmin only allows a few HTTP methods to pass through like (GET, POST, OPTIONS, PUT, etc.) and HEAD is not one of them.

I implemented Zabbix Monitoring on them to check if it pings correctly and if domain is down or not. What I do now is getting all response header and response body and check if it returns 200 OK or not.

The problem is due to many requests per second and timeouts I get lots of false errors therefore I don't want to waste my bandwidth to fetch all response header and response body just to check if a website is down or not and because of HEAD not allowed I can't do something like curl -I (which sends a HEAD HTTP request and only fetches response header so I could check if it returns 200 OK).

How can I send GET HTTP request but only fetch response header via curl?


If you’re afraid that your site can’t handle the load from your monitoring tool you’ve got bigger issues to worry about IMHO...

But rather than retrieving the main (large) index page simply create a unlikely URL path with an empty file and use that for monitoring.

Monitor for instance http://www.example.com/wfujhtdvbhujnngre/fghbbvffvgghpoiklmx/status.txt

That has the added benefit that to prevent inflated page view numbers requests for that URL path can easily be excluded when generating visitor stats.

  • I shouldn't really said "server load" (I changed my question), becuase that's my least concern. I was more trying to save bandwidth of monitoring server as there are lots of servers and I get lots of false alarms which many of them is because of timeout. I want to decrease request and response size so maybe I can prevent this issue. – Amin Vakil Sep 3 '18 at 5:39
  • I took your advice and now I monitor domain/robots.txt. Thanks. – Amin Vakil Sep 4 '18 at 10:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.