Writing Technician InterfaceScripts Router Software Version 10.0Site Manager Software Version 4.0Software Version BNX 6.0Site Manager Software Versi
Writing Technician Interface ScriptsA-24################################################################## MAC screen...# ############################
Sample ScriptsA-25:FI_MAC_LP:on error :FI_MAC_NXT:if $i > $list_0 then; goto :FOOTER_AND_END: let cctnum = $(wfFddiEntry.wfFDDICct.${list_[$i]})g
Writing Technician Interface ScriptsA-26printf “%10u\n” $(wfFddiMacExtEntry.wfFddiMacRingOpCts.${list_[$i]})cutenv -c9-15 name2 “$cctname”if ${name2[
Sample ScriptsA-27:FI_PORT_LP:on error :FI_PORT_NXT:if $i > $list_0 then; goto :FOOTER_AND_END:printf “%4d %4d ” $(wfFddiPortEntry.wfFddiPortSlot.$
Writing Technician Interface ScriptsA-28################################################################## Sample screen (samples parameters twice, p
Sample ScriptsA-29:FI_SAMP_CKVAL:if $period <= 0 then; \echo “Period of $period seconds is too low.” ; \goto :FI_HELP_SHOW:## Check for circuit to
Writing Technician Interface ScriptsA-30:FI_SAMP1_LP:on error :FI_SAMP1_SKP:if $i > $list_0 then; goto :FI_SAMP_WT:if “$matchcct” = “” then ; goto
Sample ScriptsA-31:FI_SAMP2_LP:on error :FI_SAMP2_SKP:if $i > $list_0 then; goto :FI_SAMP_PRT:if “$matchcct” = “” then ; goto :FI_SAMP2_NOW:let cct
Writing Technician Interface ScriptsA-32:FI_SAMP_MATCH:on error :FI_NEXT_TRY:if ${s1instid_[$i]} != ${s2instid_[$j]} then; goto :FI_NEXT_TRY:if $j = $
Sample ScriptsA-33################################################################## Hardware Filter screen...# ######################################
xi About This Guide If you are interested in creating and editing Technician Interface scripts, refer to this guide for• An overview of variables• In
Writing Technician Interface ScriptsA-34## Enable circuit...#:FI_ENBLC:if $# != 3 then ; goto :FI_HELP_ENBL:instenv list_ wfFddiEntryif $list_0 = 0 th
Sample ScriptsA-35:FI_ENBLI:if $# != 3 then ; goto :FI_HELP_ENBL:# Sanity check <slot.connector> parameter...if “$ver” < “x7.80” then; goto :
Writing Technician Interface ScriptsA-36## Gosubs shared by enable and disable...#:ERR_MSG1:cutenv -c $invalch ugly_ “$3”echo “Inappropriate character
Sample ScriptsA-37## Disable circuit...#:FI_DSBLC:if $# != 3 then ; goto :FI_HELP_DSBL:instenv list_ wfFddiEntryif $list_0 = 0 then; goto :FI_DSBLNF:
Writing Technician Interface ScriptsA-38:FI_DSBLI:if $# != 3 then ; goto :FI_HELP_DSBL:# Sanity check <slot.connector> parameter...if “$ver” <
Sample ScriptsA-39################################################################## Version command##################################################
Index-1Symbols#, inserting comments using, 1-13$, referencing variable using, 1-2Aarrayenv command, 1-10, 2-3arrays, 1-8Ccommandsarrayenv, 1-10, 2-3cu
Index-2Ggetenv command, 1-8, 2-9global variablesoverview of, 1-4PWD, 1-11gosub command, 1-11, 2-10goto command, 1-11, 2-11Iif command, 1-11, 2-12 to 2
Index-3TTFTP, 1-1timeout values, setting, 1-5transferring script files, 1-1true variable array, 1-8Uunsetenv command, 1-10, 2-43Vvariable array, 1-8var
Writing Technician Interface Scriptsxii • The BNX Suite includes IP Routing, SNMP Agent, Bay Networks HDLC, PPP, OSPF, EGP, BGP, File-Based Perform
About This Guidexiii To purchase any of these support programs, including PhonePlus™ for 24-hour telephone technical support, call 1-800-2LANWAN. Out
Writing Technician Interface Scriptsxiv InfoFACTS InfoFACTS is the Bay Networks free 24-hour fax-on-demand service. This automated system contains li
About This Guidexv arrow character ( ➔ ) Separates menu and option names in instructions. Example: Protocols ➔ AppleTalk identifies the AppleTalk opti
Writing Technician Interface Scriptsxvi Acronyms ANSI American National Standards InstituteARP Address Resolution ProtocolASCII American Standard Cod
1-1 Chapter 1Creating a Script File The Technician Interface script facility allows you to read and execute Technician Interface commands from a scri
Writing Technician Interface Scripts1-2 • Writing messages to the console, using the echo and the printf commands• Recording console messages to
Creating a Script File1-3To prevent a variable from being expanded, enter two dollar signs ($$) before the variable name, as shown in the following ex
4401 Great America Parkway 8 Federal StreetSanta Clara, CA 95054 Billerica, MA 01821 Copyright © 1988–1996 Bay Networks, Inc. All rights reserved. Pr
Writing Technician Interface Scripts1-4Local, Global, and System VariablesWhen you first define a variable, the computer stores it in the local environm
Creating a Script File1-5Prompting for InputThe input prompt variable allows you to create a prompt that accepts user input from the Technician Interf
Writing Technician Interface Scripts1-6In the following script, if the user does not press Return before the time specified for SYS_IO_TIMEOUT has elap
Creating a Script File1-7The variable values <object>, <attribute>, and <instance> are defined as follows:<object> is the name
Writing Technician Interface Scripts1-8Defining a Pseudo-Variable ArrayThe Technician Interface script facility allows you to define a pseudo-variable a
Creating a Script File1-9If you access the Technician Interface via Telnet, the Technician Interface also displays the variables in the system environ
Writing Technician Interface Scripts1-10• To convert and format text, and save the result in a specified variable for later use, use the sprintf comman
Creating a Script File1-11Setting the Current Volume or DirectoryWhen you set the current working volume or directory using the cd (change directory)
Writing Technician Interface Scripts1-12Writing Messages to the ConsoleThe Technician Interface provides two commands to display messages on the conso
Creating a Script File1-13Inserting CommentsYou can insert comments into the script file. Comments begin with a pound sign (#) in column 1, as shown in
Bay Networks, Inc. 4401 Great America Parkway, Santa Clara, CA 950548 Federal Street, Billerica, MA 01821 Bay Networks Software License This Software
Writing Technician Interface Scripts1-14Running a Script FileTo read and execute the commands in a Technician Interface script file, and to ensure that
2-1Chapter 2Command ReferenceIn the following pages you can find the function, syntax, and examples of all the script commands you need to write, edit,
Writing Technician Interface Scripts2-2pause Suspends the Technician Interface’s operation for a given intervalprintf Converts, formats, and prints th
Command Reference2-3arrayenv The arrayenv command allows you to write a list of command line arguments <text_string> to a pseudo-variable array,
Writing Technician Interface Scripts2-4The cutenv command has the following syntax:cutenv [-s] [-d <delimiter>] [-f <list> | -c <list&g
Command Reference2-5The following sample script shows how you use the cutenv command to assign portions of 192.32.100.55 to a pseudo-variable array:cu
Writing Technician Interface Scripts2-6echo The echo command allows you to display its command line arguments to the user’s terminal.The echo command
Command Reference2-7enumenv The enumenv command lets you assign a sequence of values to a list of variables. You assign a starting number <starting
Writing Technician Interface Scripts2-8export The export command allows you to move one or more local variables to the global environment variable tab
Command Reference2-9getenv The getenv command allows you to view the current list of variables stored in the local and global environment variable tab
Bay Networks, Inc. 4401 Great America Parkway, Santa Clara, CA 950548 Federal Street, Billerica, MA 01821 Bay Networks Software License (continued)
Writing Technician Interface Scripts2-10gosub The gosub command calls a subroutine inside the same script file. It must be the last command on a line.
Command Reference2-11goto The goto command lets you specify the next line to be executed from the script file. Within the script file, the goto command
Writing Technician Interface Scripts2-12ifThe if command allows you to evaluate whether an expression is true. The expression can be a comparison of t
Command Reference2-13<string1> <string2> are ASCII character strings or numbers.<operand> is one of the following comparison operati
Writing Technician Interface Scripts2-14The backslash character (\) allows you to continue a command line on the following physical line. When used in
Command Reference2-15if -file <filename>=1For example, the following script tests whether the install.bat file is present:if -file install.bat=
Writing Technician Interface Scripts2-16instenvThe instenv command allows you to define a pseudo-variable array that contains the list of MIB instance
Command Reference2-17The following example is an excerpt from a script file showing how to use the instenv command.instenv ip_ wfIpInterfaceEntryecho “
Writing Technician Interface Scripts2-18let The let command allows you to evaluate a simple arithmetical or logical expression and assign the result t
Command Reference2-19Use the arithmetical and logical operators listed in Table 2-2 and Table 2-3 with the let command. Table 2-2. Arithmetical Operat
v Contents About This Guide Software Suites ...
Writing Technician Interface Scripts2-20The let command provides the following string functions:• strlen( )• strindex( )• strrindex( )• strpbrk( )• st
Command Reference2-21You can also get the ASCII code for a given character (indicated as one character within single quotes, such as ‘c’).The let comm
Writing Technician Interface Scripts2-22let -date -time localtime = date() + time()echo $localtime10/11/95 15:24:05let -date -time london = date(“10/7
Command Reference2-23Example:The following example shows how to use the let command to set up a slotmask:let slot = $<Enter Slot Number>let
Writing Technician Interface Scripts2-24mibget The mibget command lets you search a MIB object table one record at a time and retrieve a set of attrib
Command Reference2-25<next_instance_variable> is the name of the variable that stores the instance ID of the record currently read. If the routi
Writing Technician Interface Scripts2-26# Begin loop to read entire set of records :IP_RT_LOOP:mibget $nextflag wfIpForwardEntry attr $nextid value
Command Reference2-27octetfmt The octetfmt command formats a MIB entry with an Octet or Opaque data type using the specified format type. The syntax fo
Writing Technician Interface Scripts2-28UNSIGNED_INTEGER formats the data as a 4-byte unsigned integer.<MIB_object> represents the variable valu
Command Reference2-29on error The on error command allows you to specify an error handler label within a script file. If a command returns an error or
viControlling Program Flow ...1-11Writing Messages to the
Writing Technician Interface Scripts2-30pause The pause command allows you to suspend operation of the Technician Interface for a given interval. Duri
Command Reference2-31printf The printf command converts, formats, and prints the input arguments (<p1>,. . .,<pN>) on the Technician Inter
Writing Technician Interface Scripts2-32 A summary of the flags and conversion codes follows:<format> = %<flag><width>.<precisi
Command Reference2-33<conversion_specification> can be one of the following:•d or i indicates signed decimal notation.•o indicates unsigned octal
Writing Technician Interface Scripts2-34recordThe record command saves to an open file all messages written to the console terminal. Use this command w
Command Reference2-35You can stop saving messages to a snapshot file temporarily by using the pause option with the record command. To change the pause
Writing Technician Interface Scripts2-36return You use the return command in a subroutine to return to the calling routine. When the return command ex
Command Reference2-37run The run command allows you to read and execute the Technician Interface commands in a Technician Interface script file. The ru
Writing Technician Interface Scripts2-38The special variable $# contains the number of parameters entered on the command line following the script file
Command Reference2-39save env The save env command allows you to save the current list of local and global variables to a script file. Use the followin
viiverbose ...2-45 Appendix A S
Writing Technician Interface Scripts2-40setenv The setenv command allows you to assign an ASCII string value or a numeric value to a variable in the l
Command Reference2-41source env The source env command allows you to read and execute the Technician Interface commands in a Technician Interface scri
Writing Technician Interface Scripts2-42sprintf The sprintf command converts and formats text, and saves the result in a specified variable for later u
Command Reference2-43unsetenv The unsetenv command allows you to delete one or more variables from the local or global environment variable table. You
Writing Technician Interface Scripts2-44ExamplesIf you enter: The system:unsetenv slot Deletes the variable slot from either the local or the global t
Command Reference2-45verbose The verbose command allows you to enable the debug trace facility. When you enable the trace facility, the Technician Int
A-1Appendix ASample ScriptsTo help you create your own scripts, this appendix contains three sample scripts:• Menu script• FDDI.mnu script• FDDI.bat s
Writing Technician Interface ScriptsA-2set wfTftp.wfTftpDefaultVolume.0 $vol;\go to :MENU:if $ans = 4 then;\echo “Exiting ...”;\goto :EXIT:echo “Bad c
Sample ScriptsA-3FDDI.BAT ScriptThe following example shows a protocol script for a Bay Networks router. You view output from the script by enterin
Writing Technician Interface ScriptsA-4################################################################## Sub-command vectoring...####################
Sample ScriptsA-5################################################################## Parse for “show” command...######################################
Writing Technician Interface ScriptsA-6let i = strindex(“hwfilters”, cmd)if $i = 1 then ; goto :FI_HWF:let i = strindex(“version”, cmd)if $i = 1 then
Sample ScriptsA-7:FI_BASE_NM:setenv nextflag “”setenv pattern “”setenv nextid “*”array attr wfFDDICct wfFDDIState wfFDDIEnable wfFDDISlot array
Writing Technician Interface ScriptsA-8################################################################## Show Alerts screen...#######################
Sample ScriptsA-9# Do next circuit...#:FI_SKIPA:let i = $i + 1goto :FI_ALOOP:################################################################## Show D
Writing Technician Interface ScriptsA-10################################################################## Show Enabled screen...#####################
Sample ScriptsA-11################################################################## Print header for base/alerts/disabled/enabled screens...#########
Writing Technician Interface ScriptsA-12:FI_STATE_ESC:printf “%-17.17s” “${value[$Madr]}”if ${value[$Bofl]} = 2 then ; \printf “%-4s” “Off” ; goto :FI
Sample ScriptsA-13:FI_STAT_NM:setenv nextflag “”setenv pattern “”setenv nextid “*”array attr wfFDDICct wfFDDICrcErrRx wfFDDIOverrunRx array -a a
ix Tables Table 2-1. Script Commands ...2-1Table 2-2. Arithmetical
Writing Technician Interface ScriptsA-14:FI_STLOOP:mibget -n wfFddiEntry attr $nextid value nextidif “$nextid” = “END” then; let i = $i + 1; goto :FO
Sample ScriptsA-15################################################################## Receive Errors screen...#########################################
Writing Technician Interface ScriptsA-16printf “%-4.4s %-4.4s %-8.8s %-10.10s %-10.10s %-10.10s %-10.10s\n” \“” “” “” “CRC” “Overrun” “Invalid”
Sample ScriptsA-17:MAC_EXTRACT:setenv mac_sum 0if $?(wfFddiMacEntry.wfFddiMacErrorCts.${nextid}) = 0 then ; \returnarray mac_attr wfFddiMacErrorCts/H
Writing Technician Interface ScriptsA-18:FI_XMIT_NM:setenv nextflag “”setenv pattern “”setenv nextid “*”array attr wfFDDICct wfFDDISlot wfFDDINode
Sample ScriptsA-19################################################################## System Errors screen...# ########################################
Writing Technician Interface ScriptsA-20 printf “%-4.4s %-4.4s %-8.8s %-10.10s %-10.10s %-10.10s %-10.10s \ %-10.10s\n” “” “” “” “” “” “ Port” “ Int
Sample ScriptsA-21################################################################## SMT screen...# ##################################################
Writing Technician Interface ScriptsA-22:FI_SMT_LP:on error :FI_SMT_NXT:if $i > $list_0 then; goto :FOOTER_AND_END:let cctnum = $(wfFddiEntry.wfFDD
Sample ScriptsA-23# Note field size is 32 because flags contains the trailing space.printf “%32s” “$flags”let state = $(wfFddiSmtEntry.wfFddiSmtEcmSta
Comments to this Manuals