SQL query to list all items in a production and their status
Hello,
Is there a way to list all items in a production (incl their status/color) by using a sql query? This is for monitoring purposes.
Thank you in advance!
Regards,
Luk
Comments
You'll need a SQL procedure to return status. I haven't found it already SQL enabled.
ClassMethod ItemStatuses(pName, pIsRunning, pEnabled, pID) As %String [ CodeMode = expression, SqlProc ]
{
##class(EnsPortal.Utils).ItemStatuses(pName, pIsRunning, pEnabled, pID)
}After that just query Ens_Config.Item:
SELECT
ID,
ClassName,
Name,
Enabled,
ItemStatuses(Name, 1, Enabled, Id) Status
FROM Ens_Config.ItemParameter pIsRunning means a running production.
Procedure returns comma-separated info about host status and io status.
Thx for the quick answer. I am quite new to Ensemble. Where do I add the class method?
What query/method from Ens.Queue are you referring to?
You need to create a class, for example. Test.EnsUtils, in it add this class method.
After that execute the query above (name of the sql procedure would be Test.EnsUtils_ItemStatuses)
Have you looked into ens.queues