I wanted a basic ping monitor that could be used with Powershell, and found the following:
This function can be Dot Sourced, see my article here.
You will need to unblock the script if you downloaded it, see my article here.
You can set the notification to trigger on ping down (-NotifyOnServerDown), ping up (-NotifyOnServerBackOnline), or both (-NotifyAll).
You can set the timeout on the ping using -sleeptimeout
An example usage would be:
start-monitor -computername QLD_CPS_24 -NotifyAll -smtpserver smtp -tonotification firstname.lastname@example.org -fromnotification email@example.com
You can take a list from a file (1 name / ip per line) using the pipeline:
get-content Monitorlist.txt | start-monitor -NotifyAll -smtpserver smtp -tonotification firstname.lastname@example.org -fromnotification email@example.com
When the script is running, it looks like:
The up / down notifications look like: