Report to show currently running tasks.
search cancel

Report to show currently running tasks.

book

Article ID: 171824

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

While troubleshooting performance issues or problems with tasks being delayed or not starting/running correctly, it may be helpful to view the currently running tasks.

The following SQL query will show the currently running task reports. There is also an attached XML that can be imported as a report.

 

Environment

ITMS 8.x

Resolution

declare @taskType as nvarchar (10)
 set @taskType = '%taskType%'
 SELECT 
 i.Guid AS '_ItemGuid'
 ,'Task Name' = coalesce(i.Name, '[Data not available]')
 ,tiis.name as "Run Instance Name"
 ,tiis.ExecutedBy as "Executed By"
 ,'Start Time' = coalesce (CAST(s.StartTime AS VARCHAR), '[Data has been Purged]')
 ,'Target Device' = coalesce (vci.Name, '[Could not retrieve]')
 ,'InstanceType' = 
 case ti.[InstanceType]
 when 0 then 'Server Task'
 else 'Client Task'
 end
 ,'Status' =
 CASE CAST(tis.[InstanceStatus] AS varchar)
 WHEN '1' THEN 'Running'
 WHEN '2' THEN 'Completed'
 WHEN '3' THEN 'Failed'
 WHEN '4' THEN 'Stop Requested'
 END
 from [TaskInstances] ti 
 left outer join [TaskInstancesStarted] s on s.[TaskInstanceGuid] = ti.[TaskInstanceGuid] 
 left outer join [TaskInstanceStatus] tis on tis.[TaskInstanceGuid] = ti.[TaskInstanceGuid] 
 left outer join [TaskInstanceResults] tir on tir.[TaskInstanceGuid] = ti.[TaskInstanceGuid] 
 --left outer join [TaskInstanceExecutionInfo] tiei on tiei.[TaskInstanceGuid] = ti.[TaskInstanceGuid]
 left outer join [TaskInstanceSummaries] tiis on tiis.TaskInstanceGuid = ti.TaskInstanceGuid
 LEFT OUTER JOIN vRM_Computer_Item vci ON vci.Guid = ti.ResourceGuid
 LEFT JOIN ItemVersions iv ON iv.VersionGuid = ti.TaskVersionGuid
 LEFT JOIN Item i ON i.Guid = iv.ItemGuid
 WHERE (tis.InstanceStatus = 1 OR tis.InstanceStatus = 4)
 AND ti.InstanceType like @taskType
 ORDER BY [InstanceType] DESC, [Target Device] DESC, tiis.[StartTime] DESC





For 8.6 and later

On recent releases, it is no longer needed for Customers to perform SQL queries to find what tasks are running or drop task instances in case those are hung. A customer can use the default mechanism to purge the required amount of task instances, task versions, etc. under Settings>All Settings>Notification Server>Task Settings:


When purging for task instances is started, then there is a set of stored procedures will be executed, like tmDeleteOrpanedTaskInstances, tmDeleteOrpanedTaskInstanceParents, tmDeleteOrpanedTaskOutputPropertyValue, and tmDeleteOrpanedTaskInstanceResultSummaries.

  


If the Customer is logged in to SMP Console using the default "Symantec Administrators" role, then on any opened task, there is a link to "view recent tasks". From this view, the Customer can multi-select and delete/stop unnecessary task instances 

  

Attachments

Currently Running Known Tasks.xml get_app