Owner's Manual
76 | Smart Scripting
www.dell.com | support.dell.com
The smartutils.cfg file is the configuration file used by the Programmatic Interface
package. It contains the user name and passwords required to log on to a switch via
telnet and access the CLI to execute the function calls in a Python API script. The
smartutils.cfg file downloads with the Programmatic Interface package and is stored
at /usr/pkg/scripts/smartutils.
To configure the username and passwords located in the smartutils.cfg file that are
used to run Python API scripts, do the following:
• 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 Python API script:
• From the Dell Networking OS CLI, use the
script command described in
Scheduling Time / Event-based Scripts.
• From a UNIX shell, follow the procedure described in Running a Script from the
UNIX Shell.
Using UNIX Shell Scripting
To create a UNIX script using the UNIX API and run the script on a Dell Networking
switch, use the information in this section. For information about creating and
running a PERL or Python script using the PERL or Python API, see Using the PERL
API or Using the Python API.
Creating a UNIX API Script
To create a UNIX shell script to run on a Dell Networking switch, use the information
in this section.
The F10SmartScriptUtils.py file is the main API library script that contains the
functions that you can include in a UNIX shell script. The F10SmartScriptUtils.py
script is stored at /usr/pkg/scripts/smartutils. Supported API Functions in UNIX Shell
Scripts describes the Dell Networking OS operations that you can invoke from a
UNIX shell script, including the supported functions and required arguments.
Figure 5-4 shows an example of how to write a script in the UNIX shell scripting
language. You can store a UNIX shell script anywhere on the switch.
Note: Use the user name and passwords contained in the smartutils.cfg file to log
into and run only the scripts created using the PERL, Python, and UNIX APIs
described in this chapter. A username used to run scripts cannot contain special
characters.