Owner's Manual
72 | Smart Scripting
www.dell.com | support.dell.com
Running a PERL API Script
When you run a PERL script that invokes the API functions in Supported UNIX
Utilities, log on credentials are read from the smartutils.cfg file and a telnet session
opens on the switch in which function calls are executed in the Dell Networking OS
CLI. The script closes the telnet session after running all the CLI commands.
The smartutils.cfg file is the configuration file used by the RESTAPI 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 PERL API script. The
smartutils.cfg file downloads with the Rest API 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 PERL 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 PERL API script:
• From the Dell Networking OS CLI, use the
script command as described in
Scheduling Time / Event-based Scripts.
• From a UNIX shell, follow the procedure described in Running a Script from the
UNIX Shell.
Using the Python API
To create a Python script using the Python API and run the script on a Dell
Networking switch, use the information in this section. For information about
creating and running a PERL script using the PERL API, refer to Using the PERL
API.
F10ShowVrrpBrief None Returns a brief VRRP session summary.
F10Traceroute (ipAddress, timeout) Performs a traceroute operation to an IP address from the switch.
F10WriteMem None Write the running configuration to the startup configuration file.
Table 5-3. Supported Dell Networking OS API Functions in PERL Scripts (continued)
Note: Use the user name and passwords contained in the smartutils.cfg file to log in
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.