Owner's Manual

Smart Scripting | 79
Figure 5-4. Script Written in the UNIX Shell Scripting Language: Example
#
!/bin/sh
i
=$1
w
hile [ $i -le $2 ]
d
o
echo $i
/usr/pkg/bin/python /usr/pkg/scripts/smartutils/F10SmartScriptUtils.py createvlanid $i
(( i++ ))
d
one
Table 5-5. Supported API Functions in UNIX Shell Scripts
Function Arguments Description
addlaginttovlan lagId, vlanId, tagFlag Adds a port channel (LAG) to a VLAN.
tagFlag values: 1 (tagged) or 0 (untagged).
addphyinttovlan stackunitNum, portId
vlanId, tagFlag
Adds an interface to a VLAN.
tagFlag values: 1 (tagged) or 0 (untagged).
createvlanid vlanId Creates a VLAN with a specified VLAN ID.
deletevlanid vlanId Deletes a VLAN with a specified VLAN ID
makelagintnoshutdown lagId Enables the specified port channel.
makelagintshutdown lagId Disables the specified port channel.
makelagintswitch lagId Configures the specified port channel (LAG) as a Layer 2
switchport.
makephyintnoshutdown stackUnitNum, portId Enables the specified port.
makephyintshutdown stackUnitNum, portId Disables the specified port.
makephyintswitch stackunitNum, portId Configures the specified port as a Layer 2 switchport.
makevlanintnoshutdown vlanId Enables the specified VLAN interface.
makevlanintshutdown vlanId Disables the specified VLAN interface.
ping ipAddress Pings (via ICMP) an IP address from the switch.
showarptbl None Returns the table of learned ARP addresses.
showbgpneighbors None Returns detailed BGP neighbor information.
showbgproute None Returns BGP-learned routes.
showbgpsummary None Returns BGP peer summary and status.
showbootvar None Returns system boot variables.
showcmd command Executes a specified show command.
showenvironment None Returns environment-monitoring variable values.
showipintbrief None Returns full interface list with up/down status.
showipintbrieflag None Returns brief interface status (up/down/ admin up/down) of all
port-channel interfaces.
showipintbriefman None Returns brief interface status (up/down/ admin up/down) of all
management interfaces.