首页 > 代码库 > shell telnet 路由器
shell telnet 路由器
#!/usr/bin/expect -fspawn telnet 172.16.1.80expect "login" { send "admin\n" expect { "Password" { send "admin\n" } } }expect ">" {send "show interface all status\n"}expect ">" {send "exit\n"}expect eofexit 0
#!/bin/shup_port="GE1 GE2 GE3 GE4 GE5 GE6 GE7 XGE1 XGE2"tmp=`../plugin//wk.exp > /tmp/.log.wk`route_status=`grep Up /tmp/.log.wk`port=`echo "$route_status" |awk -F‘ ‘ ‘{print $1}‘`for x in $up_portdo echo $port |grep -w $x &> /dev/null #|| echo ‘port:‘ $x ‘is down‘ if [ $? = 1 ];then case $x in "GE1" ) echo "alarm" "critical" "is" "$x SGSN601 Data interrupt";; "GE2" ) echo "alarm" "critical" "is" "$x SGSN602 Data interrupt";; "GE3" ) echo "alarm" "critical" "is" "$x SGSN603 Data interrupt";; "GE4" ) echo "alarm" "critical" "is" "$x SGSN207 Data interrupt";; "GE5" ) echo "alarm" "critical" "is" "$x SGSN501 Data interrupt";; "GE6" ) echo "alarm" "critical" "is" "$x SGSN504 Data interrupt";; "GE7" ) echo "alarm" "critical" "is" "$x SGSN505 Data interrupt";; "XGE1" ) echo "alarm" "critical" "is" "$x SGSN201&202&203 Data interrupt";; "XGE2" ) echo "alarm" "critical" "is" "$x Platform collect Data interrupt";; esac fidone
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。