I need some help with creating a simple, but automatic site status (uptime/downtime) monitor script in ColdFusion.

Basically I would like the script to check if an application on my site is accessible or not every 60 minutes. If the application is down at 60 minutes, then I am sent an e-mail to my address.

If the application is working, then the script will check again in 60 minute to see if the application is up or not. And this cycle continues indefinitely without me having to have the page open.

Can anybody please help me with this? I am using ColdFusion 7.

Thank you
Mike

To create a script that monitors the status of your application and sends you an email if it is down, you can use ColdFusion's scheduled tasks feature. Here's a step-by-step guide:

Step 1: Create a ColdFusion template
Create a new ColdFusion template (e.g., statusMonitor.cfm) that will contain your monitoring logic.

Step 2: Add your application status check code
Inside the statusMonitor.cfm template, write the code to check the status of your application. You can use a simple HTTP request to verify if the application is accessible or not. For example:
```cfscript
// Replace 'http://example.com/application' with the actual URL of your application
var applicationURL = 'http://example.com/application';
var response = '';

try {
response = getHTTP(arguments.applicationURL);

// Additional checks if needed (e.g., check the response status code)

// Application is up, do nothing

} catch (any e) {
// Application is down, send an email notification
var mail = new mail();
mail.setSubject('Application is down');
mail.setTo('your');
mail.setFrom('noreply');
mail.setType('text/plain');
mail.setBody('The application is currently down.');
mail.send();
}
```

Step 3: Schedule the task
To run this script automatically every 60 minutes, you need to schedule it as a task on your ColdFusion server. Follow these steps:

1. Access your ColdFusion Administrator.
2. Go to the "Scheduled Tasks" section.
3. Create a new scheduled task.
4. Set the task to run the statusMonitor.cfm template.
5. Set the task to run every 60 minutes or adjust it as desired.
6. Save the scheduled task.

Now, your script will run automatically every 60 minutes to check the status of your application. If the application is down, an email notification will be sent to your specified email address.

Note: The specific steps to create a scheduled task may vary depending on your ColdFusion version and hosting environment. Consult the documentation or your server administrator if needed.