echo -e '\x1dclose\x0d' | telnet google.com 80
telnet 某个端口脚本
#!/bin/bash
echo -e '\x1dclose\x0d' | telnet 192.168.0.13 8080 > /dev/null
a=`echo $?`
echo $a
if [ $a != 0 ]
then
dat="内网8080"
ip="192.168.0.13"
curl 'https://oapi.dingtalk.com/robot/send?access_token=c************7' -H 'Content-Type: application/json' -d "{\"msgtype\": \"text\",\"text\": {\"content\":\"[监控报警]\n[报警类型]: jenkins\n[报警内容]: \n${dat}\n[主机ip]: ${ip//\"/}\"}}"
fi