Running Macros - Juniper SYSTEM BASICS - CONFIGURATION GUIDE V 11.1.X Configuration Manual

System basics configuration guide software for e series broadband services routers
Table of Contents

Advertisement

JUNOSe 11.1.x System Basics Configuration Guide
host1# macro badMacroInvocation.mac badMacroInvocation
Macro 'badMacroInvocation' in file 'badMacroInvocation.mac' starting execution (Id: 407)
% can't find macro foo
Macro 'badMacroInvocation' in file 'badMacroInvocation.mac' ending execution (Id: 407)
You can determine the execution progress through the runStatus result entry in the
macroData log file. For this example, the log output indicates the macro error and
displays the following to indicate that the macro ended prior to invoking the macro:
start
host1# show log data category macrodata severity debug
NOTICE 05/27/2005 12:39:10 macroData: Macro 'badMacroInvocation' in file 'badMacroInvocation.mac' starting
execution (Id: 407) on vty, 0
ERROR 05/27/2005 12:39:10 macroData: (Id: 407) Command error: foo, macro not found
NOTICE 05/27/2005 12:39:10 macroData: (Id: 407) commandError is foo
NOTICE 05/27/2005 12:39:10 macroData: (Id: 407) commandErrorStatus is macro not found
NOTICE 05/27/2005 12:39:10 macroData: (Id: 407) runStatus is start
NOTICE 05/27/2005 12:39:10 macroData: Macro 'badMacroInvocation' in file 'badMacroInvocation.mac' ending
execution (Id: 407) on vty, 0

Running Macros

Although you must write macros on a computer, you can copy them to the system.
Issue the macro command from the CLI to execute both local macros and macros
stored remotely.
You can display the commands that are generated by the macro file without executing
the commands by using the test keyword. We recommend you confirm that the test
display matches your expectations before you execute the macro to run the
commands.
You can terminate a macro while it is running by pressing Ctrl+c. You can close
Telnet and SSH windows while a macro is running, but the macro does not terminate
until it completes the current command.
macro
496
Running Macros
Use to execute a macro that generates and can execute CLI commands. This
command is available in all command modes.
This command invokes a hidden FTP client and takes place in the context of the
current virtual router (VR) rather than the default VR. You must configure the
FTP server so that any traffic destined for the VR can reach the VR; typically,
you configure the FTP server to reach the default address of the system, which
will always be able to reach the VR.
You can specify both a macro filename and a macro contained within that file.
For example, the following command looks for the file confatm.mac and runs
the macro named atm0verDs3 contained within the file:
host1(config)#macro confatm.mac atm0verDs3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junose 11.1

Table of Contents