TFS Job monitoring is possible using https://YourTFSServer/tfs/_oi . More information on this can be found on here.
I have had a look at this and found some indications of failures.
When I have a look at Job history I see the failure jobs.
Job history shown here says successful jobs are not shown. and there is no way to filter and see them in here.
“The grid below shows the job history results over the stated period of time (up to 500 entries). Below is the list of filters which may be limiting the data which is returned. By default, the successful jobs ARE NOT shows to minimize distractions when reviewing the results.”
I thought there should be a way to see them since it is coming from TFS Databases for sure. Ok what I am going to explain below is how to view success jobs as well, but this is accessing TFS DB, make sure not to change any data here. View information would not harm anything :)
First I needed to find the Job I am interested in “LabManager VMM Server Background Synchronization Job”. I went through the tables of TFS_Configuration database and found a “tbl_JobDefinition” table but the job was not there. Then I decided to explore each collection DB and there was another “tbl_JobDefinition”. I executed below query on that and found the Job Definition.
Query 1
-------------------------------------------------------------------------------------------------------
SELECT TOP 1000 [PartitionId]
,[JobId]
,[JobName]
,[ExtensionName]
,[Data]
,[EnabledState]
,[Flags]
,[LastExecutionTime]
,[PriorityClass]
FROM [dbo].[tbl_JobDefinition]
WHERE [JobName] = 'LabManager VMM Server Background Synchronization Job'
-------------------------------------------------------------------------------------------------------
Executed above for each collection and found that the jobid has same GUID for all the collections.
There was no Job History table in collection DBs. But in TFS_Configuration there is one. When tried with the GUID for “LabManager VMM Server Background Synchronization Job”, found the job history there, all successful and unsuccessful for the last one month period.
Query 2
-------------------------------------------------------------------------------------------------------
SELECT TOP 1000 [HistoryId]
,[JobSource]
,[JobId]
,[QueueTime]
,[StartTime]
,[EndTime]
,[AgentId]
,[Result]
,[ResultMessage]
,[QueuedReasons]
,[QueueFlags]
,[Priority]
FROM [Tfs_Configuration].[dbo].[tbl_JobHistory]
where [JobId] = '1039066B-8187-4831-BCB5-CFC981D98140'
order by [StartTime] asc
-------------------------------------------------------------------------------------------------------
I thought the Job Source should be the collection, Modified the query to link with “tbl_CatalogServiceReference, ”“tbl_CatalogResource” and “tbl_CatalogResourceType” got it confirmed.
Query 3
-------------------------------------------------------------------------------------------------------
SELECT TOP (1000) H.HistoryId,
H.StartTime,
H.EndTime,
H.Result,
H.ResultMessage,
CR.DisplayName AS Resource,
CRT.DisplayName AS [Resource Type]
FROM [Tfs_Configuration].dbo.tbl_JobHistory H
INNER JOIN
[Tfs_Configuration].dbo.tbl_CatalogServiceReference CSR
ON CSR.ServiceIdentifier = H.JobSource
INNER JOIN
[Tfs_Configuration].dbo.tbl_CatalogResource CR
ON CSR.ResourceIdentifier = CR.Identifier
INNER JOIN
[Tfs_Configuration].dbo.tbl_CatalogResourceType CRT
ON CRT.Identifier = CR.ResourceType
WHERE (H.JobId = '1039066B-8187-4831-BCB5-CFC981D98140')
ORDER BY H.StartTime
-------------------------------------------------------------------------------------------------------
If you are trying this out REMEMBER you are accessing TFS configuration and collection DBs. So BE CAREFUL not to edit any data.
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Dynamic block allows to create nested multi level block structures in terraform code. Conditional usage of such blocks are really useful in...
-
In Azure DevOps YAML pipelines there are several functions available for you to use. replace is such a useful function, which you can use t...
-
We have discueed, that we have to use an environment variable to handle input parameter default values, if we are using trigger for workflo...
-
Adding Azure Container Registry (ACR) service connection to Azure DevOps is really simple as described in " Create Service Connection ...
-
Some times a silly mistake can waste lot of time of a developer. The exception “System.IO.IOException: The response ended prematurely.” whil...
No comments:
Post a Comment