Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

can we create report to identify the jobs that is still running since last 6 hours.

WeAreVoid
New Contributor III
New Contributor III

for proactive monitoring we want to create report and show it on Saviynt dashboard. so we can identify the stuck report. can we create report to identify the jobs that is still running since last 6 hours.

4 REPLIES 4

rushikeshvartak
All-Star
All-Star

 

SELECT FROM_UNIXTIME(fired_time / 1000) AS start_time, NOW() AS CurrentTime, TIMESTAMPDIFF(HOUR, FROM_UNIXTIME(fired_time / 1000), NOW()) AS RunningTime_Hrs, trigger_name, job_name FROM qrtz_fired_triggers WHERE DATE_ADD(FROM_UNIXTIME(fired_time / 1000), INTERVAL 4 HOUR) < NOW()

Long Running jobs 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

WeAreVoid
New Contributor III
New Contributor III

Hi this query is throwing error:

[0]: index [testprameet], type [analytics], id [kW8Vw5EBzguAZzZOjH_K], message [ElasticsearchException[Elasticsearch exception [type=mapper_parsing_exception, reason=failed to parse field [start_time] of type [date] in document with id 'kW8Vw5EBzguAZzZOjH_K']]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Invalid format: 2024-09-04 21:11:57.846" is malformed at ".846"]];]"

SELECT 
  DATE_FORMAT(FROM_UNIXTIME(fired_time / 1000), '%Y-%m-%d %H:%i:%s') AS start_time, 
  NOW() AS CurrentTime, 
  TIMESTAMPDIFF(HOUR, FROM_UNIXTIME(fired_time / 1000), NOW()) AS RunningTime_Hrs, 
  trigger_name, 
  job_name 
FROM qrtz_fired_triggers 
WHERE DATE_ADD(FROM_UNIXTIME(fired_time / 1000), INTERVAL 4 HOUR) < NOW()

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

stalluri
Valued Contributor II
Valued Contributor II

@WeAreVoid 

 We are using minutes to calculate the value of job time and works for us.

 

SELECT 
    DATE_FORMAT(FROM_UNIXTIME(fired_time / 1000), '%Y-%m-%d %H:%i:%s') AS start_time,
    TIMESTAMPDIFF(MINUTE, FROM_UNIXTIME(fired_time / 1000), NOW()) AS RunningTime_Mins,
    trigger_name,
    job_name
FROM 
    qrtz_fired_triggers
WHERE 
    TIMESTAMPDIFF(MINUTE, FROM_UNIXTIME(fired_time / 1000), NOW()) >= 30 -- Put in minutes values here.
 

 

Screenshot 2024-09-05 at 1.36.36 PM.png





Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.