wombat.ch

your Partner for Network Design and CMS

If Ping fail do a action



  #!/bin/bash
IP='192.168.1.1'
fping
-c1 -t300 $IP 2>/dev/null 1>/dev/null
if [ "$?" = 0 ]
then
    echo
"Host found"
else
    echo
"Host not found"
fi
 
     
 

ping -c4 10.18.23.1 > /dev/null

if [ $? != 0 ]
then
echo "No network connection, restarting wlan0"
/sbin/ifdown 'wlan0'
 sleep 5
 /sbin/ifup --force 'wlan0'
 fi

 
     
will check the feedback 0 or 1 ping 10.147.42.63 ; echo $?  
     
  #   vi /usr/local/bin/vm162restart.sh  
  #!/bin/bash
IP='192.168.1.1'

ping -c4 $IP > /dev/null

if [ $? != 1 ]


then
    echo "Host found"
else

echo "host not found - restart...."
   qm reset xxx
   qm resume xxx
   qm start xxx
fi 
 
  #   chmod +x /usr/local/bin/vm162restart.sh  
     
     
  #!/bin/bash

status_code
=$(curl --write-out %{http_code} --silent --output /dev/null www.bbc.co.uk/news)

if
[[ "$status_code" -ne 200 ]] ; then 
      echo
"Site status changed to $status_code" | mail -s "SITE STATUS CHECKER" "This email address is being protected from spambots. You need JavaScript enabled to view it." -r "STATUS_CHECKER"

else

      exit
0

fi
 
 
  url='http://localhost:8080/'
status
=$(curl --head --location --connect-timeout 5 --write-out %{http_code} --silent --output /dev/null ${url})
[[ $status == 500 ]] || [[ $status == 000 ]] && echo restarting ${url} # do start/restart logic 
 
     

RSS Feed


Warning: Invalid argument supplied for foreach() in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 39

Warning: Invalid argument supplied for foreach() in /var/www/clients/client2/web2/web/j/modules/mod_jw_srfr/helper.php on line 39

neusten Links


Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/clients/client2/web2/web/j/modules/mod_quicklistweblinks/helper.php on line 78
many More Links »

part of ...

Linux Counter

Disqus

 

Learning Network

Seti@home & Boinc

myBonic

statistik

 


Who is Online

We have 342 guests and no members online

We have 394 guests, no bots and no members online