I need some help with creating an automatic timing script with ColdFusion. Every 60 minutes I would like to see if a page on one of my servers (http://www.mysite.com/ALERT.cfm) is working or not.
If the page is down when it is checked, then it will check again in 5 minutes to see if the page is back up. If it is not back up, then I am sent an e-mail to email@mysite.com. If it is back up, then no action is required and we start the 60 minute cycle check again.
I now understand how to do one check, but not two.
So here is the CFschedule code I am using
<cfhttp url="http://example.com/testpagetocheck.cfm" method="get" >
<cfif cfhttp.statusCode neq "200 OK">
<cfschedule action = "update"
task = "TaskName"
operation = "HTTPRequest"
url = "http://www.example.com/ALERT.cfm"
startDate = "#createdate(2012,4,01)#"
startTime = "08:00 AM"
interval = "3600"
requestTimeOut = "10">
</cfif>
So say I have 4 pages - the page I want to check to see if it is down or not (testpagetocheck.cfm), page1.cfm which has the above code, ALERT.cfm which has the cfmail to send me a message if testpagetocheck.cfm is down, and then page2.cfm has the above code again, but with an interval of "once" and a start time of 5 minutes from now.
Page1.cfm to alertMe.cfm works like a charm. I am sent a message of the page being down. Page 2.cfm to alertMe.cfm also works beautifully. It also sends me a message the page I am checking is down. But, when I try to go from page1.cfm to page 2.cfm to alertMe.cfm, it does not seem like the cfschedule on page2.cfm is running so I end up not getting any mail when the server is dowm.
Can anybody please tell me what I am doing wrong? I am using CF7