API Calling from Ensemble?
I'm trying to develop monitoring API for the following requirements:
Component status - indicates whether the component (service, process or operation) up/enabled or down/disabled, and tell if there are more than two states (e.g. retrying, suspended)
Input: component name
Output: component state
Queue depth - indicates how many messages are in a queue.
Input: queue name
Output: number of messages currently in the queue
Last activity date - indicates the last time that a message was received by a component
Input: component name
Output: a date/time which corresponds to when the component last received a message
I went through Monitoring InterSystems IRIS Using REST API doco but it seems mostly backend. Is anyone or resource is working on fetching data from the interface? Any feedback is appreciated.
Use Ens.Director to get enabled/disabled and status:
set enabled = ##class(Ens.Director).IsItemEnabled(bh, .status)
Do you see it in SMP somewhere?
To get any component status, you may use:
To check queues you may use the following sql :
Then, iterate on the result set and get the queue depth by:
To check latest activiy on a component, I would go to the:
and then, to check the TimeProcessed