Detecting Invalid Commands - 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
Enter configuration commands, one per line.
ERX-40-94-fb(config)#interface fastEthernet 500
% invalid interface format
Macro 'badInterfaceCommandMacro' in file 'testInterfaceCommand.mac' ending execution (Id: 402)
You can determine the execution progress through the runStatus result entry in the
macroData log file. For this example, the runStatus value of 500 indicates that the
macro ended early.
host1(config)# show log data category macroData severity debug
NOTICE 01/07/2006 09:46:57 macroData: Macro 'badInterfaceCommandMacro' in file 'testInterfaceCommand.mac'
starting execution (Id: 402) on vty, 0
ERROR 01/07/2006 09:46:57 macroData: (Id: 402) Command error: interface fastEthernet 500, Command execution
error
NOTICE 01/07/2006 09:46:57 macroData: (Id: 402) commandError is interface fastEthernet 500
NOTICE 01/07/2006 09:46:57 macroData: (Id: 402) commandErrorStatus is Command execution error
NOTICE 01/07/2006 09:46:57 macroData: (Id: 402) runStatus is Loop:500
NOTICE 01/07/2006 09:46:57 macroData: Macro 'badInterfaceCommandMacro' in file 'testInterfaceCommand.mac'
ending execution (Id: 402) on vty, 0

Detecting Invalid Commands

In this example, the following macro file (badExecCommand.mac) is programmed to
executes four exec mode commands. However, the second command in the sequence
is invalid.
If the macro were to run to completion, the following commands would be executed:
494
Detecting and Recording Macro Errors
End with ^Z.
^
<# badExecCommandMacro #>
<# env.setResult("runStatus","start" ) #>
show clock
<# env.setResult("runStatus","after first show clock" ) #>
foo
<# env.setResult("runStatus","after foo" ) #>
show privilege
<# env.setResult("runStatus","after show privilege" ) #>
show clock
<# env.setResult("runStatus","complete" ) #>
<#endtmpl#>
<# onerror #>
<# errCmd := env.getErrorCommand #>
<# errStatus := env.getErrorStatus #>
<# env.setResult("commandError", errCmd) #>
<# env.setResult("commandErrorStatus", errStatus) #>
<#endtmpl#>
show clock
foo
show privilege
show clock

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junose 11.1

Table of Contents