Recovery Task - E-Mail notification
Hello, I´ve created a recovery task to start a service when it stops. This works fine so that the service runs. But I become no E-Mail notification of this. I want to kow when the Service were stopped and OpsMgr starts him. Best regards
April 15th, 2011 5:08pm

You could make your script send an email. Alternately, if the recovery runs in response to an alert, then you can subscribe to the alert. You won't be able to tell if the script was successful since there is no state change coming out of a recovery action.Microsoft Corporation
Free Windows Admin Tool Kit Click here and download it now
April 15th, 2011 5:35pm

OpsMgr has thrown an Alert that a service isn´t running. To this Monitor I´ve created a recovery task that runs a net start command. After this I tested this by stopping the service manually. OpsMgr starts the service so fast, that there comes no Alert in OpsMgr Console now. Therefore OpsMgr don´t send an E-Mail. It is brilliant that OpsMgr starts the service so fast, but threfore I become no notification. The notification is important for me because when OpsMgr must start the service once it is ok for me but when the service for example have to start every five minutes the administrator (thats me ;-) ) have to look why the service crashes so often. Is there no other solution than a script?
April 15th, 2011 6:16pm

Hi. Have you checked your closed alerts? You might be able to set the subscription to notify on both state New and Closed. This being a monitor my guess is that the alerts gets Closed when the Health state changes.. ie your recovery task starts the service and the monitor becoms healthy..mats.w | www.opsmode.com
Free Windows Admin Tool Kit Click here and download it now
April 16th, 2011 6:19am

I think mats.w offered the correct way here. Because the alert gets closed so fast because of the auto-restart-service you dont see the alert because it was not in the New state long enough. Either adding a mail-option in the script or trying to pick up the closed alerts as well would do the trick. Or to use the script you use to restart the service to write an event in the eventlog and picking that one up, but thats creating double entries and would be going too far to my opinion. Unless... unless you only want to know when this happens a number of times in a specific amount of time. You could use your recovery script to write a custom entry in the eventlog (event 666 - had to start the service again....) and create a monitor/rule that checks the log you write to for multiple entries of this same event within a specific amount of time and send you an alert that machine x has had to get services restarted for x times in the last x hours. This is not that difficult to do.Bob Cornelissen - BICTT (My BICTT Blog)
April 17th, 2011 9:12am

Thanks for the answers. The subscription already is set to send an E-Mail on both - New and Closed Alerts. I think I have to write a little skript that sends an E-Mail when it runs. It´s easier than the suggestion with the eventlog entry ;-) This with the skripts is very interesting. I´m new in OpsMgr. Can you tell me where I have to store the new skript? I want this for all my Servers. Is it possible to store the skript centrally on the RMS or must I copy the skript manually on each server?
Free Windows Admin Tool Kit Click here and download it now
April 18th, 2011 4:46pm

Well the eventlog entry is an easy one actually and you will use scom :-) and its an easy way to create a repeat rule that check for this event happening 5 times every day on a server and then fire (in stead of sending you emails for every single occurance, because these things do happen from time to time. When you created the recovery task you already had a form of script/command there. If you load it into the new task it will become part of the management pack. It all depends on how you do it. there are multiple examples of how to write an event to the eventlog from vbscript for instance. Or use your command file that does a net start service to also start a cscript write-event.vbs which is located somewhere. All depends on the type of task at hand. For more info you could check the tasks series of a friend of mine, Marnix Wolf over here http://thoughtsonopsmgr.blogspot.com/2010/08/scom-tasks-part-i-introduction.html . Good luck!Bob Cornelissen - BICTT (My BICTT Blog)
April 19th, 2011 3:45am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics