I have a database table with several hundred servers in it that need to be checked on a daily basis. Basically just checking the IP channel from one location to another. I need a CF ping script that will return simply success or failure - no other information is needed - just yay or nay. I have a very simplistic script that I wrote that does the job but not very efficiently. Especially when servers fail the test. Does anyone have a superior script?
Code:
<cfset ipList = "[list of ip addresses]">
<table border="1">
<cfloop list="#ipList#" index="i">
<cfset ip="#i#">
<cfexecute
name="ping.exe"
arguments="#ip# -n 1"
timeout="5"
variable="results" />
<tr>
<td><cfoutput>#ip#</cfoutput></td>
<td>
<cfif results contains "Reply from #ip#">
<span style="color:green">Success</span>
<cfelseif results contains "Request timed out.">
<span style="color:red">Failed</span>
<cfelse>
Unknown
</cfif>
</td>
</tr>
</cfloop>
</table>