views:

143

answers:

5

Hello

I am working on a legacy product which has seven Windows services and a user interface. There are some bugs in the services which causes crash in every 10-15 days. I need to write an application to monitor the state of the services. If the services get crashed I need to send an e-mail to the administrator to start the services.

I am not able to use the auto recovery process since during some of the crashes, the Microsoft error report dialog or some other dialogs appears and the service is consider running till the message is acknowledged.

So, I am planning to go for this individual application / watch-service to monitor the crashes until the bugs in the original services are completely fixed.

Please share your views on the design of the watch-dog service.

Thanks.

+2  A: 

From you question I understood that windows can't tell if the service ends because it shows a dialouge. If windows can't detect that the service has shutdown how is another application.
you will have to find so evidence that the process is doing what is supposed to do. checking that a log file is growing or seeing if events are being written is the simplest thing off hand.

rerun
A: 

Funny how you need to hand-edit the registry to disable Drwatson and there's a commandline to enable it back ;) here, check this Microsoft KB: http://support.microsoft.com/kb/188296

Eddy
Ok, I was sarcastic but did the moderator follow the link? It contains instructions to disable Dr Watson
Eddy
A: 

If you cannot fix those services but can "expose" them as an HTTP resource on Internet, you can use online website monitoring services to periodically check if the service(s) are still on. Create a small website that knows how to "ping" your service(s) locally and request its page(s) on a schedule by one of those monitoring services.

I know several of such services: http://www.setcronjob.com/, http://www.webcron.org/, http://scheduler.codeeffects.com. The last one can even monitor your HTTP resources on your private network but this feature is not free. Hope this helps.

Regina
+1  A: 

You're question suggests that windows service recovery does not get triggered because of a an error dialog not being clicked. Perhaps what you need is something to detect that the error dialog is open and click the button. This way, the service can exit successfully and windows service recovery can kick in.

I have attached a program I use to automatically click annoying clearcase dialogs. Below is a sample config file that drives the program. All you need to do is to add a new line of clickInfo and fill in the correct window and button captions.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="clickConfiguration" type="ClickButton.ClickConfigurationSection, ClickButton"/>
  </configSections>
  <clickConfiguration>    
    <clickInfo windowName="ClearCase" buttonName="Proceed" />
  </clickConfiguration>  
</configuration>

Hope it helps!

jake.stateresa
This one helped..
bdhar
A: 

Hi bdhar.

Service Protector (http://www.coretechnologies.com/products/ServiceProtector) will automatically restart your services when they crash, hang, or pop up one of the infamous Microsoft error report dialogs. You can try it free for 30 days.

Good luck!

CoreTech