Specifications
2-353
Catalyst 4500 Se ries S wit ch C is co IO S C om mand R efer ence —Re lease I OS XE 3 .3.0 XO(1 5.1 (1)XO)
OL_28738 -01
Chapter 2 Cisco IOS Commands for the Catalyst 4500 Series Switches
macro auto execute (user-defined function)
macro auto ex ecute (user-def ined functi on)
Use the macro auto execut e configuration command to map a trigger to a user-defined function. Use
the no form of this command to unmap the trigger.
macro auto execute trigger_name [param_name=value] {function body}
no macro auto execute trigger_name [param_name=value]
Syntax Description
Defaults None
Command Modes Global configuration
Usage Guidelines Because the function defined in this command does not have a name, you cannot use it to map to
another trigger. This is the only way that you c an map a trigger to a user defined f unction. Shell
functions defined in the non-configu re mode can not be used to map tr iggers.
Examples This example shows how to map the user-defined event trigger Cisco Digi tal Media P layer (DM P) to a
user-defined macro.
a. Connect the DMP to an 802.1x- or MAB-ena bled switch port.
b. On the RADIUS server, set the attribute-value pair to auto-smart-port=CISCO_DMP_E VENT.
c. On the switch, create the event trigger CISCO_DMP_EVENT, and enter the user-defined macro
commands shown bel ow.
d. The switch recognizes the attribute-value pair=CISCO_DMP_EVENT response from the RADIUS
server and applies the macro associated with this event trigger.
Switch(config)# shell trigger CISCO_DMP_EVENT Cisco DMP player
Switch(config)# macro auto execute CISCO_DMP_EVENT {
if [[ $LINKUP -eq YES ]]; then
conf t
interface $INTERFACE
macro description $TRIGGER
switchport access vlan 1
switchport mode access
switchport port-security
switchport port-security maximum 1
switchport port-security violation restrict
switchport port-security aging time 2
switchport port-security aging type inactivity
spanning-tree portfast
spanning-tree bpduguard enable
trigger_name Specifies the trigger name.
param name=value (Optional) Specifies values for the parameters that are to be used in the
function body.
function_body Shell functions with CLIs.