User Tools

Site Tools


linux:bash:cara-monitor-port-down-up

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux:bash:cara-monitor-port-down-up [2021/09/18 09:24] (current)
kbadmin created
Line 1: Line 1:
 +====== BASH: Cara Memonitor Port Online atau Offline ======
 +Berikut ini adalah script untuk memonitor port down atau online yang biasanya kita lakukan dengan telnet. 
 +<code>
 +SERVER=gitlab.com
 +PORT=22
 +nc -z -v -w5 $SERVER $PORT
 +result1=$?
  
 +#Do whatever you want
 +
 +if [  "$result1" != 0 ]; then
 +  echo  'port 22 is closed'
 +else
 +  echo 'port 22 is open'
 +fi
 +</code>
 +Selamat mencoba.
 +
 +sumber : https://stackoverflow.com/questions/4922943/test-if-remote-tcp-port-is-open-from-a-shell-script

Layanan

Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |
linux/bash/cara-monitor-port-down-up.txt · Last modified: 2021/09/18 09:24 by kbadmin