Service check script
Hello all,
I am tryng to write a short telnet script with no success.
Issue is to establish a telnet session every 10 sec to verify our service vs. a remote machin.
Thing is I do not need logon the remote machine ONLY telnet to port 13 ex: telnet xxx.xxx.xxx.xxx 13
it goes:
#####################################################
#!/bin/sh
logfile1=/tmp/telnet_mon.log
host=HOST
command1='telnet'
port='13'
cat /dev/null > ${logfile1} > /dev/null 2>&1
#
while :
do
${command1} ${host} ${port}|grep 2006 >> ${logfile1}
echo ------------------------------------------- >> ${logfile1}
sleep 10
done
######################################################
Problem is while running script in BG (&) mode, after one round script is DEAD by system (Suspended TTY):
[1] + Suspended (tty output) ./net_mon2.sh
OS is SUN solaris 9.
Please advise.
|