3

Hi, one of our Developers has asked for some script they can add to their deployment that will put a particular monitored service on a specific server into MM for a set amount of time and then check the status afterwards to make sure it is running. Has anyone got anything handy?

MatthewWalsh selected answer
    • Hi Matthew. Where do you plan to execute this script? Initating MM from the agent it self isnt possible unless you install/load the SDK assembly and query your management server through Powershell - Not ideal. If i read through the lines, this is a windows service monitored by SCOM and generates an alert when the server reboots etc because the monitored object/service is taking more time to load than the agent's healthservice?
    • Thanks for your reply. This is a custom Windows service that the developers stop, deploy code and then restart. The service is usually down for around 5 minutes which causes a service stopped alert and then a closed alert that they are trying to avoid. We can install the Ops Console on the machine they deploy from so they can use import-module Operations Manager,
    • You don't have to install the console, but you do need to load the module. You can copy the files out of your server and add them to a share or something. import the module with unc path, import-module \\myserver\psmodule\operationsmanager\OperationsManager.psd1 Another alternative is to run your script in a console task, but this isn't available trough squaredup or you can develop your own tool. Personally, depending on how often this happpens or if it's technically possible for the application, i… Continue reading
    • Thanks, I think that actually makes most sense. I'll just use the below. As this is a comment I can't mark as answer. sc config "Servicename" start=demand sc config "Servicename" start=auto
    • HI Matthew, in this scenario it would be great if you could answer your own question with the above and mark it as the best answer 🙂