Cisco Catalyst 2950 Command Reference Manual page 232

Hide thumbs Also See for Catalyst 2950:
Table of Contents

Advertisement

macro global
When you apply a macro to a switch, the macro name is automatically added to the switch. You can view
the applied commands and macro names by using the show running-configuration user EXEC
command.
You can delete a global macro-applied configuration on a switch only by entering the no version of each
command contained in the macro.
Examples
After you have created a new macro by using the macro name global configuration command, you can
apply it to a switch. This example shows how display the snmp macro and how to apply the macro and
set the host name to test-server and set the IP precedence value to 7:
Switch# show parser macro name snmp
Macro name : snmp
Macro type : customizable
#enable port security, linkup, and linkdown traps
snmp-server enable traps port-security
snmp-server enable traps linkup
snmp-server enable traps linkdown
#set snmp-server host
snmp-server host ADDRESS
#set SNMP trap notifications precedence
snmp-server ip precedence VALUE
--------------------------------------------------
Switch(config)# macro global apply snmp ADDRESS test-server VALUE 7
To debug a macro, use the macro global trace global configuration command to find any syntax or
configuration errors in the macro when it is applied to a switch. In this example, the
value was not entered, causing the
is applied to the switch:
Switch(config)# macro global trace snmp VALUE 7
Applying command...'snmp-server enable traps port-security'
Applying command...'snmp-server enable traps linkup'
Applying command...'snmp-server enable traps linkdown'
Applying command...'snmp-server host'
%Error Unknown error.
Applying command...'snmp-server ip precedence 7'
Related Commands
Command
macro apply
macro description
macro global
description
macro name
show parser macro
Catalyst 2950 and Catalyst 2955 Switch Command Reference
2-202
Keywords that begin with $ mean that a unique parameter value is required. Append the
Cisco-default macro with the required values by using the parameter value keywords.
The Cisco-default macros use the $ character to help identify required keywords. There is no
restriction on using the $ character to define keywords when you create a macro.
Description
Applies a macro on an interface or applies and traces a macro on an
interface.
Adds a description about the macros that are applied to an interface.
Adds a description about the macros that are applied to the switch.
Creates a macro.
Displays the macro definition for all macros or for the specified macro.
Chapter 2
command to fail while the remainder of the macro
snmp-server host
Catalyst 2950 and 2955 Cisco IOS Commands
parameter
ADDRESS
OL-10102-01

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Catalyst 2955

Table of Contents