Skip to content

Instantly share code, notes, and snippets.

@mikelwellsmore
Created October 16, 2023 01:15
Show Gist options
  • Save mikelwellsmore/bbc6bcb63efc5c56f9fe7c41485dbdb2 to your computer and use it in GitHub Desktop.
Save mikelwellsmore/bbc6bcb63efc5c56f9fe7c41485dbdb2 to your computer and use it in GitHub Desktop.
🔍Check-Ping
#Enter in the format of 'X.X.X.X' between brackets one per line. You can enter a single IP also.
$IPs = @(
'1.1.1.1'
'8.8.8.8'
)
#Enter Alert Severity level
$Severity = '3' #Warning if fail
################ Edit Above ################
Foreach($IP in $IPs){
#Ping IP. Alert if fail.
if(!(Test-connection $IP -Quiet)){
$AlertText = "IP '$IP' Failed to Ping"
GoreloAction -Alert -Severity $Severity -Text $AlertText
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment