How to get the specific production component status like (Running, stopped, Inactive, etc...) in programatically.
Actually, I want to know specific production component status. I used "Ens.Config.Production" to get the status of component. But it will return only the component enabled/disabled. Anyone is having any Idea to get the specific production component status?
Comments
To retrieve the current status (e.g., Running, Stopped) of a specific production component programmatically, you can follow these approaches:
Using
Ens.Util.Statisticsto Check Job Status: Utilize theEns.Util.Statistics.EnumerateJobStatusquery to get the connection status of the component. Below is an example code snippet:ClassMethod GetConnectionStatus(pItemName As %String) As %String { Set tStatement = ##class(%SQL.Statement).%New() Set tStatus = tStatement.%PrepareClassQuery("Ens.Util.Statistics", "EnumerateJobStatus") If $$$ISERR(tStatus) { Return "Error in Status Query: "_$system.Status.GetErrorText(tStatus) } Set tRS = tStatement.%Execute(pItemName) If tRS.%SQLCODE = 0 { Do tRS.%Next() Return tRS.%Get("AdapterState") // This returns the status such as "running" or "stopped" } Return "Status not Found" }This class method takes the item name as input and fetches the current job status [1].
Query
Ens.Job.Enumerateto Get Job Status: You can directly query theEnsure.Job_Enumerateto see the status of your Business Operation. Here’s an example SQL-based method:&sql(SELECT Status INTO :JobStatus FROM Ens.Job_Enumerate() WHERE ConfigName='YourComponentName')This will return job statuses like
Running,DeQueuing, etc., which correspond to the state of the component [2].
These methods allow inspection of the real-time status of the component beyond the enabled/disabled state.
Sources:
look at Ens_Config.Item there is a property called "Enabled"
Hi @Yaron Munz
I already tried that one, but I need the legend status of the production.
aha I got it. then look at class: EnsPortal.SVG.ProductionConfigurationLegend
##class(Ens.Director).GetProductionStatus() will tell you if the production state is running/stopped/suspended/troubled.
Documentation:
https://docs.intersystems.com/iris20241/csp/documatic/%25CSP.Documatic…
This was return the entire production status. But I need to know the specific component status from the production.
Thanks for your efforts ☺️
I think you are mixing hosts (production component) and jobs.
A host can be enabled or disabled, when a host is enabled there are a number (PoolSize) of jobs and each job has a status.
You can view/list the status/details of production jobs in the Management portal Interoperability -> Monitor -> Jobs.
You already know how to get if an host is enabled/disabled, to get the status of all jobs you can use the query Enumerate in the Ens.Job class, to test it:
Set rs=##class(Ens.Job).EnumerateFunc()
Do rs.%Display()