#!/bin/sh host=$1 sleeptime=2; if [ "$host" = "" ]; then host="alaska"; fi; echo "Monitoring ${host} with ${sleeptime} seconds between polls" PING="ping -n 1 ${host}" retval=0 while [ 1 ]; do eval ${PING} > /dev/null retval=$? if [ $retval -eq 0 ]; then echo `date +"%D %r"` "${currtime}: ${host} still up" else echo "MsgBox \"Host ${host} down!!!\"" > test.vbs ./test.vbs echo "Press enter to continue" read fi; sleep ${sleeptime} done