cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1489
Views
0
Helpful
12
Replies

EEM Versioning on 6500s

We have several 6500 routers within our network for which we need to deploy EEM scripting.

I have noticed that the version of EEM script is below (or equal to) Version 2.40.

We need to use the string command. However we get the following output:

 

Router(config-applet)#  action 50  string length "$_cli_result"
                                     ^
% Invalid input detected at '^' marker.

Router(config-applet)#

 

Upon investigation I have found that we need EEM Version 3.0. I have searched documentation come up short in my hunt for a solution.

 

I need to know:

What IOS version we need to get EEM Version 3.0

OR if we can upgrade the EEM Version without upgrading the IOS

OR if there is another command we can use (this last option is unlikely)

 

Can anyone assist with this?

12 Replies 12

Dan Frey
Cisco Employee
Cisco Employee

You can translate your applet to an EEM TCL policy here.  

http://www.marcuscom.com/convert_applet/

TCL can do string length natively and is not tied to the EEM version.

 

Hi Daniel,

 

I might need a bit more help. My EEM Script is as follows:

event manager applet Test
 event cli pattern "address-family ipv4 vrf .*" sync yes
  action 10  cli command "enable"
  action 20  cli command "tclsh disk0:/checkBGP.tcl"

 

The debug output I get from the TCL script (which I created using above link) is as follows:

Jul 20 15:55:58.285 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : CTL : cli_open called.
Jul 20 15:55:58.285 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : OUT : Company Internet Ltd
Jul 20 15:55:58.285 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : OUT : Authorised Used Only
Jul 20 15:55:58.285 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : OUT : Router>
Jul 20 15:55:58.285 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : IN  : Router>enable
Jul 20 15:55:58.297 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : OUT : Router#
Jul 20 15:55:58.297 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : IN  : Router#tclsh disk0:/checkBGP.tcl
Jul 20 15:55:58.633 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : OUT : invalid command name "::cisco::eem::event_register_cli"
Jul 20 15:55:58.633 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : OUT :     while executing
Jul 20 15:55:58.633 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : OUT : "::cisco::eem::event_register_cli pattern {address-family ipv4 vrf .*} sync yes"
Jul 20 15:55:58.633 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : OUT :     (file "disk0:/checkBGP.tcl" line 1)
Jul 20 15:55:58.633 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : OUT :
Jul 20 15:55:58.633 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : OUT :  Router#
Jul 20 15:55:58.633 BST: %HA_EM-6-LOG: Test : DEBUG(cli_lib) : : CTL : cli_close called.

 

It looks like it is failing on line 1. Are you able to help?

 

The original TCL script is as follows:

event manager session cli username eemauto

event manager applet BGP_VRF_CHECK
 event cli pattern "address-family ipv4 vrf .*" sync yes
  action 10  cli command "enable"
  action 20  cli command "configure terminal"
  action 30  cli command "router bgp 1234"
  action 40  cli command "$_cli_msg"
  action 50  string length "$_cli_result"
  action 60  if $_string_result lt 50 goto END
  action 70  regexp "% VRF (.*) does not exist." "$_cli_result" not_configured vrf
  action 80  syslog msg "CATCH_AF_VRF_NOT_EXIST: VRF $vrf is not configured.  Networks please investigate."
  action END set _exit_status "1"

 

Take your "BGP_VRF_CHECK" policy to the link I provided above and convert it to a EEM TCL policy.   The output will be a EEM TCL policy that you can register on the router.  

There is no reason to have the "Test" applet policy call a tclsh script.

Hi Daniel,

 

That's better. Much obliged. Getting closer but not quite there...

Router(config)#event manager directory user policy disk0:
Router(config)#event manager policy checkBGP.tcl

 

...works ok. But when the policy triggers I get the following error:

Router(config)#router bgp 1234
Router(config-router)#address-family ipv4 vrf FAKE_VRF
can't read "arr_einfo(result)": no such element in array
    while executing
"string length "$arr_einfo(result)""
    invoked from within
"$slave eval $Contents"
    (procedure "eval_script" line 7)
    invoked from within
"eval_script slave $scriptname"
    invoked from within
"if {$security_level == 1} {       #untrusted script
     interp create -safe slave
     interp share {} stdin slave
     interp share {} stdout slave
..."
    (file "tmpsys:/lib/tcl/base.tcl" line 50)
Tcl policy execute failed: can't read "arr_einfo(result)": no such element in array
% VRF FAKE_VRF does not exist or does not have a RD
Router(config-router)#
Jul 21 14:37:49.999 BST: %SYS-5-CONFIG_I: Configured from console by vty1

 

I am thinking it is something to do with the new equivalent of line 70 in the original EEM script. It looks like the router I'm testing on is outputting % VRF FAKE_VRF does not exist or does not have a RD rather than % VRF FAKE_VRF does not exist. This means there is not a match.

 

That's only a guess. I'm not used to looking at EEM output and I can't easily edit the file without ftp-ing the file back up to the router. Any further help would be much appreciated.

The updated script is pasted below.   I did update string length to be less than 70 since it outputs 68 char below.

 

C819GW-LTE-MNA-AK9(config)#no event manager policy bgpcheck.tcl ty us
C819GW-LTE-MNA-AK9(config)#event manager policy bgpcheck.tcl ty us   
C819GW-LTE-MNA-AK9(config)#router bgp 1234                           
C819GW-LTE-MNA-AK9(config-router)#address-family ipv4 vrf FAKE_VRF          
string is 68 char long

C819GW-LTE-MNA-AK9(config-router)#
*Jul 21 16:43:36.493: %HA_EM-6-LOG: bgpcheck.tcl: CATCH_AF_VRF_NOT_EXIST: VRF FAKE_VRF is not configured.  Networks please investigate.
C819GW-LTE-MNA-AK9(config-router)#
C819GW-LTE-MNA-AK9(config-router)#

 

#####Start#######

::cisco::eem::event_register_cli pattern {address-family ipv4 vrf .*} sync yes

namespace import ::cisco::eem::*
namespace import ::cisco::lib::*

array set arr_einfo [event_reqinfo]
set msg "$arr_einfo(msg)"


if [catch {cli_open} result] {
    error $result $errorInfo
} else {
    array set cli1 $result
}

if [catch {cli_exec $cli1(fd) "enable"} result] {
    error $result $errorInfo
}

if [catch {cli_exec $cli1(fd) "configure terminal"} result] {
    error $result $errorInfo
}

if [catch {cli_exec $cli1(fd) "router bgp 1234"} result] {
    error $result $errorInfo
}

if [catch {cli_exec $cli1(fd) "$msg"} result] {
    error $result $errorInfo
}

set string_result [string length "$result"]
puts "string is $string_result char long"

if {$string_result < 70} {
regexp {% VRF (.*) does not exist.} "$result" match vrf
action_syslog msg "CATCH_AF_VRF_NOT_EXIST: VRF $vrf is not configured.  Networks please investigate."
} else {
exit 1
}
# Close open cli before exit.
catch {cli_close $cli1(fd) $cli1(tty_id)} result


######End######

 

 

hmmm... it looks like I'm still getting the same error:

 

Router(config-router)#address-family ipv4 vrf FAKE_VRF
can't read "arr_einfo(result)": no such element in array
    while executing
"string length "$arr_einfo(result)""
    invoked from within
"$slave eval $Contents"
    (procedure "eval_script" line 7)
    invoked from within
"eval_script slave $scriptname"
    invoked from within
"if {$security_level == 1} {       #untrusted script
     interp create -safe slave
     interp share {} stdin slave
     interp share {} stdout slave
..."
    (file "tmpsys:/lib/tcl/base.tcl" line 50)
Tcl policy execute failed: can't read "arr_einfo(result)": no such element in array
% VRF FAKE_VRF does not exist or does not have a RD

 

Should the added line be set msg "$arr_einfo(msg)" or set msg "$arr_einfo(result)" ?

I do not see an element with the name result inside of event_reqinfo.    Can you paste the copy of the eem script on your router and run "debug event manager all" then run the script and paste the debug results?

Hi Daniel,

Apologies for the delayed reply. See below for the output I think you are after:

 

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#event manager applet BGP_VRF_CHECK
Router(config-applet)# event cli pattern "address-family ipv4 vrf .*" sync yes
Router(config-applet)#  action 10  cli command "enable"
Router(config-applet)#  action 20  cli command "configure terminal"
Router(config-applet)#  action 30  cli command "router bgp 1234"
Router(config-applet)#  action 40  cli command "$_cli_msg"
Router(config-applet)#  action 50  string length "$_cli_result"
Router(config-applet)#  action 60  if $_string_result lt 50 goto END
Router(config-applet)#  action 70  regexp "% VRF (.*) does not exist." "$_cli_result" not_configured vrf
Router(config-applet)#  action 80  syslog msg "CATCH_AF_VRF_NOT_EXIST: VRF $vrf is not configured.  Networks please investigate."
Router(config-applet)#  action END set _exit_status "1"

Router(config-applet)#^Z
Router#debug event manager all
All possible Embedded Event Manager debugging has been turned on
Router#terminal monitor
Router#conf
Jul 30 16:30:38.368 BST: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul 30 16:30:38.368 BST: check_eem_cli_policy_handler: command_string=terminal monitor
Jul 30 16:30:38.368 BST: check_eem_cli_policy_handler: num_matches = 0, response_code = 1 t
Enter configuration commands, one per line.  End with CNTL/Z.
Jul 30 16:30:40.264 BST: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul 30 16:30:40.264 BST: check_eem_cli_policy_handler: command_string=configure terminal
Jul 30 16:30:40.264 BST: check_eem_cli_policy_handler: num_matches = 0, response_code = 1
Router(config)#router bgp 1234
Router(config-router)#
Jul 30 16:30:58.044 BST: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul 30 16:30:58.044 BST: check_eem_cli_policy_handler: command_string=router bgp 1234
Jul 30 16:30:58.044 BST: check_eem_cli_policy_handler: num_matches = 0, response_code = 1
Router(config-router)#
Jul 30 16:31:00.004 BST: fh_fd_timer_process_async
Jul 30 16:31:00.004 BST: cron_tick: num_matches 0
Router(config-router)#address-family ipv4 vrf FAKE_VRF
% VRF FAKE_VRF does not exist or does not have a RD
Router(config-router)#
Jul 30 16:31:23.924 BST: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul 30 16:31:23.924 BST: cli_conn_tm_alloc: ptp=0x67277438
Jul 30 16:31:23.924 BST: fh_fd_cli_event_match: publish_timer=0x200C2AB0, ptp=0x67277438, max_delay=30000
Jul 30 16:31:23.924 BST: cli_conn_tm_add: re=0x67276738, ptp=0x67277438
Jul 30 16:31:23.924 BST: cli_pubinfo_enqueue: publish_entry EOK
Jul 30 16:31:23.924 BST: fh_fd_cli_event_match: re=0x67276738, ptp=0x67277438, str=address-family ipv4 vrf FAKE_VRF
Jul 30 16:31:23.924 BST: check_eem_cli_policy_handler: command_string=address-family ipv4 vrf FAKE_VRF
Jul 30 16:31:23.924 BST: check_eem_cli_policy_handler: num_matches = 1, response_code = 4
Jul 30 16:31:23.924 BST: fh_send_server_sig_hndlr: received a pulse from cli on node0/0 with fdid: 7
Jul 30 16:31:23.924 BST: fh_send_cli_fd_msg: msg_type=64
Jul 30 16:31:23.924 BST: fh_send_cli_fd_msg: sval=0
Jul 30 16:31:23.924 BST: fh_send_server_sig_hndlr: received FH_MSG_EVENT_PUBLISH_SYNC
Jul 30 16:31:23.924 BST: EEM: server processes multi events: timewin=1, sync_flag=1, ec_index=0, cmp_occ=1
Jul 30 16:31:23.924 BST: EEM: ctx=9:(9,1,1)
Jul 30 16:31:23.924 BST: EEM: server processes multi events: corr_res=1, cur_tcnt=1, cmp_tcnt=1
Jul 30 16:31:23.924 BST: fh_schedule_callback: fh_schedule_callback: cc=66945570 prev_epc=0; epc=212E406C
Jul 30 16:31:23.924 BST: EEM server schedules callbacks: policy_type: 2
Jul 30 16:31:23.924 BST: EEM server schedules one event: policy_type=applet epc=212E406C.
Jul 30 16:31:23.924 BST: fh_schedule_a_callback: EEM callback policy BGP_VRF_CHECK has been scheduled to run. fdid: 7 sn: 11 jobid: 17
Jul 30 16:31:23.924 BST: fh_io_msg: received FH_MSG_API_INIT; jobid=30, processid=305, client=20, job name=EEM Callback Thread
Jul 30 16:31:23.924 BST: fh_server: fh_io_msg: received msg FH_MSG_EVENT_REQINFO_MULTI from client 20 pclient 2
Jul 30 16:31:23.924 BST: fh_server: fh_io_msg: received msg FH_MSG_EVENT_TTYINFO from client 20 pclient 2
Jul 30 16:31:23.928 BST: Registering tag: <fh_var> id: 1
Jul 30 16:31:23.928 BST: Pushing tag <fh_publish_event_spec> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_publish_event_spec>
Jul 30 16:31:23.928 BST: Pushing tag <fh_publish_common> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_publish_common>
Jul 30 16:31:23.928 BST: Pushing tag <fh_event_type> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_event_type>
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(pdir) Value=(_event_type)
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(tcl) Value=(event_type)
Jul 30 16:31:23.928 BST: Pushing tag <fh_var> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_var> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_event_type> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_event_type>
Jul 30 16:31:23.928 BST: Pushing tag <fh_event_spec_id> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_event_spec_id>
Jul 30 16:31:23.928 BST: Popping tag <fh_event_spec_id> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_event_spec_id>
Jul 30 16:31:23.928 BST: Pushing tag <fh_event_name> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_event_name>
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(pdir) Value=(_event_type_string)
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(tcl) Value=(event_type_string)
Jul 30 16:31:23.928 BST: Pushing tag <fh_var> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_var> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_event_name> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_event_name>
Jul 30 16:31:23.928 BST: Pushing tag <fh_event_severity> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_event_severity>
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(pdir) Value=(_event_severity)
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(tcl) Value=(event_severity)
Jul 30 16:31:23.928 BST: Pushing tag <fh_var> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_var> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_event_severity> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_event_severity>
Jul 30 16:31:23.928 BST: Pushing tag <fh_event_sn> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_event_sn>
Jul 30 16:31:23.928 BST: Popping tag <fh_event_sn> off stack
<snip>
Jul 30 16:31:23.928 BST: Pushing tag <fh_fd_event_cli_msg_count> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_fd_event_cli_msg_count>
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(pdir) Value=(_cli_msg_count)
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(tcl) Value=(msg_count)
Jul 30 16:31:23.928 BST: Pushing tag <fh_var> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_var> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_fd_event_cli_msg_count> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_fd_event_cli_msg_count>
Jul 30 16:31:23.928 BST: Pushing tag <fh_fd_event_cli_count_xtra> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_fd_event_cli_count_xtra>
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(tcl) Value=(count)
Jul 30 16:31:23.928 BST: Pushing tag <fh_var> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_var> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_fd_event_cli_count_xtra> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_fd_event_cli_count_xtra>
Jul 30 16:31:23.928 BST: Pushing tag <fh_fd_event_cli_msg> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_fd_event_cli_msg>
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(pdir) Value=(_cli_msg)
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(tcl) Value=(msg)
Jul 30 16:31:23.928 BST: Pushing tag <fh_var> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_var> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_fd_event_cli_msg> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_fd_event_cli_msg>
Jul 30 16:31:23.928 BST: Pushing tag <fh_fd_event_cli_tty> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_fd_event_cli_tty>
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(pdir) Value=(_cli_tty)
Jul 30 16:31:23.928 BST: Name-Value Pair: Name=(tcl) Value=(tty)
Jul 30 16:31:23.928 BST: Pushing tag <fh_var> on to stack
Jul 30 16:31:23.928 BST: open tag is <fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_var> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_var>
Jul 30 16:31:23.928 BST: Popping tag <fh_fd_event_cli_tty> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_fd_event_cli_tty>
Jul 30 16:31:23.928 BST: Popping tag <fh_fd_publish_cli_spec> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_fd_publish_cli_spec>
Jul 30 16:31:23.928 BST: Popping tag <fh_publish_event_spec> off stack
Jul 30 16:31:23.928 BST: close tag is </fh_publish_event_spec>
Jul 30 16:31:23.928 BST: EEM: policy_dir xml builtin: name:_event_type value:121
Jul 30 16:31:23.928 BST: EEM: policy_dir xml builtin: name:_event_type_string value:cli
Jul 30 16:31:23.928 BST: EEM: policy_dir xml builtin: name:_event_severity value:severity-normal
Jul 30 16:31:23.928 BST: EEM: policy_dir xml builtin: name:_cli_msg_count value:1
Jul 30 16:31:23.928 BST: EEM: policy_dir xml builtin: name:_cli_msg value:address-family ipv4 vrf FAKE_VRF
Jul 30 16:31:23.928 BST: EEM: policy_dir xml builtin: name:_cli_tty value:2
Jul 30 16:31:23.928 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : CTL : cli_open called.
Jul 30 16:31:23.932 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : OUT : Star Internet Ltd
Jul 30 16:31:23.932 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : OUT : Authorised Used Only
Jul 30 16:31:23.932 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : OUT : Router>
Jul 30 16:31:23.932 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : IN  : Router>enable
Jul 30 16:31:23.932 BST: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul 30 16:31:23.932 BST: eem_no_scan flag set, skipping scan of command_string=check_eem_cli_policy_handler
Jul 30 16:31:23.944 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : OUT : Router#
Jul 30 16:31:23.944 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : IN  : Router#configure terminal
Jul 30 16:31:24.148 BST: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul 30 16:31:24.148 BST: eem_no_scan flag set, skipping scan of command_string=check_eem_cli_policy_handler
Jul 30 16:31:24.156 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : OUT : Enter configuration commands, one per line.  End with CNTL/Z.
Jul 30 16:31:24.156 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : OUT : Router(config)#
Jul 30 16:31:24.156 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : IN  : Router(config)#router bgp 1234
Jul 30 16:31:24.364 BST: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul 30 16:31:24.364 BST: eem_no_scan flag set, skipping scan of command_string=check_eem_cli_policy_handler
Jul 30 16:31:24.368 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : OUT : Router(config-router)#
Jul 30 16:31:24.368 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : IN  : Router(config-router)#address-family ipv4 vrf FAKE_VRF
Jul 30 16:31:24.576 BST: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul 30 16:31:24.576 BST: eem_no_scan flag set, skipping scan of command_string=check_eem_cli_policy_handler
Jul 30 16:31:24.584 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : OUT : % VRF FAKE_VRF does not exist or does not have a RD
Jul 30 16:31:24.584 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : OUT : Router(config-router)#
Jul 30 16:31:24.584 BST: %HA_EM-6-LOG: BGP_VRF_CHECK: CATCH_AF_VRF_NOT_EXIST: VRF FAKE_VRF is not configured.  Networks please investigate.
Jul 30 16:31:24.584 BST: %HA_EM-6-LOG: BGP_VRF_CHECK : DEBUG(cli_lib) : : CTL : cli_close called.
Jul 30 16:31:24.584 BST: fh_server: fh_io_msg: received msg FH_MSG_CALLBACK_DONE from client 20 pclient 2
Jul 30 16:31:24.584 BST: fh_io_msg: EEM callback policy BGP_VRF_CHECK has ended with abnormal exit status of 0x1
Jul 30 16:31:24.584 BST: EEM fms_remote_chkpt_add_event_hist(), data_len = 2980, buf_size = 2992
Jul 30 16:31:24.584 BST: fh_send_cli_fd_msg: msg_type=18
Jul 30 16:31:24.584 BST: fh_fd_cli_publish_done: errc=1, publish_expired=0
Jul 30 16:31:24.584 BST:   sid=9, ptp=0x67277438, connp=0x2082B208
Jul 30 16:31:24.584 BST: fh_fd_cli_publish_done: num_sync_msgs=0, response_code=5
Jul 30 16:31:24.584 BST: cli_conn_tm_remove: re=0x67276738, ptp=0x67277438
Jul 30 16:31:24.584 BST: fh_fd_cli_conn_tm_free: ptp=0x67277438
Jul 30 16:31:24.584 BST: fh_send_cli_fd_msg: sval=0
Jul 30 16:31:24.584 BST: EEM: server decrements in use thread: jobid=17 rule id=3 in use thread=0.
Jul 30 16:31:24.584 BST: fh_schedule_callback: fh_schedule_callback: cc=66945570 prev_epc=212E406C; epc=0
Jul 30 16:31:24.584 BST: EEM server schedules callbacks: policy_type: 2
Jul 30 16:31:24.584 BST: fh_schedule_policy: prev_epc=0x00000000; epc=0x00000000
Jul 30 16:31:24.584 BST: EEM server schedules scripts
Jul 30 16:31:24.584 BST: check_eem_cli_policy_handler: out of wait EEM policy execution, response_code = 5
Jul 30 16:31:24.588 BST: fh_server: fh_io_msg: received msg FH_MSG_API_CLOSE from client 20 pclient 2
Jul 30 16:31:24.588 BST: fh_io_msg: received FH_MSG_API_CLOSE client=20
Jul 30 16:31:24.588 BST: %SYS-5-CONFIG_I: Configured from console by vty1
Jul 30 16:31:24.588 BST: fh_fd_config_event_match: num_matches = 0
Jul 30 16:31:24.588 BST: fh_fd_config_event_notify:
Jul 30 16:31:24.588 BST: fh_fd_syslog_event_match: num_matches = 0
Jul 30 16:31:24.588 BST: fh_fd_data_syslog: num_matches = 0
Router(config-router)#
Router(config-router)#do u all
All possible debugging has been turned off
Router(config-router)#
Jul 30 16:31:43.293 BST: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul 30 16:31:43.293 BST: check_eem_cli_policy_handler: command_string=do u all
Jul 30 16:31:43.293 BST: check_eem_cli_policy_handler: num_matches = 0, response_code = 1
Jul 30 16:31:43.497 BST: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul 30 16:31:43.497 BST: check_eem_cli_policy_handler: command_string=undebug all
Jul 30 16:31:43.497 BST: check_eem_cli_policy_handler: num_matches = 0, response_code = 1
Router(config-router)#
Router(config-router)#

I translated your EEM applet to an EEM TCL policy above but your still using the EEM applet.   The issue is the EEM applet does not recognize "string length" but an EEM TCL policy fixes that limitation.

 

 

Hi Daniel,

 

I think there has been come miscommunication.

 

I have been looking at this two ways:

1. Using an EEM script

2. Using a TCL script.

 

We are currently working on the TCL script side of things (for the very reason you have just mentioned).

 

However your last comment read " Can you paste the copy of the eem script on your router", so I thought you wanted to see output from the original EEM script so as to help troubleshoot the TCL script.

 

Let me give you the debug output when running the TCL script rather than the EEM script tomorrow and we can go from there.

 

Let me know if that's not what you're after or if I have misunderstood something :)

I believe your right that we have miscommunication.   What I wanted to say on my original response is that your current policies of having an EEM applet, trigger a tclsh script is not needed.   I think you should condense these two policies into a single EEM TCL policy.   One of my previous posts did convert the EEM applet to EEM TCL, however I do not believe you shared your tclsh script.   If you could share your script we can add it to the EEM TCL policy.   If all goes well you will have a single EEM TCL policy that contains all the logic needed on your 6500s.

Hi Daniel,

 

When you told me not to have an EEM applet to trigger a tclsh script I removed it. So this is no longer in play.

 

I don't have any EEM applets configured on the router at all. All that is on the router are the following commands:

 

Router(config)#event manager directory user policy disk0:
Router(config)#event manager policy checkBGP.tcl

 

The checkBGP.tcl file is stored on disk0: and contains what you posted to me 16 days ago (the post above beginning with the words "The updated script is pasted below. ")

There are no other event manger commands or configs on the router.

The output when I try to go into the address family of a non-existence VRF is show on the post I made 15 days ago (the post beginning with "hmmm... it looks like I'm still getting the same error")