I would like do create a flow service (wM 7.1.2), which checks whether/which ports currently exist and which ones are currently enabled.
Is there a way to do this from a flow service?
I did not find anything in the documentation (except for pub.event:portStatus and pub.event:portStatusInfo - which do not really help me).
I would start from dsp page and the services called underneath it to display the ports
Looks like ISAdmin–>ports interface is calling security-ports.dsp page in which wm.server.ports:listListeners service is being called to retrieve different types of ports
You can copy the above service and build your custom code around it
Keep in mind that if you do as Anil suggests (and we all do this sort of thing from time to time!) wM will not support you in any way if there are issues with using those services.
I will follow the suggestion of Anil - being aware of the fact that this is not officially supported (the fact that this service is not listed in the developer may have reasons…)
Since we will not use the service for anything productive or production critical but rather for monitoring, we should have no problem with that.
Background: We have an email port. Now it happened that the webMethod server had to be restarted. During restart the email server was shortly not available. Thus (at least that’s how we interpret it) the port was never activated (although being active before wM restart). This caused quite some troubles, thus from now on we want to monitor the status of our ports.
These services are in WmRoot package and for listing them on developer you need to change the variable “watt.server.ns.hideWmRoot” to false.
For you requirement you might want to use:
WmRoot/wm.server.net.listeners:getListener — Get the state from there
WmRoot/wm.server.net.listeners:enableListener – If state is disabled from last service then invoke this service.
But as Reamon specified, this is not supported from SAG so better watch out n be cautious while you are creating the solution around the services in WmRoot package especially if you want to schedule them
My rule of thumb is to not set the watt.server.ns.hideWmRoot to false–it makes it too easy to inadvertently use undocumented/non-public services.
The easiest way to use such a service is to insert a FLOW step to invoke any other service. Then edit the properties pane to change the name of the invoked service to the desired service name.