techresearch7777777
New Member
- Joined
- Mar 19, 2020
- Messages
- 5
- Thread Author
-
- #1
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.
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.
Solution
I would just have a powershell script that runs every 5 minutes or so.
You can make the script more intelligent if needed, but this is just a very basic one.
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.
- Joined
- Jul 4, 2015
- Messages
- 8,998
I would just have a powershell script that runs every 5 minutes or so.
You can make the script more intelligent if needed, but this is just a very basic one.
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.
Solution
techresearch7777777
New Member
- Joined
- Mar 19, 2020
- Messages
- 5
- Thread Author
-
- #4
Thanks for the replies.
ussnorway, what do you mean by BS stops?
ussnorway, what do you mean by BS stops?