Oracle Database, Fusion Middleware, Linux

Validate connection to remote host – Sprawdzanie łączności z hostem

  • A simple connection test to a remote host…


#ping waits n of seconds 

ping -c $n_sec $REMOTE_HOST_IP >/dev/null   

if [ $? -eq 0 ]; 
  then echo "Ping OK" 
  else "Host is not available" 







  • and the other way, below script will check the connection and after 30 seconds will write the result to root session screen if connection cennot be established, nice small network monitor which can be executed by crontab, for instance.



#!/bin/bash   /bin/ping -c1 -W30 >/dev/null 2>&1   if [ $? != 0 ]; then write root < /root/noconnect #in this file we write the messages to be displayed fi   #END-SCRIPT#






(Visited 14 times, 1 visits today)

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.