I need to monitor 5 servers and a series of domain names. I've got a simple script running that shows whether each domain is up or down.
I'd like to make this more advanced and add some info to the domains that are down such as DNS error, timeout, server down etc. Using the scipt below is just returning (0) for everything and I've tested it on a variety of domains with known errors. Is this the correct command to be using or is there something else that will give me the real detail of why the domain is down?
$fp = fsockopen ($who, 80, &$errno, &$errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
}