关于IP SLA及与EEM联动的探讨<2>

根据上篇文章分析的第一种方法到底行不行呢?
经过测试,确实可以规避原丢一个包就启动EEM的问题。
但有个问题,因为要新增一个sla,如777,且其状态为pending,即只有在17丢三个包的情况下才启动777。

有如下两种情况:

1、线路已经开通时,这时配置如上命令时,因17无法连续丢3个包,导致777始终不能启动,导致track17的状态始终为down,最终导致不管丢多少包都不能启动EEM。(想想为什么?)

规避措施:配置完如上命令时需要shut上端或下端端口30s(因每10s探测一次),这时777才能启动,然后再做no shut操作,track17状态才能变为up,才能在专线中断的情况下正常启动EEM。所以在已经开通的线路配置如上命令时都要中断主用线路最少30s。

2、线路尚未开通时,这时需要在配置完如上命令最少30s才能开通此MSTP线路,否则同样会有如上问题。

关于问题的分析及解释:
在这我就不解释命令的含义了,关于命令的含义,可以看上篇文章 《 关于IP SLA及与EEM联动的探讨<2>

Config:

ip sla monitor 17
 type echo protocol ipIcmpEcho 12.1.1.2
 timeout 3000
 frequency 10
!
ip sla monitor reaction-configuration 17 react timeout threshold-type consecutive 3 action-type trapAndTrigger
ip sla monitor reaction-trigger 17 777
ip sla monitor schedule 17 life forever start-time now
!
ip sla monitor 777
 type echo protocol ipIcmpEcho 12.1.1.2
 timeout 1000
 frequency 10
!
ip sla monitor schedule 777 life 5 start-time pending
track 17 rtr 777
!
event manager session cli username "username"
event manager applet test_track_17
 event track 17 state down
 action 1.0 cli command "enable"
 action 2.0 cli command "conf t"
 action 3.0 cli command "int s1/0"
 action 3.1 cli command "shut"
 action 3.2 cli command "no shut"
 action 4.0 cli command "end"
!
R1#sh debugging
Track debugging is on
Embedded Event Manager:
  Debug EEM action cli debugging is on
IP SLA Monitor:
  TRACE debugging for all operations is on

Debug Information:

1. 初始配置后是down的状态:

R1(config)#track 17 rtr 777
*Feb 25 10:15:06.979: Track: 17 Adding rtr object
*Feb 25 10:15:06.979: Track: Initialise
*Feb 25 10:15:06.983: Track: 17 New rtr 777, state Down
*Feb 25 10:15:06.987: Track: Starting process

R1#sh track
Track 17
  Response Time Reporter 777 state
  State is Down
    1 change, last change 00:01:19
  Latest operation return code: Unknown
  Tracked by:
     applet test_track_17

2. shutdown本断或对断端口,激活777,使track 17成为down

*Feb 25 10:16:25.107: IP SLA Monitor(777) Scheduler: Starting an operation
*Feb 25 10:16:25.107: IP SLA Monitor(777) echo operation: Sending an echo operation
*Feb 25 10:16:26.107: IP SLA Monitor(777) echo operation: Timeout
*Feb 25 10:16:26.107: IP SLA Monitor(777) Scheduler: Updating result
*Feb 25 10:16:26.777: IP SLA Monitor(777) Scheduler: Ageout

R1#sh track
Track 17
  Response Time Reporter 777 state
  State is Down
    1 change, last change 00:01:55
  Latest operation return code: Timeout
  Tracked by:
     applet test_track_17

3. no shut端口,再次激活777,使其成为up

*Feb 25 10:17:42.159: IP SLA Monitor(777) Scheduler: Starting an operation
*Feb 25 10:17:42.159: IP SLA Monitor(777) echo operation: Sending an echo operation
*Feb 25 10:17:42.171: IP SLA Monitor(777) echo operation: RTT=12
*Feb 25 10:17:42.175: IP SLA Monitor(777) Scheduler: Updating result
*Feb 25 10:17:42.175: IP SLA Monitor(777) Scheduler: Ageout
*Feb 25 10:17:46.983: Track: 17 Change #2 rtr 777, state Down->Up

R1#sh track
Track 17
  Response Time Reporter 777 state
  State is Up
    2 changes, last change 00:09:16
  Latest operation return code: OK
  Latest RTT (millisecs) 12
  Tracked by:
     applet test_track_17

4. shutdown本端端口,测试是否可以达到效果
注意:下面的时间戳跟上面的不是连续的,是经过两次测试得到的

R1#config ter
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int s1/0
R1(config-if)#
R1(config-if)#shutdown
R1(config-if)#end
R1#
*Feb 25 09:47:27.911: %LINK-5-CHANGED: Interface Serial1/0, changed state to administratively down
*Feb 25 09:47:27.915: %ENTITY_ALARM-6-INFO: ASSERT INFO Se1/0 Physical Port Administrative State Down
*Feb 25 09:47:28.911: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to down

*Feb 25 09:47:31.775: IP SLA Monitor(17) Scheduler: Starting an operation
*Feb 25 09:47:31.775: IP SLA Monitor(17) echo operation: Sending an echo operation
*Feb 25 09:47:34.779: IP SLA Monitor(17) echo operation: Timeout
*Feb 25 09:47:34.779: IP SLA Monitor(17) Scheduler: Updating result

*Feb 25 09:47:41.775: IP SLA Monitor(17) Scheduler: Starting an operation
*Feb 25 09:47:41.779: IP SLA Monitor(17) echo operation: Sending an echo operation
*Feb 25 09:47:44.779: IP SLA Monitor(17) echo operation: Timeout
*Feb 25 09:47:44.779: IP SLA Monitor(17) Scheduler: Updating result

*Feb 25 09:47:51.775: IP SLA Monitor(17) Scheduler: Starting an operation
*Feb 25 09:47:51.775: IP SLA Monitor(17) echo operation: Sending an echo operation
*Feb 25 09:47:54.779: IP SLA Monitor(17) echo operation: Timeout
*Feb 25 09:47:54.779: IP SLA Monitor(17) Scheduler: Updating result

*Feb 25 09:47:54.827: IP SLA Monitor(777) Scheduler: Starting an operation
*Feb 25 09:47:54.827: IP SLA Monitor(777) echo operation: Sending an echo operation
*Feb 25 09:47:55.831: IP SLA Monitor(777) echo operation: Timeout
*Feb 25 09:47:55.831: IP SLA Monitor(777) Scheduler: Updating result
*Feb 25 09:47:55.835: IP SLA Monitor(777) Scheduler: Ageout

*Feb 25 09:47:56.231: Track: 17 Change #5 rtr 777, state Up->Down
*Feb 25 09:47:56.251: fh_schedule_callback: EEM callback policy EEM Policy Director has been scheduled to run

*Feb 25 09:47:56.275: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : CTL : cli_open called.
*Feb 25 09:47:56.291: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT :
*Feb 25 09:47:56.291: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT : R1>
*Feb 25 09:47:56.295: %HA_EM-6-LOG:
R1#test_track_17 : DEBUG(cli_lib) : : IN  : >enable
*Feb 25 09:47:56.311: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT :
*Feb 25 09:47:56.311: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT : R1#
*Feb 25 09:47:56.311: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : IN  : #conf t

*Feb 25 09:47:56.327: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT :
*Feb 25 09:47:56.331: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT :
Enter configuration commands, one per line.  End with CNTL/Z.
*Feb 25 09:47:56.335: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT : R1(config)#
*Feb 25 09:47:56.339: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : IN  : #int s1/0

*Feb 25 09:47:56.355: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT :
*Feb 25 09:47:56.355: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT : R1(config-if)#
*Feb 25 09:47:56.355: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : IN  : #shut

*Feb 25 09:47:56.371: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT :
*Feb 25 09:47:56.375: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT : R1(config-if)#
*Feb 25 09:47:56.379: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : IN  : #no shut

*Feb 25 09:47:56.411: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT :
*Feb 25 09:47:56.411: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT : R1(config-if)#
*Feb 25 09:47:56.415: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : IN  : #end

*Feb 25 09:47:56.435: %SYS-5-CONFIG_I: Configured from console by name on vty1

*Feb 25 09:47:56.447: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT :
*Feb 25 09:47:56.447: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : OUT : R1#
*Feb 25 09:47:56.451: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : IN  : #exit
*Feb 25 09:47:56.455: %HA_EM-6-LOG: test_track_17 : DEBUG(cli_lib) : : CTL : cli_close called.

*Feb 25 09:47:58.387: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Feb 25 09:47:58.391: %ENTITY_ALARM-6-INFO: CLEAR INFO Se1/0 Physical Port Administrative State Down
*Feb 25 09:47:59.399: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up

R1#sh track
R1#sh track 17
Track 17
  Response Time Reporter 777 state
  State is Up
    6 changes, last change 00:15:41
  Latest operation return code: OK
  Latest RTT (millisecs) 3
  Tracked by:
     applet test_track_17
0
你可以留言,或者trackback 从你的网站

留言哦