coldfusioncoldfusion-9

Check health of scheduled tasks?


We recently had an issue where a ColdFusion scheduled task didn't resume after a Windows upgrade and a CF server restart. Is there a way to monitor the health of scheduled tasks and be alerted if they are not running properly? Or would I need to write a task to parse the log files for that information?


Solution

  • you can use the admin api to get information on your scheduled tasks. the following returns an array of structures with info about each scheduled task. you can then loop through the array and look at the last_run variable.

    <cfset arySchedTasks = createobject("java","coldfusion.server.ServiceFactory").getCronService().listall() />