Sql query to find where is the machine is disconnected

Hello all
im trying to write a query to find if the AVD machine is disconnected for more than 5 minute
Or the job has been not running for example we had login issue

i can see everything on alert page in Orchestrator , but cant find the right table for all,
im trying to find ": job for process AUD incoming V1 on robot svcurobot-unattended failed. (#1680) for example

WITH CTE AS ( SELECT [Id], [TenantId], [UserId], [NotificationName], [EntityTypeName], [EntityTypeAssemblyQualifiedName], [EntityId], [CreationTime], [CreatorUserId], LAG([CreationTime]) OVER (PARTITION BY [UserId] ORDER BY [CreationTime]) AS PreviousCreationTime FROM [dbo].[NotificationSubscriptions] WHERE NotificationName IN ('Robot.StatusChanged.Offline', 'Robot.StatusChanged.Available') ) SELECT [Id], [TenantId], [UserId], [NotificationName], [EntityTypeName], [EntityTypeAssemblyQualifiedName], [EntityId], [CreationTime], [CreatorUserId], DATEDIFF(MINUTE, PreviousCreationTime, [CreationTime]) AS TimeDifference FROM CTE WHERE PreviousCreationTime IS NOT NULL AND DATEDIFF(MINUTE, PreviousCreationTime, [CreationTime]) > 5 ORDER BY [CreationTime] DESC;
any tips how to collect all
BR/HAzem

When it is about Orchestrator we would recommend to check out the Rest API first

hi, thanks for answering any direct link for it, i didnt use api on orch before

we recommend to learn / rnd / prototype it via Swagger

Thanks alot i will try to find how to authorize to there :slight_smile:

Yes thanks, but im using stand alone
An error message reading "Auth Error TypeError: Failed to fetch" is displayed above "Authorize" and "Close" buttons. (Captioned by AI)

i end up with this error

Hazem