[Building Sakai] Monitoring cron jobs for SIS feed files

Duffy Gillman duffy at rsmart.com
Thu Jan 13 08:02:53 PST 2011


For SAK-18864 [1], I modified the Scheduler API and implementation in a couple of ways that will be helpful. Events are now being logged persistently to a DB table. They used to be stored in memory and so were not persistent nor shared across a cluster. Quartz allows as many listeners as one might like, so I exposed the ability to add more listeners through the Scheduler API. I was actually working toward the "email results" functionality. I was intending to create an additional Quartz event listener for that purpose. I have only gotten so far as logging the events permanently to the database. I am fairly certain the emailing results will be a very small bit of work now.

Below are the pieces that I have in place and the direction I was headed:

1) I registered an event listener with the Quartz scheduler. It is called the NavigableEventLogListener and it implements two Quartz interfaces: JobListener and TriggerListener. It is capturing events and logging them to a new event log table.

2) I added a methods to the Scheduler interface which accept a Collections of listeners (setGlobalJobEventListeners(List<JobListener) and setGlobalTriggerEventListener(List<TriggerListener>)) and deprecated the old method which only took one listener. Now additional listeners may be added in the scheduler-component component.xml definition of the Scheduler implementation.

3) My hope was to create a EmailJobResultsListener to be registered after the NavigableEventLogListener. Its purpose would be to react to job completion or job failure events then fire off an email message. The message would contain the Job and Trigger details along with the events that NavigableEventLogListener had gathered.

4) Addresses for the email should probably be stored in the Trigger object itself. It contains a Map (called dataMap) that Quartz intends for storing any custom data related to the job or trigger.

5) Finally I was going to add fields to the Job and Trigger configuration screens for setting the email list. My thinking was something like:

		_x_ send email to administrator
		___ send email to users:
				+-----------------------------------------+
				| bob, ted, carol, alice, ...              |
				+-----------------------------------------+
		___ send email to these addresses:
				+-----------------------------------------+
				| booboobear at jellystone.gov    |
				+-----------------------------------------+

I intend to work on this when I have bandwidth, but am putting this out there in case anyone on this thread wants to take up the task. If someone else needs to move on this I'd love to be kept in the loop about what gets implemented.

Thanks,

   Duffy Gillman
   Sr. Software Engineer
   The rSmart Group, Inc.

[1] https://jira.sakaiproject.org/browse/SAK-18864 

On Jan 12, 2011, at 2:47 PM, Steve Swinsburg wrote:

> Hi Nathan,
> 
> It doesn't look like the current quartz jobs fire many events, but it wouldn't be too hard to patch them to fire an appropriate start and stop event. You could then setup an observer that watches the events and send off an email when they complete.
> 
> cheers,
> Steve
> 
> 
> 
> On 13/01/2011, at 4:53 AM, Nathan Finley wrote:
> 
>> Anyone know of a way to monitor the cron jobs being running by the Job Scheduler without having to go into the Job Scheduler?  Specifically, I’m looking for a way to be notified via email or SMS that the cron jobs have run successfully.  Any help would be great.
>> 
>> Thanks,
>> Nathan
>> ----- 
>> Nathan Finley
>> Learning Management Systems Administrator
>> University of the Pacific
>> Office of Information Technology – Enterprise Applications
>> Email: nfinley at pacific.edu
>> Phone: 209.946.7669
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org
>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>> 
>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
> 
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"



More information about the sakai-dev mailing list