Send email alert when particular Service goes into Stopped State?

Hello I have 3rd party monitoring App tool that has it's own particular sservice running within Services panel and needs to continue to run.

For some strange reason it sometimes gets stopped (maybe bug).

I recently successfully configured Task Schedule in regards for Event ID = 7036 & Source = Service Control Manager (service stopped state) using this site's instructions:

“Send an e-mail” -Windows Server 2012 Task Scheduler deprecated feature [SOLVED!]

But it's emailing me for other different services that has this Event ID and gets put into Stopped State while my 3rd party monitoring app service is good up and running.

Is there a way to filter only my 3rd party's app service on the email alerts or are there any other methods to achieve this?

Thanks in advance.
 

Neemobeer

Windows Forum Team
Staff member
I would just have a powershell script that runs every 5 minutes or so.
Code:
$service = Get-Service -Name "ServiceName"

if($service.Status -ne "Running") {
    Start-Service -Name "ServiceName"
    Send-MailMessage -To someone@something.com -From "Service.Monitor@something.com" -Subject "Service Halted" -Body "Service : X has stopped running, restarting service" -SmtpServer somesmtpserver
}
You can make the script more intelligent if needed, but this is just a very basic one.
 
Top