Service Watch-dog design - windows-services

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.

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.

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!

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.

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

Related

Disable Scheduled Publishing in Umbraco

I'm trying to disable the scheduled publishing in Umbraco but can't find any settings and can't find any posts mentioning how to do this.
Is this possible within 7.2.8?
Thanks
There is no explicit way to disable scheduled publishing that I'm aware of. You can stop it from working by making sure the web server can't resolve it's own address, that will stop scheduled publishing from occurring, but will fill your log files full of errors.
Another option would be to inject a stylesheet into the back office and hide the scheduled publishing fields.

dashDB service not repsonding?

Last night, I was receiving memory issues for some of my queries (inner joins on multiple tables) against my dashDB service on Bluemix. Today, I cannot even access the dashDB service.
When I access my project instance on Bluemix, using my web browser, and choose my dashDB service, I am presented with a grey page and a white spinning wheel. I never get past that.
Is there an issue with dashDB in general? Could it be just my instance of it? Any way to fix it?
Thanks in advance!
Dan
It doesn't appear to be any general problem as shown at https://developer.ibm.com/bluemix/support/#status
I advice to open a ticket to Bluemix Support.
You can do that using one of the following methods:
Use the Support Widget. It is available from the user avatar in the
upper right corner of the main Bluemix UI. After opening the support
widget panel, select Get Help > Get In Touch, select the type of
assistance you need, and then fill out the support form.
Use the Support Site 'Get Help' form. This form is available on a
separate site that is made available for ticket submission when you
cannot log into Bluemix and access the Support Widget. Go to
http://ibm.biz/bluemixsupport and fill in the support request form.

Running Growl as a Windows Service

Is there a way to run Growl as a Windows Service? I searched around SO, but have not found a solution, please let me know if there is one out there already.
The excellent link to AlwaysUp, provided by mservidio, clearly states that visual notifications will likely be a problem:
Note: When you run Growl as a Windows Service, it may not be visible on your desktop. This
may render the visual notifications useless but the non-visual notifications (email,
forwarding, etc.) should function normally.
I would guess that the reason for this is that growl will try to send notification to the user who started Growl... which is whatever is configured in your windows service, e.g. SYSTEM. Which means you won't see them, because growl doesn't run for your user session.
I have also been wondering how to direct notifications to specific users / sessions. There doesn't seem to be any documentation on this, so I must assume it's currently not supported.
Have you tried Microsoft's Srvany? Its pretty basic but should get the job done if your needs are the same.
This tutorial showing how to configure Growl with AlwaysUp should give you an idea of what to expect when running Growl as a Windows Service.

Nofity User some message from a windows service

I have created a windows service which gets soem info from database and I want to notify user based on the info retreived from the DB. How can I notify user from a windows service using system tray notification? Can you please show me some sample (using IPC mechanism) to get the return value of a method used in a windows service in a system tray notification?
Thanks in advance.
There are several options such as these:
Sockets: (Not too difficult to write, has firewall problems) You can find samples for it almost everywhere.
External WinForm: (The easiest method, has security problems and might blocked by
some antivirus apps) Just create a winForm with the ability to go into
the windows notification area and then tell the service to run its
exe file.
Named Pipes: (Probably the most difficult, but it's the recommended
solution) Here is a Code Project sample.
Other tricks like: Create a hidden winform project (ShowInTask=false) and put it in StartUp. provide it with a FileSystemWatcher object and make it watch for a certain file which the service creates or deletes it to signal the winform.

Msmq and WCF Service

I have created a WCF service using the NetMsmq binding for which i created a private queue on my machine and executed the project. This works fine as such and my WCF service is started and accesses the message using the queue in the debugging environment. Now, I wanted to host the service using the windows service and for the same I created a new project and windows installer as well (This service runs under Local System Account). Then I tried installing this windows service using the InstallUtil command through the command prompt. When installation is happening and during the service host opening, I get an exception saying:
There was an error opening the queue. Ensure that MSMQ is installed and running, the queue exists and has proper authorization to be read from. The inner exception may contain additional information.
Inner Exception System.ServiceModel.MsmqException: An error occurred while opening the queue:Access is denied. (-1072824283, 0xc00e0025). The message cannot be sent or received from the queue. Ensure that MSMQ is installed and running. Also ensure that the queue is available to open with the required access mode and authorization.
at System.ServiceModel.Channels.MsmqQueue.OpenQueue()
at System.ServiceModel.Channels.MsmqQueue.GetHandle()
at System.ServiceModel.Channels.MsmqQueue.SupportsAccessMode(String formatName, Int32 accessType, MsmqException& msmqException)
Could anyone suggest the possible solution for the above issue? Am I missing any permissions to be set for the queue as well as the windows service, if so could you suggest where should these permissions be added?
Tom Hollander had a great three-part blog series on using MSMQ from WCF - well worth checking out!
MSMQ, WCF and IIS: Getting them to play nice (Part 1)
MSMQ, WCF and IIS: Getting them to play nice (Part 2)
MSMQ, WCF and IIS: Getting them to play nice (Part 3)
Maybe you'll find the solution to your problem mentioned somewhere!
Yes, it looks like a permissions issue.
Right click on your private queue from the Server Manager, and select Properties. Proceed to the Security tab, and make sure you have the right permissions in there for your Local System Account.
This is also confirmed in Nicholas Allen's article: Diagnosing Common Queue Errors, where the author defines the error code 0xC00E0025 as a permissions problem.
I ran into same problem, here is the solution.
Right click "My Computer" --> Manage. In Computer Management window go to "Services and Applications --> Message Queueing --> ur queue", select ur queue and access properties. Add the user running ur WCF application and give full access. This should solve the issue.
Can simple be that the service can't find the it's queue.
The queue name must exact match the endpoint address.
Example:
net.msmq://localhost/private/wf.listener_srv/service.svc
points to local queue
private$\wf.listener_srv\service.svc
If queue name and endpoint are according to each other, then is most like that the credentials defined on the IIS pool don't grant access to the queue.

Resources