Gateway Monitoring
Monitoring is a feature which lets you perform arbitrary actions based on the state of channels and devices in your system.
For example, you could generate a ticket for support when a channel in a specific tab is stopped for more than 1 hour. Or, scrape message counts and performance data for specific channels and forward that to a metrics stack.
As this feature is based on the Custom Code control, there is a lot of scope for including other functionality - whether from .NET, Nuget, or your own assemblies.
Save button (ctrl + S)Next, switch to the Monitoring tab and review the API. In the image below is an example of looping through each statistic exposed. Note that statistics are nested by Group, Remote Agent, Tab, Channel, and then device - mirroring the layout of the management user interface. Note that a number of the exposed objects are dictionaries, so you can access directly by key, if desired.
By default, the OnStateChangedAsync callback is only invoked when state or statistic information changes, and only contains the changed objects. This means when the Gateway service first starts, your code will receive all statistics once, and subsequently only receive deltas.
If you want all statistics included with every invocation of OnStateChangedAsync, set the Reset property to true on the StateChangedEventArgs object.
You can use the Groups & Remote Agents tab to restrict the objects included in the OnStateChangedAsynccallback.