Smart Scripting | 33Running a UNIX API ScriptWhen you run a UNIX shell script that invokes the API functions in Table 3-5, logoncredentials are read from the smartutils.cfg file, and a telnet session is opened on theswitch in which function calls are executed in the FTOS CLI. The script closes thetelnet session after running all the CLI commands.The smartutils.cfg file is the configuration file used by the ProgrammaticManagement package. It contains the user name and passwords required to log on toa switch via telnet and access the CLI to execute the function calls in a UNIX APIscript. The smartutils.cfg file is downloaded with the Programmatic Managementpackage and is stored at /usr/pkg/scripts/smartutils.To configure the username and passwords in the smartutils.cfg file that are used torun UNIX API scripts, do one of the following:• From the Web user interface, select Settings > SmartUtils Credentials (see MenuOptions).• From a UNIX shell, use the UNIX text editor to open the smartutils.cfg file,enter a user name and password, and save the file.To run a UNIX API script:• From the FTOS CLI, use the script command as described in Running a Scriptfrom the FTOS CLI.• From a UNIX shell, follow the procedure described in Running a Script from theUNIX Shell.showvlan None Returns information on all VLANs, including membership.showvlanid vlanId Returns detailed interface information for a specified VLAN.showvlanintstatus vlanId Returns VLAN interface status.showvrrp None Returns the full VRRP status output.showvrrpbrief None Returns a brief VRRP session summary.traceroute ipAddress, timeout Performs a traceroute operation to an IP address from the switch.writemem None Write the running configuration to the startup configuration file.Table 3-5. Supported API Functions in UNIX Shell Scripts (continued)Note: The user name and passwords contained in the smartutils.cfg file are used tolog in and run only the scripts created using the PERL, Python, and UNIX APIsdescribed in this chapter. A username used to run scripts cannot contain specialcharacters.