Forum Discussion
Adamzter81
Jul 31, 2024Copper Contributor
Powershell to Monitor Services
Hello, I have specific services that I would like to monitor on specific servers and send out alert if service is stopped. Below is a script that works for monitoring one service on a specific s...
- Aug 01, 2024
#Loop through all servers and services for each server
foreach ($servername in $servernames)
foreach ($ServiceName in $ServiceNames) {
If (Get-Service -ComputerName "$servername" -Name "$ServiceName") {
$ServiceStatus = Get-Service -ComputerName "$servername" -Name "$ServiceName"
$ServiceState = $ServiceStatus.Status
ServiceCheck
}
}
}
This checks if service is there, then checks status
Monitorpack
Nov 15, 2024Copper Contributor
Hello,
You can use this also https://www.monitorpack.com/help-en.php?page=support-informatique-en/how-to-create-service-alert-en.php
regards