[root@logserver sbclog]# cat checksbc1.sh #!/bin/bashnport=`echo ""|telnet 10.134.41.1 23 2>/dev/null|grep "\^]"|wc -l`if [ "$nport" -eq "0" ];thenmail -s 'xxxxxx' xxxxxxx@163.com < /home/sbclog/sx30001/check.txt fi

用telnet检查服务端口是否打开