I have a system (SP node) that I cannot telnet to at times. I can ping it but I cannot telnet to it. I need to write a korn shell srcipt that will alert me when users cannot telnet to this machine. I currently have the following:
#!/bin/ksh
host=sp18
telnet $host 1>/tmp/telnet.out 2>&1
foo=`grep respond /tmp/telnet.out`
if [ "$?" -eq "0" ] ; then
echo "Host $host does not respond"
fi
when the system is up and running and telnet is working fine, the script hangs. Can someone please help me get over this problem? Thanks alot
#!/bin/ksh
host=sp18
telnet $host 1>/tmp/telnet.out 2>&1
foo=`grep respond /tmp/telnet.out`
if [ "$?" -eq "0" ] ; then
echo "Host $host does not respond"
fi
when the system is up and running and telnet is working fine, the script hangs. Can someone please help me get over this problem? Thanks alot