reset - How do you get the current failure count for a windows service -


I have a service that will fail when some resources become unavailable. I have configured it to try to restart it twice, then send me an SMS on the third attempt. Unfortunately the window only gives you the option of resetting the number of failure after a certain number of days , while I actually want to reset it to every third failure. The problem is that once the service is running again, one more failure will cause it to not send another SMS and also try not to restart the service.

Then I want to include my SMS script to reset some code failure counters. I have found the following registry location:

HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \

Which other things are included as far as settings for (Binary) failure tasks, but no As the counter I can tell.

SC does not return a failure count, lets you query all types of stuff, but it also does.

Ideally I would like to query a way to reset the / failing counter of the program after a command line or registry solution will be ok (since I can script them).

The Win32 API allows you to specify the number of failures, after the number of x again Reset, no number of x Look at the dwResetPeriod members of the SERVICE_FAILURE_ACTIONS structure. Failure to counter itself

One, that is maintained internally within the SCM, who knows how many times a failed service has failed since Windows was removed. That is not available for manually resetting the counter application, or even for queries.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -