[sf-lug] done: Re: SF-LUG (short) outage this PM (sometime after 5pm)

Michael Paoli Michael.Paoli at cal.berkeley.edu
Fri May 24 22:21:29 PDT 2013


and done, bit under 3 minutes outage.

references/excerpts:

2013-05-25 03:01:42+00:00 up 208.96.15.252 80
2013-05-25 03:16:05+00:00 up --> down 208.96.15.252 80
2013-05-25 03:19:01+00:00 down --> up 208.96.15.252 80

$ cmp sf-lug/ck_sf-lug.com. sf-lug/ck_sf-lug.org. &&
> expand -t 4 < sf-lug/ck_sf-lug.org.
#!/bin/sh
exec ck_IP_tcpPORT 208.96.15.252 80
$ expand -t 4 < ~/bin/ck_IP_tcpPORT
#!/bin/sh
[ $# -eq 2 ] || {
     1>&2 echo "usage: $0 IP_address TCP_port"
     exit 1
}
IP="$1"
PORT="$2"
sleep=1
timeout=5
status=
while :
do
     if nc -w "$timeout" -z "$IP" 80; then
         # up
         case x"$status" in
             xup)
                 # no change in status
                 :
             ;;
             xdown)
                 # down --> up
                 echo $(TZ=GMT0 date +'%Y-%m-%d %H:%M:%S+00:00')  
"$status --> up $IP 80"
             ;;
             x)
                 # ??? --> up
                 echo $(TZ=GMT0 date +'%Y-%m-%d %H:%M:%S+00:00') "up $IP 80"
             ;;
         esac
         status=up
     else
         # timeout/down/refused
         case x"$status" in
             xdown)
                 # no change in status
                 :
             ;;
             xup)
                 # up --> down
                 echo $(TZ=GMT0 date +'%Y-%m-%d %H:%M:%S+00:00')  
"$status --> down $IP 80"
             ;;
             x)
                 # ??? --> down
                 echo $(TZ=GMT0 date +'%Y-%m-%d %H:%M:%S+00:00') "down $IP 80"
             ;;
         esac
         status=down
     fi
     sleep "$sleep"
done
$

http://linuxmafia.com/pipermail/sf-lug/2013q2/010037.html





More information about the sf-lug mailing list