Viewing Macro Errors; Onerror Macro Examples; Detecting Invalid Command Formats - 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

Viewing Macro Errors

show log data
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

onError Macro Examples

478
A is 5
You can view macro error information in the macroData log file using the show log data
command and specifying the macroData keyword for the category.
NOTE: Each execution of a macro, by any user and by any name, obtains a
unique ID. This ID appears in the starting and ending message of the macro
output and for each log message in the macroData log.
Use to display log event data using the category keyword and the macroData category.
delta—Limits the display to events that occurred after the time set with the log baseline
command.
severity—Displays events that have a specific severity level.
Example
See show log data.
The following examples provide an indication of how the onError macro can assist in
using and troubleshooting macro files. The examples purposely contain errors and show
the result when using the onError macro.

Detecting Invalid Command Formats

In this example, the following macro file (badInterfaceCommand.mac) performs a loop.
Within each loop, the CLI executes the interface fastEthernet command using an invalid
interface format:
<# badInterfaceCommandMacro #>
<# env.setResult("runStatus","start" ) #>
<# theLoopCount := 500 #>
conf t
<# while theLoopCount > 0 #>
<# env.setResult("runStatus", "Loop:" $ theLoopCount ) #>
interface fastEthernet <# theLoopCount; '\n' #>
<# --theLoopCount #>
Copyright © 2010, Juniper Networks, Inc.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junose 11.3

Table of Contents