User Tools

Site Tools


linux:bash:cara-monitor-port-down-up
no way to compare when less than two revisions

Differences

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


linux:bash:cara-monitor-port-down-up [2021/09/17 22:24] (current) – created kbadmin
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/17 22:24 by kbadmin

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki