Forum Discussion
Could you just include the logic to restart the service in the existing datasource?
I've done something similar with a datasource collection. Checks to see if the service is running, tracks restarts, checks to see how long the service is up (didn't want to issue a restart if the service is starting due to a reboot), etc.
Regarding your direct question, I think you could automate it with Alert rules and Integrations (custom email delivery or custom HTTP delivery).
I'm sure others will have stronger suggestions.
- Kelemvor2 months agoExpert
I've always been told that LM doesn't have the ability to take any action based on an alert. If there's a way to have LM issue a Start Service command, when it sees that one has stopped, I'd love to know how to do that.
- befuddled2 months agoNeophyte
In which scenario?
The first I was talking about is taking the action in the datasource. For example, you have a Powershell datasource that checks to see if a windows service is running and if it's not, it restarts the service. I see your point that it isn't really based on an alert, but it's still doable and I've used it in basic situations to pretty good success. You could create an alert about restarting the service if you wanted to track restarts. If you go this route, I'd recommend you check server uptime (you don't want to re-start the service if the server was just rebooted and it hasn't been up long enough for the service to start).
The second would be to create an alert rule and an integration (specific alerts send to a specific integration). The integration is either a http or email delivery. You'd need to code the endpoint for the integration to take an action based on the alert. For example, a lambda function in AWS.Hope this helps. I'm sure you'll get other good (probably better) feedback.
Cheers!- Kelemvor2 months agoExpert
Oh. So I could make a PowerShell source that would be a script to check if the service was running, and start it if it wasn't, all within the script. So LM wouldn't be doing anything other than running the check every X minutes. The script would get the status of the service and run a start if it wasn't working?
That's a near idea. Are there docs on how to create a PowerShell DataSource? hmm.
Related Content
- 8 days ago