Answered
CFML to check my Server Status..
Hello,
I have 3 Name servers and 2 Web Servers and 1 SQL server all at seperate IP #'s. I have a admin toolset for several websites and I wanted to add a Status checker to alert the users if any given server was offline before they tried to admin their sites (Or disable functions that rely on file parity, etc.) At first I tried to find CFML to "ping" the servers but no luck. Then i thought I would skip the Nameservers check and just check the webservers. So I put a file on each server that I could cfinclude. Then i remembered I can't use an IP address with cfinclude. So I used an IFRAME to include the file from the IP/dir I wanted. I wrapped this in a cftry/cfcatch block, but of course the failure is page not found when the server is offline and is not a direct cfinclude. So if I cfinclude a page with a IFRAME call to an IP addressed page and the server is down I get a broken IFRAME. Is there any CGI var or CFML readable info in a 404 return I can check for to report failure, rather than missing page error? OR, is there an easier more intelligent way to do this? See my current code below:
I have 3 Name servers and 2 Web Servers and 1 SQL server all at seperate IP #'s. I have a admin toolset for several websites and I wanted to add a Status checker to alert the users if any given server was offline before they tried to admin their sites (Or disable functions that rely on file parity, etc.) At first I tried to find CFML to "ping" the servers but no luck. Then i thought I would skip the Nameservers check and just check the webservers. So I put a file on each server that I could cfinclude. Then i remembered I can't use an IP address with cfinclude. So I used an IFRAME to include the file from the IP/dir I wanted. I wrapped this in a cftry/cfcatch block, but of course the failure is page not found when the server is offline and is not a direct cfinclude. So if I cfinclude a page with a IFRAME call to an IP addressed page and the server is down I get a broken IFRAME. Is there any CGI var or CFML readable info in a 404 return I can check for to report failure, rather than missing page error? OR, is there an easier more intelligent way to do this? See my current code below:
