Unique Ids For Macros; Accurate Use Of Error Status When Accessed Ourside Of Onerror Macro - Juniper JUNOSE SOFTWARE FOR E SERIES 11.3.X - SYSTEM BASICS CONFIGURATION GUIDE 2010-10-04 Configuration Manual

Software for e series broadband services routers system basics configuration guide
Hide thumbs Also See for JUNOSE SOFTWARE FOR E SERIES 11.3.X - SYSTEM BASICS CONFIGURATION GUIDE 2010-10-04:
Table of Contents

Advertisement

JunosE 11.3.x System Basics Configuration Guide

Unique IDs for Macros

Accurate Use of Error Status When Accessed Ourside of onError Macro

464
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)
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)
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.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junose 11.3

Table of Contents