Part No. 114089 Rev. AAugust 1996Router Software Version 11.0Site Manager Software Version 5.0Writing TechnicianInterface Scripts
Writing Technician Interface ScriptsA-22 114089 Rev. Ainstenv list_ wfFddiSmtEntry:FI_SMT_LP:on error :FI_SMT_NXT:if $i > $list_0 then; goto :FOOTE
Sample Scripts114089 Rev. A A-23if $bit >= 0 then ; goto :FI_BIT_LP:# Note field size is 32 because flags contains the trailing space.printf “%32s”
Writing Technician Interface ScriptsA-24 114089 Rev. A################################################################## MAC screen...################
Sample Scripts114089 Rev. A A-25:FI_MAC_LP:on error :FI_MAC_NXT:if $i > $list_0 then; goto :FOOTER_AND_END:let cctnum = $(wfFddiEntry.wfFDDICct.${l
Writing Technician Interface ScriptsA-26 114089 Rev. Aprintf “%10u\n”$(wfFddiMacExtEntry.wfFddiMacRingOpCts.${list_[$i]})cutenv -c9-15 name2 “$cctnam
Sample Scripts114089 Rev. A A-27:FI_PORT_LP:on error :FI_PORT_NXT:if $i > $list_0 then; goto :FOOTER_AND_END:printf “%4d %4d ”$(wfFddiPortEntry.wfF
Writing Technician Interface ScriptsA-28 114089 Rev. A################################################################## Sample screen (samples param
Sample Scripts114089 Rev. A A-29:FI_SAMP_CKVAL:if $period <= 0 then; \echo “Period of $period seconds is too low.” ; \goto :FI_HELP_SHOW:## Check f
Writing Technician Interface ScriptsA-30 114089 Rev. A:FI_SAMP1_LP:on error :FI_SAMP1_SKP:if $i > $list_0 then; goto :FI_SAMP_WT:if “$matchcct” = “
Sample Scripts114089 Rev. A A-31if $list_0 = 0 then; \ printf “\r \r”; \ goto :FOOTER_AND_END::FI_SAMP2_LP:on error :FI_SAMP2_SK
114089 Rev. A xiAbout This GuideIf you are interested in creating and editing Technician Interface scripts, refer tothis guide for• An overview of var
Writing Technician Interface ScriptsA-32 114089 Rev. A:FI_SAMP_MATCH:on error :FI_NEXT_TRY:if ${s1instid_[$i]} != ${s2instid_[$j]} then; goto:FI_NEXT_
Sample Scripts114089 Rev. A A-33goto :FI_HELP_SHOW:################################################################## Hardware Filter screen...#######
Writing Technician Interface ScriptsA-34 114089 Rev. A## Enable circuit...#:FI_ENBLC:if $# != 3 then ; goto :FI_HELP_ENBL:instenv list_ wfFddiEntryif
Sample Scripts114089 Rev. A A-35:FI_ENBLI:if $# != 3 then ; goto :FI_HELP_ENBL:# Sanity check <slot.connector> parameter...if “$ver” < “x7.80
Writing Technician Interface ScriptsA-36 114089 Rev. A## Gosubs shared by enable and disable...#:ERR_MSG1:cutenv -c $invalch ugly_ “$3”echo “Inappropr
Sample Scripts114089 Rev. A A-37## Disable circuit...#:FI_DSBLC:if $# != 3 then ; goto :FI_HELP_DSBL:instenv list_ wfFddiEntryif $list_0 = 0 then; got
Writing Technician Interface ScriptsA-38 114089 Rev. A:FI_DSBLI:if $# != 3 then ; goto :FI_HELP_DSBL:# Sanity check <slot.connector> parameter..
Sample Scripts114089 Rev. A A-39################################################################## Version command####################################
114089 Rev. A Index-1Symbols#, inserting comments using, 1-13$, referencing variable using, 1-2Aarrayenv command, 1-10, 2-3arrays, 1-8BBay NetworksCom
Writing Technician Interface Scriptsxii 114089 Rev. AConventionsangle brackets (< >) Indicate that you choose the text to enter based on thedesc
Writing Technician Interface ScriptsIndex-2 114089 Rev. Aerror recovery, performing, 1-12, 2-28evaluating expressions, 2-11, 2-17export command, 1-4,
Index114089 Rev. A Index-3Ssave env command, 2-38saving console messages, 1-12, 2-33script filescreating, 1-1 to 1-13debugging, 1-13, 2-44examples of,
About This Guide114089 Rev. A xiiiAcronymsANSI American National Standards InstituteARP Address Resolution ProtocolASCII American Standard Code for In
114089 Rev. A xvTechnical Support and Online ServicesTo ensure comprehensive network support to our customers and partnersworldwide, Bay Networks Cust
Writing Technician Interface Scriptsxvi 114089 Rev. ABay Networks Customer ServiceIf you purchased your Bay Networks product from a distributor or aut
Technical Support and Online Services114089 Rev. A xviiBay Networks Information ServicesBay Networks Information Services provide up-to-date support i
Writing Technician Interface Scriptsxviii 114089 Rev. ASupport Source CDThis CD-ROM -- sent quarterly to all contracted customers -- is a complete Bay
Technical Support and Online Services114089 Rev. A xixInfoFACTSInfoFACTS is the Bay Networks free 24-hour fax-on-demand service. Thisautomated system
ii 114089 Rev. A4401 Great America Parkway 8 Federal StreetSanta Clara, CA 95054 Billerica, MA 01821Copyright © 1988–1996 Bay Networks, Inc.All rights
114089 Rev. A 1-1Chapter 1Creating a Script FileThe Technician Interface script facility allows you to read and execute TechnicianInterface commands f
Writing Technician Interface Scripts1-2 114089 Rev. A• Writing messages to the console, using the echo and the printf commands• Recording console mess
Creating a Script File114089 Rev. A 1-3To prevent a variable from being expanded, enter two dollar signs ($$) before thevariable name, as shown in the
Writing Technician Interface Scripts1-4 114089 Rev. ALocal, Global, and System VariablesWhen you first define a variable, the computer stores it in the
Creating a Script File114089 Rev. A 1-5Prompting for InputThe input prompt variable allows you to create a prompt that accepts user inputfrom the Tech
Writing Technician Interface Scripts1-6 114089 Rev. AIn the following script, if the user does not press Return before the time specifiedfor SYS_IO_TIM
Creating a Script File114089 Rev. A 1-7The variable values<object>,<attribute>, and<instance> are defined as follows:<object> i
Writing Technician Interface Scripts1-8 114089 Rev. ADefining a Pseudo-Variable ArrayThe Technician Interface script facility allows you to define a pse
Creating a Script File114089 Rev. A 1-9If you access the Technician Interface via Telnet, the Technician Interface alsodisplays the variables in the s
114089 Rev. A iiiBay Networks Software LicenseThis Software License shall govern the licensing of all software provided to licensee by Bay Networks (“
Writing Technician Interface Scripts1-10 114089 Rev. A• To convert and format text, and save the result in a specified variable for lateruse, use thesp
Creating a Script File114089 Rev. A 1-11Setting the Current Volume or DirectoryWhen you set the current working volume or directory using the cd (chan
Writing Technician Interface Scripts1-12 114089 Rev. AWriting Messages to the ConsoleThe Technician Interface provides two commands to display message
Creating a Script File114089 Rev. A 1-13Inserting CommentsYou can insert comments into the script file. Comments begin with a pound sign(#) in column 1
Writing Technician Interface Scripts1-14 114089 Rev. ARunning a Script FileTo read and execute the commands in a Technician Interface script file, and
114089 Rev. A 2-1Chapter 2Command ReferenceIn the following pages you can find the function, syntax, and examples of all thescript commands you need to
Writing Technician Interface Scripts2-2 114089 Rev. Aon error Specifies an error handler label within a script filepause Suspends the Technician Interfa
Command Reference114089 Rev. A 2-3arrayenvThe arrayenv command allows you to write a list of command line arguments<text_string> to a pseudo-var
Writing Technician Interface Scripts2-4 114089 Rev. AThe cutenv command has the following syntax:cutenv [-s][-d<delimiter>][-f<list> | -c&
Command Reference114089 Rev. A 2-5echoThe echo command allows you to display its command line arguments to theuser’s terminal.Theecho command has the
iv 114089 Rev. ABay Networks Software License(continued)9. Licensee shall not reverse assemble, reverse compile, or in any way reverse engineer the So
Writing Technician Interface Scripts2-6 114089 Rev. AenumenvThe enumenv command lets you assign a sequence of values to a list of variables.You assign
Command Reference114089 Rev. A 2-7exportThe export command allows you to move one or more local variables to theglobal environment variable table. (Wh
Writing Technician Interface Scripts2-8 114089 Rev. AgetenvThe getenv command allows you to view the current list of variables stored in thelocal and
Command Reference114089 Rev. A 2-9gosubThe gosub command calls a subroutine inside the same script file. It must be thelast command on a line. A subrou
Writing Technician Interface Scripts2-10 114089 Rev. AgotoThe goto command lets you specify the next line to be executed from the scriptfile. Within th
Command Reference114089 Rev. A 2-11ifThe if command allows you to evaluate whether an expression is true. Theexpression can be a comparison of two num
Writing Technician Interface Scripts2-12 114089 Rev. A<string1> <string2> are ASCII character strings or numbers.<operand>is one of
Command Reference114089 Rev. A 2-13The backslash character (\) allows you to continue a command line on thefollowing physical line. When used in this
Writing Technician Interface Scripts2-14 114089 Rev. ATo test whether a file is present, use the if command with the following syntax:if -file<filenam
Command Reference114089 Rev. A 2-15instenvThe instenv command allows you to define a pseudo-variable array that containsthe list of MIB instance IDs fo
114089 Rev. A vContentsWriting Technician Interface ScriptsAbout This GuideAudience ...
Writing Technician Interface Scripts2-16 114089 Rev. AThe following example is an excerpt from a script file showing how to use theinstenv command.inst
Command Reference114089 Rev. A 2-17letThe let command allows you to evaluate a simple arithmetical or logicalexpression and assign the result to a giv
Writing Technician Interface Scripts2-18 114089 Rev. AUse the arithmetical and logical operators listed in Table 2-2 and Table 2-3 withthelet command.
Command Reference114089 Rev. A 2-19The let command provides the following string functions:• strlen( )• strindex( )• strrindex( )• strpbrk( )• strmatc
Writing Technician Interface Scripts2-20 114089 Rev. AYou can also get the ASCII code for a given character (indicated as one characterwithin single q
Command Reference114089 Rev. A 2-21let -date -time localtime = date() + time()echo $localtime10/11/95 15:24:05let -date -time london = date(“10/7/95”)
Writing Technician Interface Scripts2-22 114089 Rev. AExample:The following example shows how to use the let command to set up a slotmask:let slot =
Command Reference114089 Rev. A 2-23mibgetThe mibget command lets you search a MIB object table one record at a time andretrieve a set of attributes fr
Writing Technician Interface Scripts2-24 114089 Rev. A<next_instance_variable> is the name of the variable that stores the instance ID ofthe rec
Command Reference114089 Rev. A 2-25# Set get-next record flag.setenv nextflag “-n”printf “%-15s %-15s %-5d %8d %8d %-15s” ${value[$dest]}\${value[$ma
vi 114089 Rev. ACreating and Using Variables ...1-8Viewing Varia
Writing Technician Interface Scripts2-26 114089 Rev. AoctetfmtThe octetfmt command formats a MIB entry with an Octet or Opaque data typeusing the spec
Command Reference114089 Rev. A 2-27SIGNED_INTEGER or INTEGER formats the data as a 4-byte signed integer.UNSIGNED_INTEGER formats the data as a 4-byte
Writing Technician Interface Scripts2-28 114089 Rev. Aon errorThe on error command allows you to specify an error handler label within a scriptfile. If
Command Reference114089 Rev. A 2-29pauseThe pause command allows you to suspend operation of the Technician Interfacefor a given interval. During this
Writing Technician Interface Scripts2-30 114089 Rev. AprintfThe printf command converts, formats, and prints the input arguments(<p1>,. . .,<
Command Reference114089 Rev. A 2-31A summary of the flags and conversion codes follows:<format> = %<flag><width>.<precision>&
Writing Technician Interface Scripts2-32 114089 Rev. A<conversion_specification> can be one of the following:•d or i indicates signed decimal not
Command Reference114089 Rev. A 2-33recordThe record command saves to an open file all messages written to the consoleterminal. Use this command when yo
Writing Technician Interface Scripts2-34 114089 Rev. AYou can stop saving messages to a snapshot file temporarily by using the pauseoption with the rec
Command Reference114089 Rev. A 2-35returnYou use the return command in a subroutine to return to the calling routine. Whenthereturn command executes,
114089 Rev. A viisave env ...2-38s
Writing Technician Interface Scripts2-36 114089 Rev. ArunThe run command allows you to read and execute the Technician Interfacecommands in a Technici
Command Reference114089 Rev. A 2-37The special variable $# contains the number of parameters entered on thecommand line following the script filename.
Writing Technician Interface Scripts2-38 114089 Rev. Asave envThe save env command allows you to save the current list of local and globalvariables to
Command Reference114089 Rev. A 2-39setenvThe setenv command allows you to assign an ASCII string value or a numericvalue to a variable in the local en
Writing Technician Interface Scripts2-40 114089 Rev. Asource envThe source env command allows you to read and execute the TechnicianInterface commands
Command Reference114089 Rev. A 2-41sprintfThe sprintf command converts and formats text, and saves the result in a specifiedvariable for later use.Thes
Writing Technician Interface Scripts2-42 114089 Rev. AunsetenvThe unsetenv command allows you to delete one or more variables from the localor global
Command Reference114089 Rev. A 2-43Examples[If you enter: The system:unsetenv slotDeletes the variable slot from either the local or the globaltable,
Writing Technician Interface Scripts2-44 114089 Rev. AverboseThe verbose command allows you to enable the debug trace facility. When youenable the tra
114089 Rev. A A-1Appendix ASample ScriptsTo help you create your own scripts, this appendix contains three sample scripts:• Menu script• FDDI.mnu scri
Writing Technician Interface ScriptsA-2 114089 Rev. Alet vol=$<Enter new TFTP Default Value #: >;\set wfTftp.wfTftpDefaultVolume.0 $vol;\go to :
Sample Scripts114089 Rev. A A-3FDDI.BAT ScriptThe following example shows a protocol script for a Bay Networks router. Youview output from the script
Writing Technician Interface ScriptsA-4 114089 Rev. A################################################################## Sub-command vectoring...######
Sample Scripts114089 Rev. A A-5################################################################## Parse for “show” command...########################
Writing Technician Interface ScriptsA-6 114089 Rev. Alet i = strindex(“hwfilters”, cmd)if $i = 1 then ; goto :FI_HWF:let i = strindex(“version”, cmd)i
Sample Scripts114089 Rev. A A-7:FI_BASE_NM:setenv nextflag “”setenv pattern “”setenv nextid “*”array attr wfFDDICct wfFDDIState wfFDDIEnable wfF
Writing Technician Interface ScriptsA-8 114089 Rev. A################################################################## Show Alerts screen...#########
Sample Scripts114089 Rev. A A-9# Do next circuit...#:FI_SKIPA:let i = $i + 1goto :FI_ALOOP:###########################################################
Writing Technician Interface ScriptsA-10 114089 Rev. A################################################################## Show Enabled screen...#######
Sample Scripts114089 Rev. A A-11################################################################## Print header for base/alerts/disabled/enabled scree
114089 Rev. A ixTablesTable 2-1. Script Commands ...2-1Table 2-2. Ari
Writing Technician Interface ScriptsA-12 114089 Rev. A:FI_STATE_ESC:printf “%-17.17s” “${value[$Madr]}”if ${value[$Bofl]} = 2 then ; \printf “%-4s” “O
Sample Scripts114089 Rev. A A-13:FI_STAT_NM:setenv nextflag “”setenv pattern “”setenv nextid “*”array attr wfFDDICct wfFDDICrcErrRx wfFDDIOverru
Writing Technician Interface ScriptsA-14 114089 Rev. A:FI_STLOOP:mibget -n wfFddiEntry attr $nextid value nextidif “$nextid” = “END” then; let i = $i
Sample Scripts114089 Rev. A A-15:FI_STAT_NXT:let i = $i + 1goto :FI_STLOOP:################################################################## Receive
Writing Technician Interface ScriptsA-16 114089 Rev. Aprintf “%-4.4s %-4.4s %-8.8s %-10.10s %-10.10s %-10.10s %-10.10s\n”\“” “” “” “CRC” “Overrun”
Sample Scripts114089 Rev. A A-17# Gosub to extract errors in the MAC object from the octetstrings...# ...returns sum in “mac_sum”#:MAC_EXTRACT:setenv
Writing Technician Interface ScriptsA-18 114089 Rev. Alet j = strindex(“circuit”, cmd)if $j != 1 then ; goto :FI_HELP_SHOW:if $# != 5 then ; goto :FI_
Sample Scripts114089 Rev. A A-19:FI_XMIT_NXT:let i = $i + 1goto :FI_TxLOOP:################################################################## System E
Writing Technician Interface ScriptsA-20 114089 Rev. A echo printf “%-4.4s %-4.4s %-8.8s %-10.10s %-10.10s %-10.10s %-10.10s \ %-10.10s\n” “” “” “” “”
Sample Scripts114089 Rev. A A-21:FI_SYS_NXT:let i = $i + 1goto :FI_SyLOOP:################################################################## SMT scree
Komentarze do niniejszej Instrukcji