ERX-40-4a-cc#macro b.mac badInt
Macro 'badInt' in file 'b.mac' starting execution (Id: 18)
Enter configuration commands, one per line. End with ^Z.
The interface command contains a bad interface value.
ERX-40-4a-cc(config)#interface fast 9/0
^
% interface not found
The CLI reports a syntax error and the macro onError is called. Within the onError macro,
the global variable interface is retrieved.
The interface value: 9/0
The macro terminates.
Macro 'badInt' in file 'b.mac' ending execution (Id: 18)
Unique IDs for Macros
Each macro that is started has an associated macro ID. The ID is displayed when the
macro is started and when the macro ends. Log messages for macroSchedular also
display the unique ID.
For example, macro c in file bench.mac is started on a Telnet session and the unique ID
is 25. The following start and end messages are output to the CLI session:
Macro 'c' in file 'bench.mac' starting execution (Id: 25)
. . .
Macro 'c' in file 'bench.mac' ending execution (Id: 25)
Accurate Use of Error Status When Accessed Ourside of onError Macro
When the status is requested from a macro other than the onError macro, the error status
reported is unavailable and the error string is empty.
For example, the following macro gets the command error and status. The macro is not
an onError macro so the status is reported as unavailable.
<# errorStatusTest #>
<# setoutput console #>
<# "error: " $ env.getErrorCommand $ "\n" #>
<# "status: " $ env.getErrorStatus $ "\n\n" #>
<# endsetoutput #>
<#endtmpl#>
When you run the macro, the error command is blank and the error status is Status is not
available:
ERX-40-4a-cc#macro b.mac errorStatusTest
Macro 'errorStatusTest' in file 'b.mac' starting execution (Id: 17)
error:
status: "Macro is not onError. Status is not available"
Macro 'errorStatusTest' in file 'b.mac' ending execution (Id: 17)
Copyright © 2010, Juniper Networks, Inc.
464
JunosE 11.3.x System Basics Configuration Guide
Содержание JUNOSE 11.3
Страница 6: ...Copyright 2010 Juniper Networks Inc vi...
Страница 8: ...Copyright 2010 Juniper Networks Inc viii JunosE 11 3 x System Basics Configuration Guide...
Страница 24: ...Copyright 2010 Juniper Networks Inc xxiv JunosE 11 3 x System Basics Configuration Guide...
Страница 32: ...Copyright 2010 Juniper Networks Inc 2 JunosE 11 3 x System Basics Configuration Guide...
Страница 146: ...Copyright 2010 Juniper Networks Inc 116 JunosE 11 3 x System Basics Configuration Guide...
Страница 166: ...Copyright 2010 Juniper Networks Inc 136 JunosE 11 3 x System Basics Configuration Guide...
Страница 432: ...Copyright 2010 Juniper Networks Inc 402 JunosE 11 3 x System Basics Configuration Guide...
Страница 488: ...Copyright 2010 Juniper Networks Inc 458 JunosE 11 3 x System Basics Configuration Guide...
Страница 524: ...Copyright 2010 Juniper Networks Inc 494 JunosE 11 3 x System Basics Configuration Guide...
Страница 554: ...Copyright 2010 Juniper Networks Inc 524 JunosE 11 3 x System Basics Configuration Guide...
Страница 566: ...Copyright 2010 Juniper Networks Inc 536 JunosE 11 3 x System Basics Configuration Guide...
Страница 588: ...Copyright 2010 Juniper Networks Inc 558 JunosE 11 3 x System Basics Configuration Guide...
Страница 613: ...PART 3 Index Index on page 585 583 Copyright 2010 Juniper Networks Inc...
Страница 614: ...Copyright 2010 Juniper Networks Inc 584 JunosE 11 3 x System Basics Configuration Guide...
Страница 632: ...Copyright 2010 Juniper Networks Inc 602 JunosE 11 3 x System Basics Configuration Guide...