Macro Auto Execute (User-Defined Function) - Cisco Catalyst 4500 Series Command Reference Manual

Cisco ios command reference
Hide thumbs Also See for Catalyst 4500 Series:
Table of Contents

Advertisement

Chapter 2
Cisco IOS Commands for the Catalyst 4500 Series Switches

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.
Syntax Description
trigger_name
param name=value
function_body
Defaults
None.
Command Modes
Global configuration
Command History
Release
12.2(54)SG
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.
b.
c.
d.
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
OL-25342 -01
macro auto execute trigger_name [param_name=value] {function body}
no macro auto execute trigger_name [param_name=value]
Specifies the trigger name.
(Optional) Specifies values for the parameters that are to be used in the
function body.
Shell functions with CLIs.
Modification
This command was introduced on the Catalyst 4500 series switch.
Connect the DMP to an 802.1x- or MAB-enabled switch port.
On the RADIUS server, set the attribute-value pair to auto-smart-port=CISCO_DMP_EVENT.
On the switch, create the event trigger CISCO_DMP_EVENT, and enter the user-defined macro
commands shown below.
The switch recognizes the attribute-value pair=CISCO_DMP_EVENT response from the RADIUS
server and applies the macro associated with this event trigger.
Catalyst 4500 Series Switch Cisco IOS Command Reference—Release IOS XE 3.3.0SG and IOS 15.1(1)SG)
macro auto execute (user-defined function)
2-417

Advertisement

Table of Contents
loading

Table of Contents