Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 

Host Availability Monitor - One-Liner

Danny
MVP Platinum
MVP Platinum

🎓 Quickly monitor a list of IP addresses
👉 Helpful during migrations or within troubleshootings
🚀 Linux / MacOS version available here

One-liner (PowerShell) to quickly monitor Ping, HTTPS, SSH for a list of IP addresses.

Simply add your IPs to the one-liner below and run it in PowerShell:


    $ips="10.10.10.1","10.10.10.2","10.10.10.3","10.10.10.4","10.10.10.5","10.10.10.6","10.10.10.7";function t($i,$p){try{$c=New-Object System.Net.Sockets.TcpClient;$r=
...;
TO ACCESS CHECKMATES TOOLBOX it's simple and free

Disclaimer: Check Point does not provide maintenance services or technical or customer support for third party content provided on this Site, including in CheckMates Toolbox. See also our Third Party Software Disclaimer.




5 Replies

the_rock
MVP Platinum
MVP Platinum

Excellent!

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free


0 Kudos

Nice one!  👍
If you allow: This would do the same in Linux/MacOS

ips=("10.10.10.1" "10.10.10.2" "10.10.10.3");t(){ timeout 0.2 bash -c "cat < /dev/null > /dev/tcp/$1/$2" 2>/dev/null && echo true || echo false;};while true;do echo -e "\n\e[33m$(date '+%Y-%m-%d %H:%M:%S')\e[0m";for ip in "${ips[@]}";do ping -c 1 -W 1 $ip >/dev/null 2>&1 && ping=true || ping=false;h=$(t $ip 443);s=$(t $ip 22);echo -ne "\e[36m$ip\e[0m | Ping: ";[[ $ping == true ]]&&echo -ne "\e[32m$ping\e[0m"||echo -ne "\e[

...;
TO ACCESS CHECKMATES TOOLBOX it's simple and free


the_rock
MVP Platinum
MVP Platinum

Its great! I just tested it on few machines, worked like a charm.

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free


0 Kudos

the_rock
MVP Platinum
MVP Platinum

Just tested it with 8.8.8.8 and works well.

PS C:\WINDOWS\system32> $ips="8.8.8.8";function t($i,$p){try{$c=New-Object System.Net.Sockets.TcpClient;$r=$c.BeginConnect($i,$p,$null,$null);if(-not $r.AsyncWaitHandle.WaitOne(200,$false)){$c.Close();return $false};$c.EndConnect($r);$c.Close();return $true}catch{return $false}};while($true){Write-Host "`n$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')" -ForegroundColor Yellow;$ips|%{$ping=Test-Connection $_ -Count 1 -Quiet;$h=t $_ 443;$s=t $_ 22;W

...;
TO ACCESS CHECKMATES TOOLBOX it's simple and free


0 Kudos

CheckPointerXL
Advisor
Advisor

awesome!

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free


0 Kudos