Showing results for 
Search instead for 
Did you mean: 

event_register_mat question

Level 1
Level 1


I'm writing an EEM script to detect when a MAC address is added to the MAC address-table and I have a question about how to get the added MAC address and the interface it was added on and set them as variables.  I've attached the script and output from "debug event manager detector mat". 

I can see the info being returned:

Oct  2 14:49:05: fh_fd_mat_event_match: intf=FastEthernet1/0/1, mac=0050.600c.153b, type=0

I just can't figure out how to get it, then set it.  See attached files for details.




3 Replies 3

Level 1
Level 1

The various ways I've tried to extract the MAC and intfc info:

array set arr_einfo [event_reqinfo]

set macAddr $arr_einfo(mac_address)
set intfc $arr_einfo(intf_name)

set macAddr $arr_einfo(mac)
set intfc $arr_einfo(intf)

set macAddr $mac_address
set intfc $intf_name

set macAddr $_mac_address
set intfc $_intf_name

set macAddr $_mac
set intfc $_intf


The proper solution would be:


set macAddr $arr_einfo(mac_address)

set intfc $arr_einfo(intf_name)

puts $macAddr

puts $intfc


The other attempts will cause the script to die with an error.

Hi Joseph,

How to use event mat in 3560? I cannot see the event being triggered.


SW3(config-if)#do sh run | s mac
event manager applet smart_bpdu_guard_mac_detection
 event mat interface regexp .*Ethernet.* type add
 action 0.0 syslog msg "OK!!!!!!!!!"
*Mar  1 05:20:54.807: fh_send_mat_fd_msg: msg_type=114
*Mar  1 05:20:54.807: [fh_fd_mat_event_nvgen]
*Mar  1 05:20:54.807: fh_send_mat_fd_msg: sval=0


SW3#sh even manager version
Embedded Event Manager Version 3.20
Component Versions:
eem: (320_rel3)1.0.0
eem-gold: (v320_rel1)1.0.0
eem-call-home: (v320_rel1)1.0.2
Event Detectors:
Name                Version   Node        Type
application         01.00     node0/0     RP
routing             03.00     node0/0     RP
syslog              01.00     node0/0     RP
identity            01.00     node0/0     RP
neighbor-discovery  01.00     node0/0     RP
mat                 01.00     node0/0     RP
cli                 01.00     node0/0     RP
counter             01.00     node0/0     RP
interface           01.00     node0/0     RP
ioswdsysmon         01.00     node0/0     RP
none                01.00     node0/0     RP
oir                 01.00     node0/0     RP
snmp                01.00     node0/0     RP
timer               01.00     node0/0     RP
snmp-object         01.00     node0/0     RP
snmp-notification   01.00     node0/0     RP
ipsla               01.00     node0/0     RP
test                01.00     node0/0     RP
config              01.00     node0/0     RP
env                 01.00     node0/0     RP
gold                01.00     node0/0     RP
rpc                 01.00     node0/0     RP
SW3#sh ver
Cisco IOS Software, C3560 Software (C3560-IPSERVICESK9-M), Version 15.0(2)SE, RELEASE SOFTWARE (fc1)
Technical Support:
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Sat 28-Jul-12 00:01 by prod_rel_team

ROM: Bootstrap program is C3560 boot loader
BOOTLDR: C3560 Boot Loader (C3560-HBOOT-M) Version 12.2(46r)SE1, RELEASE SOFTWARE (fc1)