Open adamdriscoll opened 4 months ago
My department has been looking at how to push work to remote servers from a more centralized approach and we considered using this feature. Specially we are looking at how to run a remote service that reports back data. Having it built in to PSU would be huge for us! As of now we are looking at a bunch of windows tasks to make API calls. It works, but more work.
One issue we aren’t sure there is a workaround for is the eventhubclient.json being in the clear on remote computers. This is a security issue for us. Having options to store connection data securely would be good for more locked down corporate environments. Something like local PS vaults.
Just some additional ideas here:
Specify in the eventHubClient.json
an automatic refresh interval, in seconds or minutes or whatever, in the event of a disconnection event, where the service will automatically attempt to reconnect without requiring a restart of the service. Potentially related to this could be an additional facility for the existing "Connections" to be reactivated instead of constantly filling up the connections list with disconnected agents.
Define an event handler for when event hubs connect or disconnect, or potentially reconnect, that could fire off additional endpoints
Summary of the new feature / enhancement
We should improve event hubs. They are ok but we really could take advantage of them much more.
Run Scripts on Event Hub Clients
It would be cool to run scripts directly on connected event hub clients. We need to take licensing into consideration here and it's a bit more involved than just running the PS1 if we want all the interactivity of a script run directly in PSU. That said, we could keep it simple and just run the PS1 and get the output and not worry too much about the rest of the job implementation.
Event Hub Client Communication To Server
It would be cool if the event hub client could make calls back to the server for reasons. This could allow events to be sent from the client to server when certain things happen. It's possible to do this with our current API implementation but having a running service could allow for the event hub to register events and then send the data up the web socket without having to worry about additional authentication.
Named Functions on Server and Client
SignalR supports named methods for both client and server. This means that event hubs could register functions in both directions. For example, if you wanted to invoke the Xyz function on a client, you would do something like:
This would allow for providing far more functionality without having to create event hubs for each function. It would also be cool to register an event hub like this with a module rather than a PS1 script.
Proposed technical implementation details (optional)
No response