Part No. 117382-A Rev. ASeptember 1997BayRS Version 12.00Site Manager Software Version 6.00 Writing Technician Interface Scripts
Writing Technician Interface ScriptsA-28 117382-A Rev. A################################################################## Sample screen (samples par
Sample Scripts117382-A Rev. A A-29 :FI_SAMP_CKVAL:if $period <= 0 then; \echo “Period of $period seconds is too low.” ; \goto :FI_HELP_SHOW:## Chec
Writing Technician Interface ScriptsA-30 117382-A Rev. A:FI_SAMP1_LP:on error :FI_SAMP1_SKP:if $i > $list_0 then; goto :FI_SAMP_WT:if “$matchcct” =
Sample Scripts117382-A Rev. A A-31 if $i > $list_0 then; goto :FI_SAMP_PRT:if “$matchcct” = “” then ; goto :FI_SAMP2_NOW:let cctnum = $(wfFddiEntry
Writing Technician Interface ScriptsA-32 117382-A Rev. A:FI_SAMP_MATCH:on error :FI_NEXT_TRY:if ${s1instid_[$i]} != ${s2instid_[$j]} then; goto :FI_NE
Sample Scripts117382-A Rev. A A-33 ################################################################## Hardware Filter screen...# #####################
Writing Technician Interface ScriptsA-34 117382-A Rev. A## Enable circuit...#:FI_ENBLC:if $# != 3 then ; goto :FI_HELP_ENBL:instenv list_ wfFddiEntryi
Sample Scripts117382-A Rev. A A-35 :FI_ENBLI:if $# != 3 then ; goto :FI_HELP_ENBL:# Sanity check <slot.connector> parameter...if “$ver” < “x7
Writing Technician Interface ScriptsA-36 117382-A Rev. A## Gosubs shared by enable and disable...#:ERR_MSG1:cutenv -c $invalch ugly_ “$3”echo “Inappro
Sample Scripts117382-A Rev. A A-37 ## Disable circuit...#:FI_DSBLC:if $# != 3 then ; goto :FI_HELP_DSBL:instenv list_ wfFddiEntryif $list_0 = 0 then;
117382-A Rev. A xi About This Guide If you are interested in creating and editing Technician Interface scripts, refer to this guide for• An overview
Writing Technician Interface ScriptsA-38 117382-A Rev. A:FI_DSBLI:if $# != 3 then ; goto :FI_HELP_DSBL:# Sanity check <slot.connector> parameter
Sample Scripts117382-A Rev. A A-39 ################################################################## Version command#################################
117382-A Rev. A Index-1Symbols#, inserting comments using, 1-13$, referencing variable using, 1-2Aarrayenv command, 1-10, 2-3arrays, 1-8BBay Networks
Index-2 117382-A Rev. Afunctions, 2-20, 2-21Ggetenv command, 1-8, 2-9global variablesoverview of, 1-4PWD, 1-11gosub command, 1-11, 2-10goto command, 1
117382-A Rev. A Index-3suspending Technician Interface operation, 2-29system variables, 1-4TTechnical Solutions Centers, xivTFTP, 1-1timeout values, s
Writing Technician Interface Scriptsxii 117382-A Rev. A Conventions angle brackets (< >) Indicate that you choose the text to enter based on th
About This Guide 117382-A Rev. A xiii Acronyms ANSI American National Standards InstituteARP Address Resolution ProtocolASCII American Standard Code
Writing Technician Interface Scriptsxiv 117382-A Rev. A Bay Networks Customer Service You can purchase a support contract from your Bay Networks dist
117382-A Rev. A 1-1 Chapter 1Creating a Script File The Technician Interface script facility allows you to read and execute Technician Interface com
Writing Technician Interface Scripts1-2 117382-A Rev. A • Writing messages to the console, using the echo and the printf commands• Recording cons
Creating a Script File117382-A Rev. A 1-3 To prevent a variable from being expanded, enter two dollar signs ($$) before the variable name, as shown in
Writing Technician Interface Scripts1-4 117382-A Rev. ALocal, Global, and System VariablesWhen you first define a variable, the computer stores it in th
Creating a Script File117382-A Rev. A 1-5 Prompting for InputThe input prompt variable allows you to create a prompt that accepts user input from the
ii 117382-A Rev. A4401 Great America Parkway 8 Federal StreetSanta Clara, CA 95054 Billerica, MA 01821 Copyright © 1997 Bay Networks, Inc. All rights
Writing Technician Interface Scripts1-6 117382-A Rev. AIn the following script, if the user does not press Return before the time specified for SYS_IO_
Creating a Script File117382-A Rev. A 1-7 The variable values <object>, <attribute>, and <instance> are defined as follows:<object
Writing Technician Interface Scripts1-8 117382-A Rev. ADefining a Pseudo-Variable ArrayThe Technician Interface script facility allows you to define a p
Creating a Script File117382-A Rev. A 1-9 If you access the Technician Interface via Telnet, the Technician Interface also displays the variables in t
Writing Technician Interface Scripts1-10 117382-A Rev. A• To convert and format text, and save the result in a specified variable for later use, use th
Creating a Script File117382-A Rev. A 1-11 Setting the Current Volume or DirectoryWhen you set the current working volume or directory using the cd (c
Writing Technician Interface Scripts1-12 117382-A Rev. AWriting Messages to the ConsoleThe Technician Interface provides two commands to display messa
Creating a Script File117382-A Rev. A 1-13 Inserting CommentsYou can insert comments into the script file. Comments begin with a pound sign (#) in colu
Writing Technician Interface Scripts1-14 117382-A Rev. ARunning a Script FileTo read and execute the commands in a Technician Interface script file, an
117382-A Rev. A 2-1 Chapter 2Command ReferenceIn the following pages you can find the function, syntax, and examples of all the script commands you nee
117382-A Rev. A iii Bay Networks, Inc. Software License Agreement NOTICE: Please carefully read this license agreement before copying or using the
Writing Technician Interface Scripts2-2 117382-A Rev. Aon error Specifies an error handler label within a script filepause Suspends the Technician Inter
Command Reference117382-A Rev. A 2-3 arrayenv The arrayenv command allows you to write a list of command line arguments <text_string> to a pseud
Writing Technician Interface Scripts2-4 117382-A Rev. Acutenv The cutenv command allows you to select portions of a <text_string> (as specified b
Command Reference117382-A Rev. A 2-5 <text_string> with no field delimiters is normally passed through in its entirety.ExampleThe following sampl
Writing Technician Interface Scripts2-6 117382-A Rev. Aecho The echo command allows you to display its command line arguments to the user’s terminal.S
Command Reference117382-A Rev. A 2-7 enumenv The enumenv command lets you assign a sequence of values to a list of variables. You assign a starting nu
Writing Technician Interface Scripts2-8 117382-A Rev. Aexport The export command allows you to move one or more local variables to the global environm
Command Reference117382-A Rev. A 2-9 getenv The getenv command allows you to view the current list of variables stored in the local and global environ
Writing Technician Interface Scripts2-10 117382-A Rev. Agosub The gosub command calls a subroutine inside the same script file. It must be the last com
Command Reference117382-A Rev. A 2-11 goto The goto command lets you specify the next line to be executed from the script file. Within the script file,
iv 117382-A Rev. A its own data and information and for maintaining adequate procedures apart from the Software to reconstruct lost or altered files,
Writing Technician Interface Scripts2-12 117382-A Rev. AifThe if command allows you to evaluate whether an expression is true. The expression can be a
Command Reference117382-A Rev. A 2-13 <string1> <string2> are ASCII character strings or numbers.<operand> is one of the following c
Writing Technician Interface Scripts2-14 117382-A Rev. AThe backslash character (\) allows you to continue a command line on the following physical li
Command Reference117382-A Rev. A 2-15 Example 5For example, the following script tests whether variable a has been defined:setenv a 5if $?a=1 t
Writing Technician Interface Scripts2-16 117382-A Rev. AinstenvThe instenv command allows you to define a pseudo-variable array that contains the list
Command Reference117382-A Rev. A 2-17 Example 2The following example is an excerpt from a script file showing how to use the instenv command.instenv ip
Writing Technician Interface Scripts2-18 117382-A Rev. Alet The let command allows you to evaluate a simple arithmetical or logical expression and ass
Command Reference117382-A Rev. A 2-19 Example 2In the following script, variable name b is assigned the sum of variable name a plus 1.setenv a 1le
Writing Technician Interface Scripts2-20 117382-A Rev. AThe let command provides the following string functions:• strlen( )• strindex( )• strrindex( )
Command Reference117382-A Rev. A 2-21 You can also get the ASCII code for a given character (indicated as one character within single quotes, such as
117382-A Rev. A v Contents About This Guide Audience ...
Writing Technician Interface Scripts2-22 117382-A Rev. Alet -date -time localtime = date() + time()echo $localtime10/11/95 15:24:05let -date -time lon
Command Reference117382-A Rev. A 2-23 mibget The mibget command lets you search a MIB object table one record at a time and retrieve a set of attribut
Writing Technician Interface Scripts2-24 117382-A Rev. A<value_variable_array> is the name of an environmental array variable that stores the va
Command Reference117382-A Rev. A 2-25 # First instance ID to read, wildcard.setenv nextid “*”# Begin loop to read entire set of records :IP_RT_LOOP:mi
Writing Technician Interface Scripts2-26 117382-A Rev. Aoctetfmt The octetfmt command formats a MIB entry with an Octet or Opaque data type using the
Command Reference117382-A Rev. A 2-27 MAC2_ADDRESS formats the data as a noncanonical MAC address.SIGNED_INTEGER or INTEGER formats the data as a 4-by
Writing Technician Interface Scripts2-28 117382-A Rev. Aon error The on error command allows you to specify an error handler label within a script file
Command Reference117382-A Rev. A 2-29 pause The pause command allows you to suspend operation of the Technician Interface for a given interval. During
Writing Technician Interface Scripts2-30 117382-A Rev. Aprintf The printf command converts, formats, and prints the input arguments (<p1>,. . .,
Command Reference117382-A Rev. A 2-31 A summary of the flags and conversion codes follows:<format> = %<flag><width>.<precision
vi 117382-A Rev. A Inserting Comments ...1-13Debug
Writing Technician Interface Scripts2-32 117382-A Rev. A<conversion_specification> can be one of the following:•d or i indicates signed decimal n
Command Reference117382-A Rev. A 2-33 recordThe record command saves to an open file all messages written to the console terminal. Use this command whe
Writing Technician Interface Scripts2-34 117382-A Rev. AYou can stop saving messages to a snapshot file temporarily by using the pause option with the
Command Reference117382-A Rev. A 2-35 return You use the return command in a subroutine to return to the calling routine. When the return command exec
Writing Technician Interface Scripts2-36 117382-A Rev. Arun The run command allows you to read and execute the Technician Interface commands in a Tech
Command Reference117382-A Rev. A 2-37 The special variable $# contains the number of parameters entered on the command line following the script file n
Writing Technician Interface Scripts2-38 117382-A Rev. Asave env The save env command allows you to save the current list of local and global variable
Command Reference117382-A Rev. A 2-39 setenv The setenv command allows you to assign an ASCII string value or a numeric value to a variable in the loc
Writing Technician Interface Scripts2-40 117382-A Rev. Asource env The source env command allows you to read and execute the Technician Interface comm
Command Reference117382-A Rev. A 2-41 sprintf The sprintf command converts and formats text, and saves the result in a specified variable for later use
117382-A Rev. A vii Appendix A Sample Scripts Menu Script ...
Writing Technician Interface Scripts2-42 117382-A Rev. Aunsetenv The unsetenv command allows you to delete one or more variables from the local or glo
Command Reference117382-A Rev. A 2-43 ExamplesIf you enter: The system:unsetenv slotDeletes the variable slot from either the local or the global tabl
Writing Technician Interface Scripts2-44 117382-A Rev. Averbose The verbose command allows you to enable the debug trace facility. When you enable the
117382-A Rev. A A-1 Appendix ASample ScriptsTo help you create your own scripts, this appendix contains three sample scripts:• Menu script• FDDI.mnu s
Writing Technician Interface ScriptsA-2 117382-A Rev. Alet vol=$<Enter new TFTP Default Value #: >;\set wfTftp.wfTftpDefaultVolume.0 $vol;\go to
Sample Scripts117382-A Rev. A A-3 FDDI.BAT ScriptThe following example shows a protocol script for a Bay Networks router. You view output from the
Writing Technician Interface ScriptsA-4 117382-A Rev. A################################################################## Sub-command vectoring...####
Sample Scripts117382-A Rev. A A-5 ################################################################## Parse for “show” command...#####################
Writing Technician Interface ScriptsA-6 117382-A Rev. Alet i = strindex(“hwfilters”, cmd)if $i = 1 then ; goto :FI_HWF:let i = strindex(“version”, cmd
Sample Scripts117382-A Rev. A A-7 :FI_BASE_NM:setenv nextflag “”setenv pattern “”setenv nextid “*”array attr wfFDDICct wfFDDIState wfFDDIEnable
Writing Technician Interface ScriptsA-8 117382-A Rev. A################################################################## Show Alerts screen...#######
Sample Scripts117382-A Rev. A A-9 # Do next circuit...#:FI_SKIPA:let i = $i + 1goto :FI_ALOOP:########################################################
Writing Technician Interface ScriptsA-10 117382-A Rev. A################################################################## Show Enabled screen...#####
Sample Scripts117382-A Rev. A A-11 ################################################################## Print header for base/alerts/disabled/enabled sc
Writing Technician Interface ScriptsA-12 117382-A Rev. A:FI_STATE_ESC:printf “%-17.17s” “${value[$Madr]}”if ${value[$Bofl]} = 2 then ; \printf “%-4s”
Sample Scripts117382-A Rev. A A-13 :FI_STAT_NM:setenv nextflag “”setenv pattern “”setenv nextid “*”array attr wfFDDICct wfFDDICrcErrRx wfFDDIOve
Writing Technician Interface ScriptsA-14 117382-A Rev. A:FI_STLOOP:mibget -n wfFddiEntry attr $nextid value nextidif “$nextid” = “END” then; let i =
Sample Scripts117382-A Rev. A A-15 ################################################################## Receive Errors screen...########################
Writing Technician Interface ScriptsA-16 117382-A Rev. Aprintf “%-4.4s %-4.4s %-8.8s %-10.10s %-10.10s %-10.10s %-10.10s\n” \“Slot” “Conn” “Circuit”
Sample Scripts117382-A Rev. A A-17 array mac_attr wfFddiMacErrorCts/HEX_BYTES wfFddiMacLostCts/HEX_BYTESenum 1 errorcts lostctsmibget wfFddiMacEntry
117382-A Rev. A ix Tables Table 2-1. Script Commands ...2-1Table 2-
Writing Technician Interface ScriptsA-18 117382-A Rev. Asetenv nextid “*”array attr wfFDDICct wfFDDISlot wfFDDINode wfFDDIAbortTx \wfFDDIUnderrunTx
Sample Scripts117382-A Rev. A A-19 :FI_SYSTEM:if $# < 3 then; goto :FI_Sy1:let cmdlen = strlen(“$3”)let i = strindex(“errors”, “$3”)if $i = 1 then
Writing Technician Interface ScriptsA-20 117382-A Rev. A printf “%-4.4s %-4.4s %-8.8s %-10.10s %-10.10s %-10.10s %-10.10s \ %-10.10s\n” “----” “----”
Sample Scripts117382-A Rev. A A-21 # check for circuit name to match on...#if $# = 2 then ; goto :FI_SMT_NM:setenv cmd “$3”let len = strlen(cmd)if $le
Writing Technician Interface ScriptsA-22 117382-A Rev. Aprintf “%4d %4d ” $(wfFddiEntry.wfFDDISlot.${list_[$i]}) \$(wfFddiEntry.wfFDDINode.${list_[$i]
Sample Scripts117382-A Rev. A A-23 let state = $(wfFddiSmtEntry.wfFddiSmtCfState.${list_[$i]})if $state = 1 then ; printf “%-8s ” “Isolated”if $state
Writing Technician Interface ScriptsA-24 117382-A Rev. A################################################################## MAC screen...# ############
Sample Scripts117382-A Rev. A A-25 :FI_MAC_LP:on error :FI_MAC_NXT:if $i > $list_0 then; goto :FOOTER_AND_END: let cctnum = $(wfFddiEntry.wfFDDIC
Writing Technician Interface ScriptsA-26 117382-A Rev. Aprintf “%10u\n” $(wfFddiMacExtEntry.wfFddiMacRingOpCts.${list_[$i]})cutenv -c9-15 name2 “$cct
Sample Scripts117382-A 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
Comments to this Manuals