客户需要实现如下需求,咨询设备能否支持:
经确认,可通过EAA功能实现,配置脚本如下:
#
nqa entry admin test
type icmp-echo
destination ip 192.168.1.100
frequency 1000
history-record enable
history-record number 10
probe count 5
probe timeout 500
reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trap-only //配置icmp-echo类型NQA检测,ping不通时发送snmp trap
#
nqa schedule admin test start-time now lifetime forever
#
snmp-agent
snmp-agent community write private
snmp-agent community read public
snmp-agent sys-info version all
snmp-agent target-host trap address udp-domain 192.168.1.1 params securityname public //指定trap发送主机
snmp-agent trap enable
#
rtm environment backup 0 //设置环境变量
#
rtm cli-policy 1
event snmp oid 1.3.6.1.4.1.25506.8.3.1.13.1.11.5.97.100.109.105.110.4.116.101.115.116.1 monitor-obj get start-op eq start-val 2 restart-op eq restart-val 3 interval 5
//1.3.6.1.4.1.25506.8.3.1.13.1.11.5.97.100.109.105.110.4.116.101.115.116.1,即为hh3cNqaReactCurrentStatus.5.97.100.109.105.110.4.116.101.115.116.1,表示监控hh3cNqaReactCurrentStatus这一OID,后半部分序列代表NQA名称“admin test”
// start-op eq start-val 2 表示触发条件为该节点值为2(overThreshold)
// restart-op eq restart-val 3 表示再次开启触发开关条件为,该节点值为3(belowThreshold)
action 0 cli tclsh
action 1 cli system-view
action 2 cli if { $backup==0 } { rtm environment backup 1; int g 1/0/1; shutdown; int g 1/0/2; undo shutdown } else { rtm environment backup 0; int g 1/0/1; undo shutdown; int g 1/0/2; shutdown } //通过判断环境变量值,切换1/0/1,1/0/2端口状态
user-role network-operator
user-role network-admin
#
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作