Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

How to pull correct interface into EEM applet

                   We have an environment with multiple 2811's, 1941's, and 2821 routers in hundreds of locations.  Depending on the location's needs, the Serial card may be an MFT or DSU type VWIC or HWIC and may be in different slots.  So that I can deploy a standard EEM applet that would apply to the Serial interface servicing the location's T1, I would like to find a way to pull the correct slot/port number of the Serial (or multilink virtual) interface with an existing IP address on it, into an EEM applet.   An example of the applet that simply states the serial slot/port for an MFT interface card is below.   I was thinking of trying to do this by having the applet parse the output of "show ip interface brief" and take the interface that has an IP address in the "IP address" column and begins with the letters either "Mu" or "Se", but I'm not sure how to do this.

existing applet:

event manager applet Serial_if

event tag if_1 interface name Serial0/1/0:0 parameter input_errors_crc entry-op ge entry-val 2 entry-type increment poll-interval 20

event tag if_2 interface name Serial0/1/0:0 parameter input_errors entry-op ge entry-val 2 entry-type increment poll-interval 20

event tag if_3 interface name Serial0/1/0:0 parameter input_errors_frame entry-op ge entry-val 2 entry-type increment poll-interval 20

event tag if_4 interface name Serial0/1/0:0 parameter input_errors_overrun entry-op ge entry-val 2 entry-type increment poll-interval 20

event tag if_5 interface name Serial0/1/0:0 parameter output_errors entry-op ge entry-val 2 entry-type increment poll-interval 20

event tag if_6 interface name Serial0/1/0:0 parameter output_errors_underrun entry-op ge entry-val 2 entry-type increment poll-interval 20

trigger occurs 1

  correlate event if_1 or event if_2 or event if_3 or event if_4 or event if_5 or event if_6

action 100 cli command "enable"

action 200 cli command "config t"

action 300 cli command "int Serial0/1/0:0"

action 400 cli command "shutdown"

action 401 set syslog_msg "CRC failure leased line $_interface_name"

action 500 syslog msg "$syslog_msg"

csc-lab01#show ip interface brief

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            unassigned      YES NVRAM  up                    up

FastEthernet0/0.2          11.17.254.2     YES NVRAM  up                    up

FastEthernet0/0.4          11.113.254.2    YES NVRAM  up                    up

FastEthernet0/0.6          11.113.253.2    YES NVRAM  up                    up

FastEthernet0/0.52         10.17.254.2     YES NVRAM  up                    up

FastEthernet0/0.53         10.17.254.66    YES NVRAM  up                    up

FastEthernet0/0.54         10.17.254.130   YES NVRAM  up                    up

FastEthernet0/0.55         10.17.254.194   YES NVRAM  up                    up

FastEthernet0/0.56         11.81.254.2     YES NVRAM  up                    up

FastEthernet0/0.57         11.170.254.2    YES NVRAM  up                    up

FastEthernet0/1            172.25.248.225  YES NVRAM  up                    down

BRI0/0/0                   unassigned      YES NVRAM  administratively down down

BRI0/0/0:1                 unassigned      YES unset  administratively down down

BRI0/0/0:2                 unassigned      YES unset  administratively down down

Serial0/1/0:0              208.220.209.34  YES NVRAM  up                    up

Loopback1                  1.1.1.1         YES NVRAM  up                    up

Loopback33                 11.3.130.8      YES NVRAM  up                    up

Output I would like to pull the serial interface from rather than it being manually entered in applet:

csc-lab01#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES NVRAM  up                    up
FastEthernet0/0.2          10.x.x.x    YES NVRAM  up                    up
FastEthernet0/0.4          10.2.x.x    YES NVRAM  up                    up

FastEthernet0/1            172.16.x.x YES NVRAM  up                    down

Serial0/1/0:0              208.219.209.13  YES NVRAM  up                    up
Loopback1                  1.1.1.1         YES NVRAM  up                    up
Loopback33                 11.3.130.8      YES NVRAM  up                    up

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

How to pull correct interface into EEM applet

Try:

event manager applet Serial_Get_multiple_if
event none
action 1.1 cli command "show ip int brief | inc ^Se|Mu"

action 1.2 foreach line $_cli_result "\n"

action 1.3 regexp "^(Se[^ ]+|Mu[^ ]+) +[0-9]" $line match intf

action 1.4 if $_regexp_result eq 1

action 1.5   break

action 1.6 end

action 1.7 end

action 1.8 puts "Interface is $intf"

12 REPLIES
Cisco Employee

How to pull correct interface into EEM applet

Excluding the action labels, try this:

cli command "show ip int brief | inc ^Se|Mu"

foreach line $_cli_result "\n"

regexp "^(Se|Mu[^ ]+) +[0-9]" $line match intf

if $_regexp_result eq 1

  break

end

end

puts "Interface is $intf"

New Member

How to pull correct interface into EEM applet

That is exactly what I'm looking for. My tests of this have not worked yet.  You can see the test applet I'm using and the output it gives when run below. 

event manager applet Serial_Get_multiple_if
event none
action 100 cli command "show ip int brief | inc ^Se|Mu"
action 200 foreach line "$_cli_result" "\n"
action 300  regexp "^(Se|Mu[^ ]+) +[0-9]" "$line" match intf
action 400  if $_regexp_result eq 1
action 500   break
action 600   puts "Interface is $intf"
!


csc-lab01#event manager run Serial_Get_multiple_if
csc-lab01#
Jul  3 14:13:28 EDT: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul  3 14:13:28 EDT: check_eem_cli_policy_handler: command_string=event manager run Serial_Get_multiple_if
Jul  3 14:13:28 EDT: check_eem_cli_policy_handler: num_matches = 0, response_code = 1
Jul  3 14:13:28 EDT: fh_fd_match_event: re=0x49998100, policyname=Serial_Get_multiple_if, parameters=, get_tty=1

Cisco Employee

How to pull correct interface into EEM applet

Well, you are missing the "end" actions that I had in my sample code.  You need to add those back in the right place.  The way you have the code written now, nothing would ever print.  You may also need to configure "event manager session cli username USER" if you are using command authorization.  USER needs to be a username authorized to run all of the CLI commands.  You should also try the "show ip int ..." command manually to make sure it's returning the right data.

New Member

How to pull correct interface into EEM applet

Thank you, I changed the applet config to exactly as you suggested as shown below, and I received the debug output below when manually executing.  I have aaa turned off for testing.  Thank you very much for you expertise on this.

Jul  8 12:16:38 EDT: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: intf
Jul  8 12:16:38 EDT: %HA_EM-3-FMPD_ERROR: Error executing applet Serial_Get_multiple_if statement 1.8

Jul  8 12:16:38 EDT: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: intf
Jul  8 12:16:38 EDT: %HA_EM-3-FMPD_ERROR: Error executing applet Serial_Get_multiple_if statement 1.8
Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_close called.

event manager applet Serial_Get_multiple_if
event none
action 1.1 cli command "show ip int brief | inc ^Se|Mu"

action 1.2 foreach line $_cli_result "\n"

action 1.3 regexp "^(Se|Mu[^ ]+) +[0-9]" $line match intf

action 1.4 if $_regexp_result eq 1

action 1.5   break

action 1.6 end

action 1.7 end

action 1.8 puts "Interface is $intf"

Cisco Employee

How to pull correct interface into EEM applet

Where is the full debug output?  There should be message above this as well.

New Member

How to pull correct interface into EEM applet

Here is everything that my buffer caught.  I can try to narrow the debug event manager all down to specific's If I'm missing something important above this:

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Pushing tag on to stack

Jul  8 12:16:38 EDT: open tag is

Jul  8 12:16:38 EDT: Name-Value Pair: Name=(pdir) Value=(_event_severity)

Jul  8 12:16:38 EDT: Name-Value Pair: Name=(tcl) Value=(event_severity)

Jul  8 12:16:38 EDT: Pushing tag on to stack

Jul  8 12:16:38 EDT: open tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Pushing tag on to stack

Jul  8 12:16:38 EDT: open tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Pushing tag on to stack

Jul  8 12:16:38 EDT: open tag is

Jul  8 12:16:38 EDT: Name-Value Pair: Name=(pdir) Value=(_none_argc)

Jul  8 12:16:38 EDT: Name-Value Pair: Name=(tcl) Value=(argc)

Jul  8 12:16:38 EDT: Pushing tag on to stack

Jul  8 12:16:38 EDT: open tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: EEM: policy_dir xml builtin: name:_event_type value:131

Jul  8 12:16:38 EDT: EEM: policy_dir xml builtin: name:_event_type_string value:none

Jul  8 12:16:38 EDT: EEM: policy_dir xml builtin: name:_event_severity value:severity-normal

Jul  8 12:16:38 EDT: EEM: policy_dir xml builtin: name:_none_argc value:0

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_open called.

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : C

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *****************************************************************

*************

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *                             W A R N I N G !

            *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * This computer system and its network are private property and m

ay be       *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * accessed only by authorized users for official use only. Unauth

orized      *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * use of this system is strictly prohibited and may be subject to

criminal   *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * prosecution. All data contained within this system is privately

owned      *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * and may be monitored, intercepted, recorded, read, copied, or c

aptured     *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * in any manner and disclosed in any manner, by authorized person

nel.        *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * THERE IS NO RIGHT OF PRIVACY IN THIS SYSTEM. System personnel m

ay          *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * disclose any potential evidence of crime found on this system f

or any      *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * reason. USE OF THIS SYSTEM BY ANY USER, AUTHORIZED OR UNAUTHORI

ZED,        *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * CONSTITUTES CONSENT TO THIS MONITORING, INTERCEPTION, RECORDING

,           *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * READING, COPYING, or CAPTURING and DISCLOSURE.

            *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *****************************************************************

*************

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT :

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : IN  : csc-lab01#show ip int brief | inc ^Se|Mu

Jul  8 12:16:38 EDT: cli_history_entry_add: free_hist_list size=0, hist_list size=7

Jul  8 12:16:38 EDT: eem_no_scan flag set, skipping scan of command_string=check_eem_cli_policy_handler

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : Serial0/1/0:0              208.220.209.34  YES NVRAM  up

           up

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#

Jul  8 12:16:38 EDT: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: intf

Jul  8 12:16:38 EDT: %HA_EM-3-FMPD_ERROR: Error executing applet Serial_Get_multiple_if statement 1.8

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_close called.

Jul  8 12:16:38 EDT: fh_server: fh_io_msg: received msg FH_MSG_CALLBACK_DONE from client 36 pclient 1

Jul  8 12:16:38 EDT: fh_io_msg: EEM callback policy Serial_Get_multiple_if has ended with abnormal exit status of 0xFFFFFFFF

Jul  8 12:16:38 EDT: EEM fms_remote_chkpt_add_event_hist(), data_len = 2980, buf_size = 2992

Jul  8 12:16:38 EDT: fh_send_none_fd_msg: msg_type=18

Jul  8 12:16:38 EDT: fh_fd_none_publish_done: rc=1, re=49997C40

Jul  8 12:16:38 EDT: fh_fd_none_publish_done: rc=1, publish_expired=0

Jul  8 12:16:38 EDT:   sid=57, ptp=0x499990C0, connp=0x4940CB4C

Jul  8 12:16:38 EDT: none_conn_tm_remove: re=0x49997C40, ptp=0x499990C0

Jul  8 12:16:38 EDT: fh_fd_none_conn_tm_free: ptp=0x499990C0

Jul  8 12:16:38 EDT: fh_send_none_fd_msg: sval=0

Jul  8 12:16:38 EDT: EEM: server decrements in use thread: jobid=35 rule id=2 in use thread=4.

Jul  8 12:16:38 EDT: fh_schedule_callback: fh_schedule_callback: cc=4814DC84 prev_epc=495D24F8; epc=0

Jul  8 12:16:38 EDT: EEM server schedules callbacks: policy_type: 2

Jul  8 12:16:38 EDT: fh_schedule_policy: prev_epc=0x00000000; epc=0x00000000

Jul  8 12:16:38 EDT: EEM server schedules scripts

Jul  8 12:16:38 EDT: fh_server: fh_io_msg: received msg FH_MSG_API_CLOSE from client 36 pclient 1

Jul  8 12:16:38 EDT: fh_io_msg: received FH_MSG_API_CLOSE client=36

Jul  8 12:16:38 EDT: fh_fd_match_event: re=0x49997C40, policyname=Serial_Get_multiple_if, parameters=, get_tty=1

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Pushing tag on to stack

Jul  8 12:16:38 EDT: open tag is

Jul  8 12:16:38 EDT: Name-Value Pair: Name=(pdir) Value=(_event_severity)

Jul  8 12:16:38 EDT: Name-Value Pair: Name=(tcl) Value=(event_severity)

Jul  8 12:16:38 EDT: Pushing tag on to stack

Jul  8 12:16:38 EDT: open tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Pushing tag on to stack

Jul  8 12:16:38 EDT: open tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Pushing tag on to stack

Jul  8 12:16:38 EDT: open tag is

Jul  8 12:16:38 EDT: Name-Value Pair: Name=(pdir) Value=(_none_argc)

Jul  8 12:16:38 EDT: Name-Value Pair: Name=(tcl) Value=(argc)

Jul  8 12:16:38 EDT: Pushing tag on to stack

Jul  8 12:16:38 EDT: open tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: Popping tag off stack

Jul  8 12:16:38 EDT: close tag is

Jul  8 12:16:38 EDT: EEM: policy_dir xml builtin: name:_event_type value:131

Jul  8 12:16:38 EDT: EEM: policy_dir xml builtin: name:_event_type_string value:none

Jul  8 12:16:38 EDT: EEM: policy_dir xml builtin: name:_event_severity value:severity-normal

Jul  8 12:16:38 EDT: EEM: policy_dir xml builtin: name:_none_argc value:0

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_open called.

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : C

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *****************************************************************

*************

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *                             W A R N I N G !

            *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * This computer system and its network are private property and m

ay be       *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * accessed only by authorized users for official use only. Unauth

orized      *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * use of this system is strictly prohibited and may be subject to

criminal   *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * prosecution. All data contained within this system is privately

owned      *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * and may be monitored, intercepted, recorded, read, copied, or c

aptured     *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * in any manner and disclosed in any manner, by authorized person

nel.        *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * THERE IS NO RIGHT OF PRIVACY IN THIS SYSTEM. System personnel m

ay          *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * disclose any potential evidence of crime found on this system f

or any      *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * reason. USE OF THIS SYSTEM BY ANY USER, AUTHORIZED OR UNAUTHORI

ZED,        *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * CONSTITUTES CONSENT TO THIS MONITORING, INTERCEPTION, RECORDING

,           *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * READING, COPYING, or CAPTURING and DISCLOSURE.

            *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *****************************************************************

*************

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT :

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : IN  : csc-lab01#show ip int brief | inc ^Se|Mu

Jul  8 12:16:38 EDT: cli_history_entry_add: free_hist_list size=0, hist_list size=7

Jul  8 12:16:38 EDT: eem_no_scan flag set, skipping scan of command_string=check_eem_cli_policy_handler

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : Serial0/1/0:0              208.220.209.34  YES NVRAM  up

           up

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#

Jul  8 12:16:38 EDT: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: intf

Jul  8 12:16:38 EDT: %HA_EM-3-FMPD_ERROR: Error executing applet Serial_Get_multiple_if statement 1.8

Jul  8 12:16:38 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_close called.

Jul  8 12:16:38 EDT: fh_server: fh_io_msg: received msg FH_MSG_CALLBACK_DONE from client 36 pclient 1

Jul  8 12:16:38 EDT: fh_io_msg: EEM callback policy Serial_Get_multiple_if has ended with abnormal exit status of 0xFFFFFFFF

Jul  8 12:16:38 EDT: EEM fms_remote_chkpt_add_event_hist(), data_len = 2980, buf_size = 2992

Jul  8 12:16:38 EDT: fh_send_none_fd_msg: msg_type=18

Jul  8 12:16:38 EDT: fh_fd_none_publish_done: rc=1, re=49997C40

Jul  8 12:16:38 EDT: fh_fd_none_publish_done: rc=1, publish_expired=0

Jul  8 12:16:38 EDT:   sid=57, ptp=0x499990C0, connp=0x4940CB4C

Jul  8 12:16:38 EDT: none_conn_tm_remove: re=0x49997C40, ptp=0x499990C0

Jul  8 12:16:38 EDT: fh_fd_none_conn_tm_free: ptp=0x499990C0

Jul  8 12:16:38 EDT: fh_send_none_fd_msg: sval=0

Jul  8 12:16:38 EDT: EEM: server decrements in use thread: jobid=35 rule id=2 in use thread=4.

Jul  8 12:16:38 EDT: fh_schedule_callback: fh_schedule_callback: cc=4814DC84 prev_epc=495D24F8; epc=0

Jul  8 12:16:38 EDT: EEM server schedules callbacks: policy_type: 2

Jul  8 12:16:38 EDT: fh_schedule_policy: prev_epc=0x00000000; epc=0x00000000

Jul  8 12:16:38 EDT: EEM server schedules scripts

Jul  8 12:16:38 EDT: fh_server: fh_io_msg: received msg FH_MSG_API_CLOSE from client 36 pclient 1

Jul  8 12:16:38 EDT: fh_io_msg: received FH_MSG_API_CLOSE client=36

Jul  8 12:16:38 EDT: fh_fd_match_event: re=0x49997C40, policyname=Serial_Get_multiple_if, parameters=, get_tty=1

Cisco Employee

How to pull correct interface into EEM applet

Try:

event manager applet Serial_Get_multiple_if
event none
action 1.1 cli command "show ip int brief | inc ^Se|Mu"

action 1.2 foreach line $_cli_result "\n"

action 1.3 regexp "^(Se[^ ]+|Mu[^ ]+) +[0-9]" $line match intf

action 1.4 if $_regexp_result eq 1

action 1.5   break

action 1.6 end

action 1.7 end

action 1.8 puts "Interface is $intf"

New Member

How to pull correct interface into EEM applet

Looks like it is working better in that it is not getting the errors on action 1.8, but when I run the event manager applet, I get a blank line, instead of output.   Here is the debug from running the applet in your last post.  Thanks again for the help with this.

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Pushing tag on to stack

Jul  8 18:16:37 EDT: open tag is

Jul  8 18:16:37 EDT: Name-Value Pair: Name=(pdir) Value=(_event_severity)

Jul  8 18:16:37 EDT: Name-Value Pair: Name=(tcl) Value=(event_severity)

Jul  8 18:16:37 EDT: Pushing tag on to stack

Jul  8 18:16:37 EDT: open tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Pushing tag on to stack

Jul  8 18:16:37 EDT: open tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Pushing tag on to stack

Jul  8 18:16:37 EDT: open tag is

Jul  8 18:16:37 EDT: Name-Value Pair: Name=(pdir) Value=(_none_argc)

Jul  8 18:16:37 EDT: Name-Value Pair: Name=(tcl) Value=(argc)

Jul  8 18:16:37 EDT: Pushing tag on to stack

Jul  8 18:16:37 EDT: open tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: EEM: policy_dir xml builtin: name:_event_type value:131

Jul  8 18:16:37 EDT: EEM: policy_dir xml builtin: name:_event_type_string value:none

Jul  8 18:16:37 EDT: EEM: policy_dir xml builtin: name:_event_severity value:severity-normal

Jul  8 18:16:37 EDT: EEM: policy_dir xml builtin: name:_none_argc value:0

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_open called.

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : C

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : ****************************************************************

*************

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *                             W A R N I N G !

            *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * This computer system and its network are private property and

ay be       *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * accessed only by authorized users for official use only. Unaut

orized      *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * use of this system is strictly prohibited and may be subject t

criminal   *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * prosecution. All data contained within this system is privatel

owned      *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * and may be monitored, intercepted, recorded, read, copied, or

aptured     *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * in any manner and disclosed in any manner, by authorized perso

nel.        *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * THERE IS NO RIGHT OF PRIVACY IN THIS SYSTEM. System personnel

ay          *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * disclose any potential evidence of crime found on this system

or any      *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * reason. USE OF THIS SYSTEM BY ANY USER, AUTHORIZED OR UNAUTHOR

ZED,        *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * CONSTITUTES CONSENT TO THIS MONITORING, INTERCEPTION, RECORDIN

,           *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * READING, COPYING, or CAPTURING and DISCLOSURE.

            *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : ****************************************************************

*************

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT :

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : IN  : csc-lab01#show ip int brief | inc ^Se|Mu

Jul  8 18:16:37 EDT: cli_history_entry_add: free_hist_list size=0, hist_list size=7

Jul  8 18:16:37 EDT: eem_no_scan flag set, skipping scan of command_string=check_eem_cli_policy_handler

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : Serial0/1/0:0              208.220.209.34  YES NVRAM  up

           up

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_close called.

Jul  8 18:16:37 EDT: fh_server: fh_io_msg: received msg FH_MSG_CALLBACK_DONE from client 38 pclient 1

Jul  8 18:16:37 EDT: fh_io_msg: EEM callback policy Serial_Get_multiple_if has ended with normal exit status of 0x0

Jul  8 18:16:37 EDT: EEM fms_remote_chkpt_add_event_hist(), data_len = 2980, buf_size = 2992

Jul  8 18:16:37 EDT: fh_send_none_fd_msg: msg_type=18

Jul  8 18:16:37 EDT: fh_fd_none_publish_done: rc=0, re=49998000

Jul  8 18:16:37 EDT: fh_fd_none_publish_done: rc=0, publish_expired=0

Jul  8 18:16:37 EDT:   sid=58, ptp=0x49998400, connp=0x4940F5CC

Jul  8 18:16:37 EDT: none_conn_tm_remove: re=0x49998000, ptp=0x49998400

Jul  8 18:16:37 EDT: fh_fd_none_conn_tm_free: ptp=0x49998400

Jul  8 18:16:37 EDT: fh_send_none_fd_msg: sval=0

Jul  8 18:16:37 EDT: EEM: server decrements in use thread: jobid=37 rule id=2 in use thread=4.

Jul  8 18:16:37 EDT: fh_schedule_callback: fh_schedule_callback: cc=4814DC84 prev_epc=4A3F7928; epc=0

Jul  8 18:16:37 EDT: EEM server schedules callbacks: policy_type: 2

Jul  8 18:16:37 EDT: fh_schedule_policy: prev_epc=0x00000000; epc=0x00000000

Jul  8 18:16:37 EDT: EEM server schedules scripts

Jul  8 18:16:37 EDT: fh_fd_match_event: re=0x49998000, policyname=Serial_Get_multiple_if, parameters=, get_tty=1

Jul  8 18:16:37 EDT: fh_server: fh_io_msg: received msg FH_MSG_API_CLOSE from client 38 pclient 1

Jul  8 18:16:37 EDT: fh_io_msg: received FH_MSG_API_CLOSE client=38

Jul  8 18:17:00 EDT: fh_fd_timer_process_async

Jul  8 18:17:00 EDT: cron_tick: num_matches 0

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Pushing tag on to stack

Jul  8 18:16:37 EDT: open tag is

Jul  8 18:16:37 EDT: Name-Value Pair: Name=(pdir) Value=(_event_severity)

Jul  8 18:16:37 EDT: Name-Value Pair: Name=(tcl) Value=(event_severity)

Jul  8 18:16:37 EDT: Pushing tag on to stack

Jul  8 18:16:37 EDT: open tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Pushing tag on to stack

Jul  8 18:16:37 EDT: open tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Pushing tag on to stack

Jul  8 18:16:37 EDT: open tag is

Jul  8 18:16:37 EDT: Name-Value Pair: Name=(pdir) Value=(_none_argc)

Jul  8 18:16:37 EDT: Name-Value Pair: Name=(tcl) Value=(argc)

Jul  8 18:16:37 EDT: Pushing tag on to stack

Jul  8 18:16:37 EDT: open tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: Popping tag off stack

Jul  8 18:16:37 EDT: close tag is

Jul  8 18:16:37 EDT: EEM: policy_dir xml builtin: name:_event_type value:131

Jul  8 18:16:37 EDT: EEM: policy_dir xml builtin: name:_event_type_string value:none

Jul  8 18:16:37 EDT: EEM: policy_dir xml builtin: name:_event_severity value:severity-normal

Jul  8 18:16:37 EDT: EEM: policy_dir xml builtin: name:_none_argc value:0

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_open called.

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : C

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : ****************************************************************

*************

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *                             W A R N I N G !

            *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * This computer system and its network are private property and

ay be       *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * accessed only by authorized users for official use only. Unaut

orized      *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * use of this system is strictly prohibited and may be subject t

criminal   *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * prosecution. All data contained within this system is privatel

owned      *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * and may be monitored, intercepted, recorded, read, copied, or

aptured     *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * in any manner and disclosed in any manner, by authorized perso

nel.        *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * THERE IS NO RIGHT OF PRIVACY IN THIS SYSTEM. System personnel

ay          *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * disclose any potential evidence of crime found on this system

or any      *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * reason. USE OF THIS SYSTEM BY ANY USER, AUTHORIZED OR UNAUTHOR

ZED,        *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * CONSTITUTES CONSENT TO THIS MONITORING, INTERCEPTION, RECORDIN

,           *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * READING, COPYING, or CAPTURING and DISCLOSURE.

            *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : ****************************************************************

*************

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT :

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : IN  : csc-lab01#show ip int brief | inc ^Se|Mu

Jul  8 18:16:37 EDT: cli_history_entry_add: free_hist_list size=0, hist_list size=7

Jul  8 18:16:37 EDT: eem_no_scan flag set, skipping scan of command_string=check_eem_cli_policy_handler

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : Serial0/1/0:0              208.220.209.34  YES NVRAM  up

           up

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#

Jul  8 18:16:37 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_close called.

Jul  8 18:16:37 EDT: fh_server: fh_io_msg: received msg FH_MSG_CALLBACK_DONE from client 38 pclient 1

Jul  8 18:16:37 EDT: fh_io_msg: EEM callback policy Serial_Get_multiple_if has ended with normal exit status of 0x0

Jul  8 18:16:37 EDT: EEM fms_remote_chkpt_add_event_hist(), data_len = 2980, buf_size = 2992

Jul  8 18:16:37 EDT: fh_send_none_fd_msg: msg_type=18

Jul  8 18:16:37 EDT: fh_fd_none_publish_done: rc=0, re=49998000

Jul  8 18:16:37 EDT: fh_fd_none_publish_done: rc=0, publish_expired=0

Jul  8 18:16:37 EDT:   sid=58, ptp=0x49998400, connp=0x4940F5CC

Jul  8 18:16:37 EDT: none_conn_tm_remove: re=0x49998000, ptp=0x49998400

Jul  8 18:16:37 EDT: fh_fd_none_conn_tm_free: ptp=0x49998400

Jul  8 18:16:37 EDT: fh_send_none_fd_msg: sval=0

Jul  8 18:16:37 EDT: EEM: server decrements in use thread: jobid=37 rule id=2 in use thread=4.

Jul  8 18:16:37 EDT: fh_schedule_callback: fh_schedule_callback: cc=4814DC84 prev_epc=4A3F7928; epc=0

Jul  8 18:16:37 EDT: EEM server schedules callbacks: policy_type: 2

Jul  8 18:16:37 EDT: fh_schedule_policy: prev_epc=0x00000000; epc=0x00000000

Jul  8 18:16:37 EDT: EEM server schedules scripts

Jul  8 18:16:37 EDT: fh_fd_match_event: re=0x49998000, policyname=Serial_Get_multiple_if, parameters=, get_tty=1

Jul  8 18:16:37 EDT: fh_server: fh_io_msg: received msg FH_MSG_API_CLOSE from client 38 pclient 1

Jul  8 18:16:37 EDT: fh_io_msg: received FH_MSG_API_CLOSE client=38

Jul  8 18:17:00 EDT: fh_fd_timer_process_async

Jul  8 18:17:00 EDT: cron_tick: num_matches 0

New Member

How to pull correct interface into EEM applet

I shortened to the applet config below and it output the Serial interface correctly.  Am I losing anything by doing it this way?

event manager applet Serial_Get_multiple_if
event none
action 1.1 cli command "show ip int brief | inc ^Se|Mu"

action 1.21 set intf "none"

action 1.3 regexp "^(Se[^ ]+|Mu[^ ]+) +[0-9]" $_cli_result result intf

action 1.8 puts "Interface is $intf"

OUTPUT:

csc-lab01#event manager run Serial_Get_multiple_if

Interface is Serial0/1/0:0

Debug Output:

Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Popping tag off stack

Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Pushing tag on to stack

Jul  8 19:11:27 EDT: open tag is

Jul  8 19:11:27 EDT: Name-Value Pair: Name=(pdir) Value=(_event_severity)

Jul  8 19:11:27 EDT: Name-Value Pair: Name=(tcl) Value=(event_severity)

Jul  8 19:11:27 EDT: Pushing tag on to stack

Jul  8 19:11:27 EDT: open tag is

Jul  8 19:11:27 EDT: Popping tag off stack

Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Popping tag off stack

Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Pushing tag on to stack

Jul  8 19:11:27 EDT: open tag is

Jul  8 19:11:27 EDT: Popping tag off stack

Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Popping tag off stack

Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Pushing tag on to stack

Jul  8 19:11:27 EDT: open tag is

Jul  8 19:11:27 EDT: Name-Value Pair: Name=(pdir) Value=(_none_argc)

Jul  8 19:11:27 EDT: Name-Value Pair: Name=(tcl) Value=(argc)

Jul  8 19:11:27 EDT: Pushing tag on to stack

Jul  8 19:11:27 EDT: open tag is

Jul  8 19:11:27 EDT: Popping tag off stack

Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Popping tag off stack

Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Popping tag off stack

Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: EEM: policy_dir xml builtin: name:_event_type value:131

Jul  8 19:11:27 EDT: EEM: policy_dir xml builtin: name:_event_type_string value:none

Jul  8 19:11:27 EDT: EEM: policy_dir xml builtin: name:_event_severity value:severity-normal

Jul  8 19:11:27 EDT: EEM: policy_dir xml builtin: name:_none_argc value:0

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_open called.

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : C

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *****************************************************************

*************

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *                             W A R N I N G !

            *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * This computer system and its network are private property and m

ay be       *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * accessed only by authorized users for official use only. Unauth

orized      *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * use of this system is strictly prohibited and may be subject to

criminal   *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * prosecution. All data contained within this system is privately

owned      *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * and may be monitored, intercepted, recorded, read, copied, or c

aptured     *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * in any manner and disclosed in any manner, by authorized person

nel.        *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * THERE IS NO RIGHT OF PRIVACY IN THIS SYSTEM. System personnel m

ay          *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * disclose any potential evidence of crime found on this system f

or any      *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * reason. USE OF THIS SYSTEM BY ANY USER, AUTHORIZED OR UNAUTHORI

ZED,        *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * CONSTITUTES CONSENT TO THIS MONITORING, INTERCEPTION, RECORDING

,           *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * READING, COPYING, or CAPTURING and DISCLOSURE.

            *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *

            *

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *****************************************************************

*************

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT :

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : IN  : csc-lab01#show ip int brief | inc ^Se|Mu

Jul  8 19:11:27 EDT: cli_history_entry_add: free_hist_list size=0, hist_list size=7

Jul  8 19:11:27 EDT: eem_no_scan flag set, skipping scan of command_string=check_eem_cli_policy_handler

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : Serial0/1/0:0              208.220.209.34  YES NVRAM  up

           up

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#

Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_close called.

Jul  8 19:11:27 EDT: fh_server: fh_io_msg: received msg FH_MSG_CALLBACK_DONE from client 49 pclient 1

Jul  8 19:11:27 EDT: fh_io_msg: EEM callback policy Serial_Get_multiple_if has ended with normal exit status of 0x0

Jul  8 19:11:27 EDT: EEM fms_remote_chkpt_add_event_hist(), data_len = 2980, buf_size = 2992

Jul  8 19:11:27 EDT: fh_send_none_fd_msg: msg_type=18

Jul  8 19:11:27 EDT: fh_fd_none_publish_done: rc=0, re=499963C0

Jul  8 19:11:27 EDT: fh_fd_none_publish_done: rc=0, publish_expired=0

Jul  8 19:11:27 EDT:   sid=63, ptp=0x49997940, connp=0x4940BF94

Jul  8 19:11:27 EDT: none_conn_tm_remove: re=0x499963C0, ptp=0x49997940

Jul  8 19:11:27 EDT: fh_fd_none_conn_tm_free: ptp=0x49997940

Jul  8 19:11:27 EDT: fh_send_none_fd_msg: sval=0

Jul  8 19:11:27 EDT: EEM: server decrements in use thread: jobid=48 rule id=2 in use thread=4.

Jul  8 19:11:27 EDT: fh_schedule_callback: fh_schedule_callback: cc=4814DC84 prev_epc=496E31A8; epc=0

Jul  8 19:11:27 EDT: EEM server schedules callbacks: policy_type: 2

Jul  8 19:11:27 EDT: fh_schedule_policy: prev_epc=0x00000000; epc=0x00000000

Jul  8 19:11:27 EDT: EEM server schedules scripts

Jul  8 19:11:27 EDT: fh_fd_match_event: re=0x499963C0, policyname=Serial_Get_multiple_if, parameters=, get_tty=1

Jul  8 19:11:27 EDT: fh_server: fh_io_msg: received msg FH_MSG_API_CLOSE from client 49 pclient 1

Jul  8 19:11:27 EDT: fh_io_msg: received FH_MSG_API_CLOSE client=49

Jul  8 19:12:00 EDT: fh_fd_timer_process_async

Jul  8 19:12:00 EDT: cron_tick: num_matches 0 Jul  8 19:11:27 EDT: close tag is
Jul  8 19:11:27 EDT: Popping tag off stack
Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Pushing tag on to stack
Jul  8 19:11:27 EDT: open tag is
Jul  8 19:11:27 EDT: Name-Value Pair: Name=(pdir) Value=(_event_severity)
Jul  8 19:11:27 EDT: Name-Value Pair: Name=(tcl) Value=(event_severity)
Jul  8 19:11:27 EDT: Pushing tag on to stack
Jul  8 19:11:27 EDT: open tag is
Jul  8 19:11:27 EDT: Popping tag off stack
Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Popping tag off stack
Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Pushing tag on to stack
Jul  8 19:11:27 EDT: open tag is
Jul  8 19:11:27 EDT: Popping tag off stack
Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Popping tag off stack
Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Pushing tag on to stack
Jul  8 19:11:27 EDT: open tag is
Jul  8 19:11:27 EDT: Name-Value Pair: Name=(pdir) Value=(_none_argc)
Jul  8 19:11:27 EDT: Name-Value Pair: Name=(tcl) Value=(argc)
Jul  8 19:11:27 EDT: Pushing tag on to stack
Jul  8 19:11:27 EDT: open tag is
Jul  8 19:11:27 EDT: Popping tag off stack
Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Popping tag off stack
Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: Popping tag off stack
Jul  8 19:11:27 EDT: close tag is

Jul  8 19:11:27 EDT: EEM: policy_dir xml builtin: name:_event_type value:131
Jul  8 19:11:27 EDT: EEM: policy_dir xml builtin: name:_event_type_string value:none
Jul  8 19:11:27 EDT: EEM: policy_dir xml builtin: name:_event_severity value:severity-normal
Jul  8 19:11:27 EDT: EEM: policy_dir xml builtin: name:_none_argc value:0
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_open called.
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : C
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *****************************************************************
*************
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *                             W A R N I N G !
            *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *
            *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * This computer system and its network are private property and m
ay be       *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * accessed only by authorized users for official use only. Unauth
orized      *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * use of this system is strictly prohibited and may be subject to
criminal   *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * prosecution. All data contained within this system is privately
owned      *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * and may be monitored, intercepted, recorded, read, copied, or c
aptured     *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * in any manner and disclosed in any manner, by authorized person
nel.        *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *
            *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * THERE IS NO RIGHT OF PRIVACY IN THIS SYSTEM. System personnel m
ay          *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * disclose any potential evidence of crime found on this system f
or any      *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * reason. USE OF THIS SYSTEM BY ANY USER, AUTHORIZED OR UNAUTHORI
ZED,        *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * CONSTITUTES CONSENT TO THIS MONITORING, INTERCEPTION, RECORDING
,           *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : * READING, COPYING, or CAPTURING and DISCLOSURE.
            *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *
            *
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : *****************************************************************
*************
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT :
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : IN  : csc-lab01#show ip int brief | inc ^Se|Mu
Jul  8 19:11:27 EDT: cli_history_entry_add: free_hist_list size=0, hist_list size=7
Jul  8 19:11:27 EDT: eem_no_scan flag set, skipping scan of command_string=check_eem_cli_policy_handler
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : Serial0/1/0:0              208.220.209.34  YES NVRAM  up
           up
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : OUT : csc-lab01#
Jul  8 19:11:27 EDT: %HA_EM-6-LOG: Serial_Get_multiple_if : DEBUG(cli_lib) : : CTL : cli_close called.
Jul  8 19:11:27 EDT: fh_server: fh_io_msg: received msg FH_MSG_CALLBACK_DONE from client 49 pclient 1
Jul  8 19:11:27 EDT: fh_io_msg: EEM callback policy Serial_Get_multiple_if has ended with normal exit status of 0x0
Jul  8 19:11:27 EDT: EEM fms_remote_chkpt_add_event_hist(), data_len = 2980, buf_size = 2992
Jul  8 19:11:27 EDT: fh_send_none_fd_msg: msg_type=18
Jul  8 19:11:27 EDT: fh_fd_none_publish_done: rc=0, re=499963C0
Jul  8 19:11:27 EDT: fh_fd_none_publish_done: rc=0, publish_expired=0
Jul  8 19:11:27 EDT:   sid=63, ptp=0x49997940, connp=0x4940BF94
Jul  8 19:11:27 EDT: none_conn_tm_remove: re=0x499963C0, ptp=0x49997940
Jul  8 19:11:27 EDT: fh_fd_none_conn_tm_free: ptp=0x49997940
Jul  8 19:11:27 EDT: fh_send_none_fd_msg: sval=0
Jul  8 19:11:27 EDT: EEM: server decrements in use thread: jobid=48 rule id=2 in use thread=4.
Jul  8 19:11:27 EDT: fh_schedule_callback: fh_schedule_callback: cc=4814DC84 prev_epc=496E31A8; epc=0
Jul  8 19:11:27 EDT: EEM server schedules callbacks: policy_type: 2
Jul  8 19:11:27 EDT: fh_schedule_policy: prev_epc=0x00000000; epc=0x00000000
Jul  8 19:11:27 EDT: EEM server schedules scripts
Jul  8 19:11:27 EDT: fh_fd_match_event: re=0x499963C0, policyname=Serial_Get_multiple_if, parameters=, get_tty=1
Jul  8 19:11:27 EDT: fh_server: fh_io_msg: received msg FH_MSG_API_CLOSE from client 49 pclient 1
Jul  8 19:11:27 EDT: fh_io_msg: received FH_MSG_API_CLOSE client=49
Jul  8 19:12:00 EDT: fh_fd_timer_process_async
Jul  8 19:12:00 EDT: cron_tick: num_matches 0

New Member

How to pull correct interface into EEM applet

I installed another Serial interface just to verify and the applet only returns the one with the IP address, which is exactly what I needed.  I'm now trying to figure out how to get this output to be entered into my event tags that occur prior to any actions. (So that only the interface that has an IP address is monitored by the EEM applet)  Is there a way for an action to occur before the event tag to define a parameter, or can another EEM script define a value for a this one?

event manager applet Serial_if

event tag if_1 interface name Serial0/1/0:0 parameter input_errors_crc entry-op ge entry-val 2 entry-type increment poll-interval 20

event tag if_2 interface name Serial0/1/0:0 parameter input_errors entry-op ge entry-val 2 entry-type increment poll-interval 20

event tag if_3 interface name Serial0/1/0:0 parameter input_errors_frame entry-op ge entry-val 2 entry-type increment poll-interval 20

event tag if_4 interface name Serial0/1/0:0 parameter input_errors_overrun entry-op ge entry-val 2 entry-type increment poll-interval 20

event tag if_5 interface name Serial0/1/0:0 parameter output_errors entry-op ge entry-val 2 entry-type increment poll-interval 20

event tag if_6 interface name Serial0/1/0:0 parameter output_errors_underrun entry-op ge entry-val 2 entry-type increment poll-interval 20

trigger occurs 1

correlate event if_1 or event if_2 or event if_3 or event if_4 or event if_5 or event if_6

action 100 cli command "enable"

action 200 cli command "config t"

action 300 cli command "int Serial0/1/0:0"

action 400 cli command "shutdown"

action 401 set syslog_msg "CRC failure leased line $_interface_name"

action 500 syslog msg "$syslog_msg"

Cisco Employee

How to pull correct interface into EEM applet

You can have one applet configure a second.  It's called nesting.  Just make sure to define the following environment variable, then replace any nested quotes with $q:

event manager environment q "

For example:

action 010 cli command "action 200 cli command $q config t$q"

Cisco Employee

How to pull correct interface into EEM applet

Instead of break, it may have worked if you did a goto 1.8.  In Tcl,  the break would have worked.  It should have worked in applet syntax,  too.  Note: you may need to add the following on some configurations:

action 1.0 cli command "enable"

687
Views
0
Helpful
12
Replies
CreatePlease login to create content