This is my Oracle SQL. I compare the "should have run" (last run plus schedule) to system date.
select CRONTASKNAME,INSTANCENAME,lastRun
,lastRun + decode(substr(schedule,instr(schedule,',')-1,1),'d',substr(schedule,1,instr(schedule,',')-2),
'w',substr(schedule,1,instr(schedule,',')-2)*7,'h',substr(schedule,1,instr(schedule,',')-2)/24,
'm',substr(schedule,1,instr(schedule,',')-2)/1440,'s',1/1440,
'M',sysdate - add_months(sysdate, - substr(schedule,1,instr(schedule,',')-2)),
'y',sysdate - add_months(sysdate, - substr(schedule,1,instr(schedule,',')-2)*12),
0) should_have_run
,decode(sign( sysdate - decode(substr(schedule,instr(schedule,',')-1,1),'d',substr(schedule,1,instr(schedule,',')-2),
'w',substr(schedule,1,instr(schedule,',')-2)*7,'h',(substr(schedule,1,instr(schedule,',')-2) + .5)/24,
'm',(substr(schedule,1,instr(schedule,',')-2) + 5)/1440,'s',5/1440,
'M',sysdate - add_months(sysdate, - substr(schedule,1,instr(schedule,',')-2)),
'y',sysdate - add_months(sysdate, - substr(schedule,1,instr(schedule,',')-2)*12),
0) - decode(CRONTASKNAME,'DTERECEIPTSUPLOAD',2/24,0)
- lastrun),-1,'ok','ERROR') status
,servername,substr(schedule,1,instr(schedule,'*,') -2) scheduled, description
from CRONTASKINSTANCE ,TASKSCHEDULER where ACTIVE =1
and TASKNAME(+) = CRONTASKINSTANCE.CRONTASKNAME||'.'||INSTANCENAME
and CRONTASKNAME != 'REPORTSCHEDULE' and lastRun is not null
order by status, should_have_run
------------------------------
James Beil
DTE Energy
------------------------------
Original Message:
Sent: 12-03-2024 15:17
From: Jared Schrag
Subject: How to Monitor for Overdue Crontask Instances
From time to time, we see the Crontask Instances for processing the outbound queues just stop executing on the defined schedule. Not sure why, but I thought it would be a good idea to create an Escalation for finding related Crontask Instances that are overdue for executing and define a new CommunicationTemplate to use for notification about these overdue Crontask Instances.
To my great frustration, Maximo does not allow creating Escalations for the CRONTASKINSTANCE object! Are there any good alternatives for implementing an overdue Crontask Instance notification scheme?
I suppose I could create a new Crontask that executes a custom Automation Script that does all of the checking and notifying. Does this community have other workable alternatives to achieve the same goal?
#Administration
------------------------------
Kind Regards,
Jared Schrag
Koch Ag & Energy Solutions
------------------------------