Monitor and alert Windows Services status

As Technet Gallery is retiring so moving the code to Git Hub. (click below github download link for this script)

Monitor and alert Windows Services status

 

This script is extension of below script that can monitor the windows services from remote servers.

https://gallery.technet.microsoft.com/scriptcenter/Monitor-Report-5d1998d4

Now I have updated it to add a alert if services are not running.

Download and extract the script from above , update alerting parameters.

—————————————————————

$alert = “Yes” ###specify NO if you don’t want alerts

$report = “.\report.htm”

$smtphost = “smtp.test.com”

$from1 = “SystemsMonitoring@labtest.com”

$to = “VikasSukhija@labtest.com”

————————————————————-

Define variables to get services and servers data(example is in the download)

 

$EVServerList = Get-Content “.\EvServer.txt”

$EVServicesList = Get-Content “.\EvServices.txt”
$EVJserverList = Get-Content “.\EvJserver.txt”

$EVJservicesList = Get-Content “.\EvJservices.txt”
$EVDAserverList = ¬†Get-Content “.\EvDAserver.txt”

$EVDAservicesList = Get-Content “.\EvDAservices.txt”

—————————————————————

browse to the end of the script and call the function as below

servicestatus $EVServerList $EVServicesList

servicestatus $EVJserverList $EVJservicesList

servicestatus $EVDAserverList $EVDAservicesList

—————————————————————

You can schedule the the script to runevery 15 mins or as per your requirements.(don’t for get to remove the pause statement from the batch file)

Capture

 

Tech Wizard

https://techwizard.cloud

https://syscloudpro.com/

PowerShell Cheat Book

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s