2-439
Catalyst 4500 Series Switch Cisco IOS Command Reference—Release IOS XE 3.4.0SG and IOS 15.1(2)SG)
OL-27596 -01
Chapter 2 Cisco IOS Commands for the Catalyst 4500 Series Switches
macro auto execute (user-defined function)
macro auto execute (user-defined function)
Use the macro auto execute 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
Command History
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 can map a trigger to a user defined function. Shell
functions defined in the non-configure mode can not be used to map triggers.
Examples This example shows how to map the user-defined event trigger Cisco Digital Media Player (DMP) to a
user-defined macro.
a. Connect the DMP to an 802.1x- or MAB-enabled switch port.
b. On the RADIUS server, set the attribute-value pair to auto-smart-port=CISCO_DMP_EVENT.
c. On the switch, create the event trigger CISCO_DMP_EVENT, and enter the user-defined macro
commands shown below.
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
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.
Release Modification
12.2(54)SG This command was introduced on the Catalyst 4500 series switch.