BayRS Version 14.00Part No. 308660-14.00 Rev 00September 19994401 Great America ParkwaySanta Clara, CA 95054Writing Technician Interface Scripts
Writing Technician Interface ScriptsA-26308660-14.00 Rev 00:FI_PORT_LP:on error :FI_PORT_NXT:if $i > $list_0 then; goto :FOOTER_AND_END:printf “%4d
Sample Scripts308660-14.00 Rev 00A-27 ################################################################## Sample screen (samples parameters twice, pri
Writing Technician Interface ScriptsA-28308660-14.00 Rev 00:FI_SAMP_CKVAL:if $period <= 0 then; \echo “Period of $period seconds is too low.” ; \go
Sample Scripts308660-14.00 Rev 00A-29 :FI_SAMP1_LP:on error :FI_SAMP1_SKP:if $i > $list_0 then; goto :FI_SAMP_WT:if “$matchcct” = “” then ; goto :F
Writing Technician Interface ScriptsA-30308660-14.00 Rev 00if -ic “$matchcct” != “$cctname” then; goto :FI_SAMP2_SKP::FI_SAMP2_NOW:let match_entries =
Sample Scripts308660-14.00 Rev 00A-31 :FI_SAMP_MATCH:on error :FI_NEXT_TRY:if ${s1instid_[$i]} != ${s2instid_[$j]} then; goto :FI_NEXT_TRY:if $j = $jl
Writing Technician Interface ScriptsA-32308660-14.00 Rev 00:FI_HWF:setenv RUN_SILENT 1on error :FI_HANDLER:run hwfilter show fddigoto :FI_END::FI_HAND
Sample Scripts308660-14.00 Rev 00A-33 ## Enable circuit...#:FI_ENBLC:if $# != 3 then ; goto :FI_HELP_ENBL:instenv list_ wfFddiEntryif $list_0 = 0 then
Writing Technician Interface ScriptsA-34308660-14.00 Rev 00:FI_ENBLI:if $# != 3 then ; goto :FI_HELP_ENBL:# Sanity check <slot.connector> parame
Sample Scripts308660-14.00 Rev 00A-35 ## Gosubs shared by enable and disable...#:ERR_MSG1:cutenv -c $invalch ugly_ “$3”echo “Inappropriate character &
308660-14.00 Rev 00xi PrefaceThis guide describes how to create and edit Technician Interface scripts. It is intended for network administrators with
Writing Technician Interface ScriptsA-36308660-14.00 Rev 00## Disable circuit...#:FI_DSBLC:if $# != 3 then ; goto :FI_HELP_DSBL:instenv list_ wfFddiEn
Sample Scripts308660-14.00 Rev 00A-37 :FI_DSBLI:if $# != 3 then ; goto :FI_HELP_DSBL:# Sanity check <slot.connector> parameter...if “$ver” <
Writing Technician Interface ScriptsA-38308660-14.00 Rev 00################################################################## Version command#########
308660-14.00 Rev 00Index-1Symbols#, inserting comments using, 1-13$, referencing variable using, 1-2Aacronyms, xivarrayenv command, 1-10, 2-3arrays, 1
Index-2308660-14.00 Rev 00gosub command, 1-11, 2-10goto command, 1-11, 2-11Iif command, 1-11, 2-12 to 2-15instenv command, 1-9, 2-16Llet command, 1-10
308660-14.00 Rev 00Index-3timeout values, setting, 1-5transferring script files, 1-1true variable array, 1-8Uunsetenv command, 1-10, 2-42Vvariable arr
Writing Technician Interface Scriptsxii308660-14.00 Rev 00Text ConventionsThis guide uses the following text conventions:angle brackets (< >) In
Preface308660-14.00 Rev 00xiii italic text Indicates file and directory names, new terms, book titles, and variables in command syntax descriptions. W
Writing Technician Interface Scriptsxiv308660-14.00 Rev 00AcronymsThis guide uses the following acronyms:Related PublicationsHard-Copy Technical Manua
Preface308660-14.00 Rev 00xv How to Get HelpIf you purchased a service contract for your Nortel Networks® product from a distributor or authorized res
308660-14.00 Rev 001-1 Chapter 1Creating a Script FileThe Technician Interface script facility allows you to read and execute Technician Interface com
Writing Technician Interface Scripts1-2308660-14.00 Rev 00• Writing messages to the console, using the echo and the printf commands• Recording console
Creating a Script File308660-14.00 Rev 001-3 To prevent a variable from being expanded, enter two dollar signs ($$) before the variable name, as shown
ii308660-14.00 Rev 00 Copyright © 1999 Nortel NetworksAll rights reserved. Printed in the USA. September 1999.The information in this document is subj
Writing Technician Interface Scripts1-4308660-14.00 Rev 00Local, Global, and System VariablesWhen you first define a variable, the computer stores it
Creating a Script File308660-14.00 Rev 001-5 Prompting for InputThe input prompt variable allows you to create a prompt that accepts user input from t
Writing Technician Interface Scripts1-6308660-14.00 Rev 00In the following script, if the user does not press Return before the time specified for SYS
Creating a Script File308660-14.00 Rev 001-7 The variable values <object>, <attribute>, and <instance> are defined as follows:<ob
Writing Technician Interface Scripts1-8308660-14.00 Rev 00Defining a Pseudo-Variable ArrayThe Technician Interface script facility allows you to defin
Creating a Script File308660-14.00 Rev 001-9 If you access the Technician Interface via Telnet, the Technician Interface also displays the variables i
Writing Technician Interface Scripts1-10308660-14.00 Rev 00• To convert and format text, and save the result in a specified variable for later use, us
Creating a Script File308660-14.00 Rev 001-11 Setting the Current Volume or DirectoryWhen you set the current working volume or directory using the cd
Writing Technician Interface Scripts1-12308660-14.00 Rev 00Writing Messages to the ConsoleThe Technician Interface provides two commands to display me
Creating a Script File308660-14.00 Rev 001-13 Inserting CommentsYou can insert comments into the script file. Comments begin with a pound sign (#) in
308660-14.00 Rev 00iiiNortel Networks NA Inc. Software License AgreementNOTICE: Please carefully read this license agreement before copying or using t
Writing Technician Interface Scripts1-14308660-14.00 Rev 00Running a Script FileTo read and execute the commands in a Technician Interface script file
308660-14.00 Rev 002-1 Chapter 2Command ReferenceIn the following pages you can find the function, syntax, and examples of all the script commands you
Writing Technician Interface Scripts2-2308660-14.00 Rev 00on errorSpecifies an error handler label within a script filepauseSuspends the Technician In
Command Reference308660-14.00 Rev 002-3 arrayenv The arrayenv command allows you to write a list of command line arguments <text_string> to a ps
Writing Technician Interface Scripts2-4308660-14.00 Rev 00cutenv The cutenv command allows you to select portions of a <text_string> (as specifi
Command Reference308660-14.00 Rev 002-5 <text_string> with no field delimiters is normally passed through in its entirety.ExampleThe following s
Writing Technician Interface Scripts2-6308660-14.00 Rev 00echo The echo command allows you to display its command line arguments to the user’s termina
Command Reference308660-14.00 Rev 002-7 enumenv The enumenv command lets you assign a sequence of values to a list of variables. You assign a starting
Writing Technician Interface Scripts2-8308660-14.00 Rev 00export The export command allows you to move one or more local variables to the global envir
Command Reference308660-14.00 Rev 002-9 getenv The getenv command allows you to view the current list of variables stored in the local and global envi
iv308660-14.00 Rev 00for the security of its own data and information and for maintaining adequate procedures apart from the Software to reconstruct
Writing Technician Interface Scripts2-10308660-14.00 Rev 00gosub The gosub command calls a subroutine inside the same script file. It must be the last
Command Reference308660-14.00 Rev 002-11 goto The goto command lets you specify the next line to be executed from the script file. Within the script f
Writing Technician Interface Scripts2-12308660-14.00 Rev 00ifThe if command allows you to evaluate whether an expression is true. The expression can b
Command Reference308660-14.00 Rev 002-13 <string1> <string2> are ASCII character strings or numbers.<operand> is one of the followin
Writing Technician Interface Scripts2-14308660-14.00 Rev 00The backslash character (\) allows you to continue a command line on the following physical
Command Reference308660-14.00 Rev 002-15 Example 5For example, the following script tests whether variable a has been defined:setenv a 5if $?a=1
Writing Technician Interface Scripts2-16308660-14.00 Rev 00instenvThe instenv command allows you to define a pseudo-variable array that contains the l
Command Reference308660-14.00 Rev 002-17 Example 2The following example is an excerpt from a script file showing how to use the instenv command.insten
Writing Technician Interface Scripts2-18308660-14.00 Rev 00let The let command allows you to evaluate a simple arithmetical or logical expression and
Command Reference308660-14.00 Rev 002-19 Example 2In the following script, variable name b is assigned the sum of variable name a plus 1.setenv a
308660-14.00 Rev 00vContentsPrefaceBefore You Begin ...
Writing Technician Interface Scripts2-20308660-14.00 Rev 00The let command provides the following string functions:• strlen( )• strindex( )• strrindex
Command Reference308660-14.00 Rev 002-21 You can also get the ASCII code for a given character (indicated as one character within single quotes, such
Writing Technician Interface Scripts2-22308660-14.00 Rev 00let -date -time localtime = date() + time()echo $localtime10/11/95 15:24:05let -date -time
Command Reference308660-14.00 Rev 002-23 mibget The mibget command lets you search a MIB object table one record at a time and retrieve a set of attri
Writing Technician Interface Scripts2-24308660-14.00 Rev 00<value_variable_array> is the name of an environmental array variable that stores the
Command Reference308660-14.00 Rev 002-25 # Begin loop to read entire set of records :IP_RT_LOOP:mibget $nextflag wfIpForwardEntry attr $nextid valu
Writing Technician Interface Scripts2-26308660-14.00 Rev 00octetfmt The octetfmt command formats a MIB entry with an Octet or Opaque data type using t
Command Reference308660-14.00 Rev 002-27 MAC2_ADDRESS formats the data as a noncanonical MAC address.SIGNED_INTEGER or INTEGER formats the data as a 4
Writing Technician Interface Scripts2-28308660-14.00 Rev 00on error The on error command allows you to specify an error handler label within a script
Command Reference308660-14.00 Rev 002-29 pause The pause command allows you to suspend operation of the Technician Interface for a given interval. Dur
vi308660-14.00 Rev 00Saving and Restoring Variables ...1-13Running a
Writing Technician Interface Scripts2-30308660-14.00 Rev 00printf The printf command converts, formats, and prints the input arguments (<p1>,. .
Command Reference308660-14.00 Rev 002-31 A summary of the flags and conversion codes follows:<format> = %<flag><width>.<prec
Writing Technician Interface Scripts2-32308660-14.00 Rev 00<conversion_specification> can be one of the following:•d or i indicates signed decim
Command Reference308660-14.00 Rev 002-33 recordThe record command saves to an open file all messages written to the console terminal. Use this command
Writing Technician Interface Scripts2-34308660-14.00 Rev 00You can stop saving messages to a snapshot file temporarily by using the pause option with
Command Reference308660-14.00 Rev 002-35 return You use the return command in a subroutine to return to the calling routine. When the return command e
Writing Technician Interface Scripts2-36308660-14.00 Rev 00run The run command allows you to read and execute the Technician Interface commands in a T
Command Reference308660-14.00 Rev 002-37 The special variable $# contains the number of parameters entered on the command line following the script fi
Writing Technician Interface Scripts2-38308660-14.00 Rev 00save env The save env command allows you to save the current list of local and global varia
Command Reference308660-14.00 Rev 002-39 setenv The setenv command allows you to assign an ASCII string value or a numeric value to a variable in the
308660-14.00 Rev 00viiAppendix A Sample ScriptsMenu Script ...
Writing Technician Interface Scripts2-40308660-14.00 Rev 00source env The source env command allows you to read and execute the Technician Interface c
Command Reference308660-14.00 Rev 002-41 sprintf The sprintf command converts and formats text, and saves the result in a specified variable for later
Writing Technician Interface Scripts2-42308660-14.00 Rev 00unsetenv The unsetenv command allows you to delete one or more variables from the local or
Command Reference308660-14.00 Rev 002-43 ExamplesIf you enter: The system:unsetenv slotDeletes the variable slot from either the local or the global t
Writing Technician Interface Scripts2-44308660-14.00 Rev 00verbose The verbose command allows you to enable the debug trace facility. When you enable
308660-14.00 Rev 00A-1 Appendix ASample ScriptsTo help you create your own scripts, this appendix contains three sample scripts:• Menu script• FDDI.mn
Writing Technician Interface ScriptsA-2308660-14.00 Rev 00if $ans = 4 then;\echo “Exiting ...”;\goto :EXIT:echo “Bad choice, try again ...”pause 2goto
Sample Scripts308660-14.00 Rev 00A-3 FDDI.BAT ScriptThe following example shows a protocol script for a Nortel Networks router. You view output fro
Writing Technician Interface ScriptsA-4308660-14.00 Rev 00################################################################## Sub-command vectoring...#
Sample Scripts308660-14.00 Rev 00A-5 ################################################################## Parse for “show” command...##################
Writing Technician Interface ScriptsA-6308660-14.00 Rev 00:FI_HELP_SHOW:echo “FDDI Show Command Help”echo “----------------------”echoecho “show fddi
Sample Scripts308660-14.00 Rev 00A-7 enum 1 Cct State Enable Slot ienum $i Node Madr Bofl ienum $i BoflTmo Mtu HwFilterechoecho “FDDI Modules:”
Writing Technician Interface ScriptsA-8308660-14.00 Rev 00################################################################## Show Alerts screen...####
Sample Scripts308660-14.00 Rev 00A-9 # Do next circuit...#:FI_SKIPA:let i = $i + 1goto :FI_ALOOP:#####################################################
Writing Technician Interface ScriptsA-10308660-14.00 Rev 00:FI_ENBLED:setenv matchcct “xxx”setenv nextflag “”setenv pattern “”setenv nextid “*”arra
Sample Scripts308660-14.00 Rev 00A-11 ################################################################## Print header for base/alerts/disabled/enabled
Writing Technician Interface ScriptsA-12308660-14.00 Rev 00:FI_STATE_ESC:printf “%-17.17s” “${value[$Madr]}”if ${value[$Bofl]} = 2 then ; \printf “%-4
Sample Scripts308660-14.00 Rev 00A-13 :FI_STAT_NM:setenv nextflag “”setenv pattern “”setenv nextid “*”array attr wfFDDICct wfFDDICrcErrRx wfFDDI
Writing Technician Interface ScriptsA-14308660-14.00 Rev 00:FI_STLOOP:mibget -n wfFddiEntry attr $nextid value nextidif “$nextid” = “END” then; let i
Sample Scripts308660-14.00 Rev 00A-15 :FI_RCV:if $# < 3 then; goto :FI_Rx1:let cmdlen = strlen(“$3”)let i = strindex(“errors”, “$3”)if $i = 1 then
308660-14.00 Rev 00ixTablesTable 2-1. Script Commands ...2-1Table 2-
Writing Technician Interface ScriptsA-16308660-14.00 Rev 00mibget -n wfFddiEntry attr $nextid value nextidif “$nextid“ = “END” then; let i = $i + 1;
Sample Scripts308660-14.00 Rev 00A-17 ################################################################## Transmit Errors screen...####################
Writing Technician Interface ScriptsA-18308660-14.00 Rev 00if “$nextid” = “END” then; let i = $i + 1; goto :FOOTER_AND_END:let cctnum = ${value[$Cct]}
Sample Scripts308660-14.00 Rev 00A-19 wfFDDIParityErrTx array -a attr wfFDDIRingErrRx wfFDDIRingErrTx wfFDDISmtRingErrRx \wfFDDIPortOpErr array -a a
Writing Technician Interface ScriptsA-20308660-14.00 Rev 00if ${name2[0]} = 1 then; \printf “%4s %4s *%-7.7s\n” “” “” “${name2[1]}”:FI_SYS_NXT:let i =
Sample Scripts308660-14.00 Rev 00A-21 on error :FI_SMT_NXT:if $i > $list_0 then; goto :FOOTER_AND_END:let cctnum = $(wfFddiEntry.wfFDDICct.${list_[
Writing Technician Interface ScriptsA-22308660-14.00 Rev 00if $state = 4 then ; printf “%-8s ” “Leave”if $state = 5 then ; printf “%-8s ” “Pathtest”if
Sample Scripts308660-14.00 Rev 00A-23 ################################################################## MAC screen...# ##############################
Writing Technician Interface ScriptsA-24308660-14.00 Rev 00:FI_MAC_LP:on error :FI_MAC_NXT:if $i > $list_0 then; goto :FOOTER_AND_END: let cctnum
Sample Scripts308660-14.00 Rev 00A-25 printf “%10u\n” $(wfFddiMacExtEntry.wfFddiMacRingOpCts.${list_[$i]})cutenv -c9-15 name2 “$cctname”if ${name2[0]
Comentários a estes Manuais