elenabul Posted August 12, 2008 Posted August 12, 2008 I would like to know how I can set up a notification in order to send me an e-mail if some service stop running. The reason for that question is:I have report server running on a particular virtual machine running Windows 2003. This morning I discovered that the service is not running, so the report server is not accessible.I would like to be able to setup a notification if that happens?Thank you in advance, Helena
cluberti Posted August 12, 2008 Posted August 12, 2008 It's not possible with the inbox tools in the service manager, but 3rd party software (including Microsoft's System Center Operations Manager) can do such a thing. However, you could write a script that runs from task manager on set intervals to check service status and do something based on the check result, and that would probably work just fine.
Mr Snrub Posted August 12, 2008 Posted August 12, 2008 On Windows Server 2003:If the service is exiting abnormally (crashing) then you can use the Recovery tab on the properties of the service, you can specify an action for first failure, second failure and subsequent failures from:- Take No Action- Restart the Service- Run a Program- Restart the ComputerThe typical setup would be to select Restart the Service, but if you're having frequent/regular crashes then it would make more sense to fix the cause rather than workaround the symptom.In terms of being notified when the problem occurs, you could use something like BLAT to send an email from the command line via the "Run a Program" entry.Tip: If you want to send an email or SNMP trap via "Run a Program" AND attempt to restart the service, then you can create a batch file to run "net start servicename" after sending the alert.I've used the batch file with BLAT & NET START solution a few years ago to good effect for NLB web servers, as NLB is not application-layer aware and will still try to send (e.g. HTTP) connections to servers where the IIS service is not running but the server itself is up.This is for a "per-service, on-failure" solution - if you want a periodic health check of numerous services then cluberti's suggestion makes more sense : you could parse the output from "SC QUERY" for specific services and check the STATE field is RUNNING for those, or probably use WMI in a neater solution.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now