Reproduction of these materials in any manner whatsoever without the written permission of Dell Inc. is strictly forbidden.
Trademarks used in this text: Dell™, the DELL logo, Dell Precision™, OptiPlex™, Latitude™, PowerEdge™, PowerVault™,
PowerConnect™, OpenManage™, EqualLogic™, KACE™, FlexAddress™ and Vostro™ are trademarks of Dell Inc. Intel, Pentium, Xeon,
Core™ and Celeron are registered trademarks of Intel Corporation in the U.S. and other countri es. AMD is a regist ered trademark and AMD
®
Opteron™, AMD Phenom™, and AMD Sempron™ are trademarks of Advanced Micro Devices, Inc. Microsoft
®
, MS-DOS® and Windows V ista® are either trademarks or registered trademarks of Microsoft Corporation in the United States and/or
Server
other countries. Red Hat Enterprise Linux
other countries. Novell
®
is a registered trademark of Oracle Corporation and/or its af filiates. Citrix®, Xen®, XenServer® and XenMotion® are either registered
Oracle
®
is a registered trademark and SUSE ™ is a trademark of Novell Inc. in the United States and other countries.
®
and Enterprise Linux® are registered trademarks of Red Hat, Inc. in the United State s and/or
, Windows®, Windows
trademarks or trademarks of Citrix Systems, Inc. in the United States and/or other countries. VMware®, Virtual SMP®, vMotion®, vCenter®,
®
and vSphere
are registered trademarks or trademarks of VMWare, Inc. in the United States or other countries.
Other trademarks and trade names may be used in this publication to refer to either the entities claiming the marks and names or their
products. Dell Inc. disclaims any proprietary interest in trademarks and trade names other than its own.
This document describes the components and uses of the Open Automation
Framework designed to run on the Force10 Operating Syste m (FTOS), including:
•Smart Scripting
•Virtual Server Networking (VSN)
•Programmatic Management
•Web graphic user interface (GUI) and HTTP Server
Information another feature, Bare Metal Provisioning (BMP) that interacts with the
Open Automation Framework can be found in the
1
FTOS Configuration Guide.
Audience
This document is intended for data center managers and network administrators
responsible for virtualization or system management. It assumes basic knowledge
about virtualization technology and networking.
Note: Although this document contains information on protocols, it is not intended to provide complete
information on protocol configuration and usage. For this information, refer to the document listed in
Related Documents on page 7 and the IETF Requests for Comment (RFCs).
Supported Platforms and Required FTOS
Versions
The Open Automation 2.0 release is supported on the following Dell Force10
switches and minimum FTOS versions:
•S55 switches require FTOS version 8.3.5.2 or later.
•S60 switches require FTOS version of 8.3.3.7 or later.
About this Guide | 5
Conventions
ConventionDescription
•S4810 switches require FTOS version 8.3.10.1 or later.
•Z9000 switches require FTOS version 9.0.0.0 or later. (SmartScripts and
SmartUtil support only).
This document uses the following conventions to describe command syntax:
www.dell.com | support.dell.com
keywordKeywords are shown in bold and should be entered in the CLI as listed.
parameterParameters are shown in italics and require a number or word to be ent e red in the CLI.
{X}Keywords and parameters within braces are required entries and must be entered in the CLI.
[X]Keywords and parameters within brackets are optional.
x | y Keywords and parameters separated by bar require you to choose one.
Information Symbols
Table 1-1 describes the symbols used in this document.
Table 1-1. Information Symbols
SymbolTypeDescription
NoteInforms you about important operational information.
FTOS BehaviorInforms you about an FTOS behavior. These behaviors are inherent to the Dell
Force10 system or FTOS feature and are non-configurable.
z
6|About this Guide
Platform-specific
Feature
Exception A note associated with some other text on the page that is marked with an
Informs you of the platform supporting the Open Automation features.
For example, the S55, S60, and S4810 platforms support all Open Automation
2.0 features. The Z9000 platform supports the SmartScripts and SmartUtil
features.
asterisk.
Related Documents
For more information about the Dell Force10 Networks switches discussed in this
document, refer to the following documents:
•S55
•FTOS Command Line Reference Guide for the S55 System
•FTOS Configuration Guide for the S55 System
•Installing the S55 System
•S60
•FTOS Command Line Reference Guide for the S60 System
•FTOS Configuration Guide for the S60 System
•Installing the S60 System
•S4810
•FTOS Command Line Reference Guide for the S4810 System
•FTOS Configuration Guide for the S4810 System
•Installing the S4810 System
•Z9000
•FTOS Command Line Reference Guide for the Z9000 System
•FTOS Configuration Guide for the Z9000 System
•Installing the Z9000 System
•FTOS Release Notes for the platform and version you are using.
About this Guide | 7
www.dell.com | support.dell.com
8|About this Guide
Open Automation Framework
Open Automation Framework is supported on
platforms:
Dell Force10’s Open Automation Framework is designed to provide an open,
industry standards-based automation technology that simplifies the management of
dynamic virtual data centers and reduces risk and overhead.
With the Open Automation Framework, resources in a virtualized data center are
managed more flexibly and efficiently without requiring the manual reconfiguration
of virtual switches (vSwitches), virtual machines (VMs) on network servers, and VM
control software each time there is a change in the network. Automated provisioning
of network resources during virtual machine migration ensures that connectivity and
security policies are maintained.
z
2
Industry-standard scripting languages, such as Perl and Python, are used to automate
the monitoring and management of network devices. Virtual resources can be quickly
allocated to adapt to configuration changes. Failure of a network device is more
quickly detected and resolved. As a result, network uptime increases.
Automated bare metal provisioning allows you to reduce operational overhead by
automatically configuring Force10 switches, accelerating switch installation, and
simplifying operating system upgrades.
Support for multiple, industry-standard hypervisors, virtual switches, and system
management tools ensure that automated solutions work within an established
data-center environment in which heterogeneous server, storage, and networking
equipment interoperate. In addition, Open Automation allows you to customize
automated solutions for your current multi-vendor virtualization environment.
An onboard Web-based graphical user interface (GUI) provides a user-friendly way
to monitor and manage a data center network. HTTP and HTTPS daemons run on
supported switches to provide additional management capability, such as the REST
application programming interface (API).
The Open Automation Framework consists of the following network management
tools:
•Bare Metal Provisioning
•Smart Scripting
•V irtual Server Networking
Open Automation Framework | 9
www.dell.com | support.dell.com
Web GUI and
HTTP Server
Programmatic
Management
Bare Metal
Provisioning
Smart
Scripting
Virtual Ser ver
Networking
•Programmatic Management
•Web GUI and HTTP server
You can use these components together or independently to extend and add
functionality to the FTOS operating system without requiring updates to an FTOS
release.
Figure 2-1. Open Automation Framework
Note: The Open Automation Framework is referred to as Open Automation in the rest of this document.
Bare Metal Provisioning
Bare Metal Provisioning (BMP) provides the following features:
•Automatic network switch configuration and automated configuration updates
•Enforced standard configurations
•Reduced installation time
•Simplified operating system upgrades
Automated bare metal provisioning reduces operational expenses, accelerates switch
installation, simplifies upgrades and increases network availability by automatically
configuring Dell Force10 switches. BMP eliminates the need for a network
administrator to manually configure a switch, resulting in faster installation,
elimination of configuration errors and enforcement of standard configurations.
With bare metal provisioning, after a switch is installed, the switch searches the
network for a DHCP server. The DHCP server provides the switch with an IP address
and the location of a file server, such as TFTP. The file server maintains a
configuration file and an approved version of FTOS, the operating system for Dell
Force10 switches. The switch automatically configures itself by loading and
installing an embedded FTOS image with the startup configuration file.
10|Open Automation Framework
Smart Scripting
Smart Scripting provides:
•Support for industry-standard languages, such as Perl and Python, avoiding the
need to learn a new proprietary scripting language
•Customization of device monitoring and management to suit your network needs,
including custom maintenance tasks, discovery programs, and event logging for
faster problem resolution
Smart scripting increases network availability and manageability by allowing
network administrators to deploy custom monitoring and management scripts on Dell
Force10 switches. Using custom scripts, network administrators can implement
version control systems, automatically generate alerts, create custom logging tools
and automate management of network devices. Any function that can be performed
through the FTOS command-line interface (CLI) can be performed with smart
scripting.
The scripting environment provided by Smart Scripting (Perl, Python, and UNIX
shell scripts) makes it easy for IT administrators to quickly develop scripts without
having to learn a new scripting language.
Virtual Server Networking
Virtual Server Networking (VSN) provides:
•Automatic re-provisioning of VLANs when you migrate virtual machines (VMs).
•Support for multiple hypervisors, such as VMware and Citrix XenServer.
Virtual data centers require network infrastructure to be dynamic to ensure that
network connectivity and QoS and security policies are maintained when VMs are
migrated. VSN facilitates communication between Dell Force10 switches and VM
management software to automatically re-provision VMs and associated VLANs
during virtual machine migration.
As a result, VSN greatly simplifies many of the tasks associated with virtualized
computing environments. Network administrators can manage the network while
server administrators manage the servers. No manual VLAN reconfiguration is
required when you migrate VMs.
VSN software supports the following hypervisors:
•VMware vSphere 4.0/4.1/5.0
•Citrix XenServer 5.6/6.0
Open Automation Framework | 11
www.dell.com | support.dell.com
Programmatic Management
Programmatic Management provides application programming interfaces (APIs) so
that FTOS switches can be managed by in-house or third-party system management
tools.
•Common third-party management tool sets are supported as plug-ins to the Open
Automation Framework, including Dell AIM, EMC Smarts Ionix, IBM Systems
Director, HP Network Automation (NA), CA Spectrum Infrastructure Manager,
and Oracle Enterprise Manager (OEM).
•Industry-standard management protocols are supported, such as SNMP (Get and
Set) and Representational State Transfer (REST).
•User protocols are supported, such as CLI/CLI-script, XML (Get and Set), and
Web-based command.
Programmatic management greatly improves network manageability by allowing
Dell Force10 switches to be managed by third-party system management tools via
standard programmatic interfaces.
The programmatic management environment and set of interfaces communicate
directly with third-party system management tools, avoiding the need for a dedicated
network management tool. As a result, network management is simplified and the
number of management tools is minimized.
Web Graphical User Interface and HTTP Server
The Open Automation Framework supports Web connectivity through its Web
interface and HTTP server:
•The Web-based GUI allows you to retrieve and update switch attributes and
characteristics.
•The HTTP Server consists of both HTTP and HTTPS daemons running on a
switch and communicating with the Web GUI.
12|Open Automation Framework
Smart Scripting
Smart Scripting is supported on platforms:z
Smart Scripting allows you to add functionality to the FTOS operating system
without requiring updates to the FTOS release. Smart Scripting is available as a
separate installable package that supports TCL, ZCL, Expect, PERL, Python, and
UNIX scripting and various FTOS functions.
The Smart Scripting package supports smart utility APIs (SmartUtils) to provide
developers with an easier way to invoke switch operations by creating and running
PERL, Python, and UNIX shell scripts on the FTOS operating system. API library
files describe the functions supported in TCL, ZSH, Expect, PERL, Python, and
UNIX scripts.
A separate package has been extended with HTTP and HTTPS daemons to support a
REST-like API based on CGI scripts and a Web-based graphical user interface. For
information on the HTTP Get requests supported by the REST API, see Chapter 7,
Programmatic Management.
3
Overview
Using Smart Scripting, network administrators can create custom TCL, ZCL, Expect,
PERL, Python, and UNIX shell scripts to manage and interact with Dell Force10
switches/routers in the network. Smart Scripting provides support for:
•Modules required to run PERL scripts, such as the software development kits
(SDKs) for VMware and vCenter/vSphere.
•Modules that implement requested Python features, such as AMQP (message
queuing), XML-RPC (arbitrary data exchange), and Twisted (event-driven
networking engine).
•BMP module that implement scripts written in TCL, ZSH, or Expect. For more
information, see the
Provisioning 3.0 (BMP 3.0).
With Smart Scripting, there is no need to learn proprietary scripting languages,
allowing for the faster development and deployment of custom scripts.
FTOS Configuration Guide, Chapter 9, Bare Metal
Smart Scripting | 13
www.dell.com | support.dell.com
Smart Scripting also offers solutions in a UNIX environment that are useful to cloud
administrators who are familiar with working directly in a UNIX shell. Script support
in a UNIX environment allows you to invoke standard UNIX utilities, such as netstat,
tcpdump, ls, chmod, chown, and so on.
Smart Scripting includes a convenient set of API function libraries to which script
developers can refer when they create PERL, Python, and UNIX scripts. A
representation of CLI functions to retrieve data from the FTOS operating system and
change configuration parameters on Dell Force10 switches is provided in the API
libraries. Script writers include API function calls made directly on the FTOS
command-line interface in their PERL, Python, and UNIX scripts.
For example, the API functions used in a script include setting up a telnet session,
gathering data on the switch, sending information to the CLI, and closing telnet
sessions. By using simple function calls, script writers do not have to include the
parsing code required for telnet sessions and retrieving configuration information.
Smart Scripting supports running a script either from the FTOS CLI or directly from
a UNIX shell.
This chapter includes the following sections:
•Use Cases
•Downloading the Smart Scripting Package
•Installing Smart Scripting
•Limits on System Usage
•Supported UNIX Utilities
•Creating a User Name and Password for Smart Scripting
•Running a Script from the FTOS CLI
•Logging in to a NetBSD UNIX Shell
•Running a Script from the UNIX Shell
•Using the PERL API
•Using the Python API
•Using UNIX Shell Scripting
14|Smart Scripting
Use Cases
Smart Scripting allows you to automate common management and maintenance
tasks, such as:
•Building visibility and/or discovery programs.
•Creating custom logging.
•Reporting configuration information.
•Reporting switch memory usage, configured VLANs, and other operating and
configuration parameters.
•Creating custom APIs for external applications to access the switch.
•Automating custom provisioning of network devices to support server
virtualization.
For example, you can automate any of the following tasks:
•Monitor the configuration of switch ports to verify that no change occurs and
generate an alarm if a configuration change is detected as part of a
cloud-computing deployment.
•Stage CLI command requests received from a customer. If a link flaps, the
command completion status is held in the script so you can see when the
management plane reconnects.
•Generate time-based reports to receive updates on network status on a periodic
basis.
•Query an external, configuration management database on a remote server to
retrieve information on port operation, and reconfigure switch ports based on the
data received.
•Apply additional time-based access-control lists (ACLs) to limit after hours
access.
•Monitor network requests; for example, “find a specified MAC address” or
“generate a health-check heartbeat”.
•Create a simple menu of options that a non-network administrator can use to
create requests to be sent to the network.
Smart Scripting consolidates management data inside a switch and sends it to
management consoles, databases or applications – reducing polling and network
traffic. For example, you can use a script as part of a cloud-computing deployment to
detect when the network has changed, query a database server for Configuration
Management Database (CMDB) information, and ultimately apply network changes
based on the data.
Downloading the Smart Scripting Package
The SmartScripts package ca n be down load ed from the Dell Force10 website as a file
named SmartScripts2.0.x.tar.gz for platforms such as S4810, S55, and S60; for
Z9000 the file name is SmartScripts-Z.2.0.x.tar.gz. The Smart Scripting package is
downloaded with the following files and functionality:
•PERL interpreter and associated files
•Python interpreter and associated files
•Expanded set of UNIX utilities
•REST-like API based on CGI scripts (see Using the REST API)
•Web-based graphical user interface (see Web Graphical User Interface)
•HTTP and HTTPS daemons (see HTTP Server)
Smart Scripting | 15
Installing Smart Scripting
You install the Smart Scripting file in the same way as you install an FTOS release:
directly from local flash memory on a switch or from an external drive on a network
server. Because the installation takes time, it is performed in the background. When
the download is complete, a message is displayed on the console. The package
installation updates the running-configuration file.
www.dell.com | support.dell.com
CAUTION
You can modify (e.g. edit or rename) the files downloaded with the Smart
Scripting package only in the directory in which you install the package. Never
modify the files in other system directories.
To install the Smart Scripting package, you must download it from the Dell Force10
web portal:
1. On a PC or other network device, go to the Dell Force10 web po rtal at
FTOS CLI on a switch to install the Smart Scripting package.
EXEC PrivilegeInstall the Smart Scripting package
from local flash memory or a network
server.
T o remove an installed Open Automation package, such as Smart Scripting, enter the
package uninstall command.
To follow the progress of a package installation (or removal), enter the
packages
command.
Displaying Installed Packages
To view the Open Automation packages currently installed on a switch, including
version numbers and content, enter the
Command SyntaxCommand ModeTask
show packages
EXEC PrivilegeView package information.
show packages command.
Uninstalling Smart Scripting
Caution: Before you uninstall the Smart Scripting package, you must first stop all scripts
that are currently running using the
manually stop the http server daemon.
Uninstalling the Smart Scripting package removes it from the internal flash memory.
no script script-name command. You must also
show
Command SyntaxCommand ModeTask
package uninstall package-name
Enter the name of the Smart Scripting package,
exactly as it appears in the
list.
show packages
EXEC PrivilegeUninstall the Smart Scripting package stored on
the switch.
Limits on System Usage
Smart Scripting establishes limits on system processes for the following attributes
(regardless of the user-privilege level or scripting method) to restrict CPU and
memory usage:
Table 3-1. Limits on System Attributes
System
AttributeValueDescription
cputimeunlimitedMaximum amount of time used by a process.
filesizeunlimitedLargest file size that can be created.
Smart Scripting | 17
Table 3-1. Limits on System Attributes
System
AttributeValueDescription
datasize131,072 KBMaximum size of the data segment for a process; this value defines
how far a program may extend its break with the sbrk(2) system call.
stacksize2,048 KBMaximum size of the stack segment for a process; this value defines
how far a program's stack segment may be extended. Stack extension
is performed automatically by the system.
coredumpsizeunlimitedLargest size of a core file that may be created
memory use233,244 KBMaximum size to which a process’s resident set size may grow. This
www.dell.com | support.dell.com
memorylocked77,741Maximum size (in bytes) which a process may lock into memory using
maxproc160Maximum number of simultaneous processes allowed for the user ID.
openfiles64Maximum number of open files for this process.
value imposes a limit on the amount of physical memory to be given to
a process; if memory is tight, the system will prefer to take memory
from processes that are exceeding their declared resident set size.
the mlock(2) function.
Supported UNIX Utilities
Smart Scripting supports the invocation of the following UNIX utilities in the scripts
you run:
Table 3-2. Supported UNIX Utilities
UNIX Utility Function
arpAddress resolution display and control.
awkPattern scanning and processing language.
basenameReturn filename or directory portion of pathname.
catConcatenate and print files.
chmodChange file modes.
chownChange fi le own er and group.
cksumDisplay file checksums and block counts.
cutSelect portions of each line of a file.
dateDisplay or set date and time.
ddConvert and copy a file.
dfDisplay free disk space.
envSet and print environment.
18|Smart Scripting
exprEvaluate expression.
Table 3-2. Supported UNIX Utilities (continued)
fcList the history of commands on the computer.
fgChange the background process to foreground.
fileDetermine file type.
findWalk a file hierarchy.
ftpInternet file transfer program.
getoptsCalled each time you want to process an argument.
grepPrint lines matching a pattern.
hostnameSet or print name of current host system.
ifconfigConfigure network interface parameters.
iostatReport I/O statistics.
lnMake links.
lsList directory contents.
md5Calculates and verifies 128-bit MD5 hashes.
moreA filter for browsing text files.
netstatShow network status
niceExecute a utility with an altered scheduling priority.
nohupInvoke a command immune to hangups.
pingSend ICMP ECHO_REQUEST packets to network hosts.
psProcess status.
pwdReturn working directory name.
sedStream editor.
sleepSuspend execution for an interval of time.
sortSort or merge text files.
sshOpen SSH client (remote login program).
sttyUsed for changing the settings of a UNIX computer terminal.
tailDisplay the last part of a file.
testCondi tion evaluation utility.
ulimitGet and set process limits.
umaskSet file creation mode mask.
vmstatReport virtual memory statistics.
waitAwait process completion.
wcWord, line, and byte count.
whoDisplay the users who are current ly lo gged in.
Smart Scripting | 19
www.dell.com | support.dell.com
Creating PERL, Python and UNIX Scripts
When you install the Smart Scripting package, sample PERL and Python scripts are
installed in the /usr/pkg/scripts/sample_scripts directory. You can also create your
own customized scripts and store them anywhere on the switch, such as in a /f10/
flash_ scripts directory.
In addition, you can use the PERL, Python, and UNIX APIs to create scripts that
invoke function calls directly in the FTOS CLI. These APIs provide a shortcut when
writing scripts. Refer to the following sections for more information:
•Using the PERL API
•Using the Python API
•Using UNIX Shell Scripting
For instructions on how to run a PERL, Python, or UNIX script from the FTOS CLI,
see Running a Script from the FTOS CLI.
For information on how to run a PERL, Python, or UNIX script directly from a UNIX
shell, see Running a Script from the UNIX Shell.
Creating a User Name and Password for Smart
Scripting
Before you run a script from the FTOS CLI, you may want to configure an additional
user name and password to be used only to run scripts on a switch. The user name and
password are used to log in to a UNIX shell and apply the read-write privileges
assigned to the user name when a script is run with the
FTOS CLI.
The user name is an optional entry in the
the FTOS CLI). To satisfy the requirements for a UNIX BSD login, the username
must be less than 16 characters. A username used to run scripts cannot contain special
characters.
Command SyntaxCommand ModeTask
username name password passwordCONFIGURATIONCreate an additional user name and password
script command (see Running a Script from
that are used to log in to a shell and apply
read-write privileges when a script is run.
script command from the
20|Smart Scripting
Running a Script from the FTOS CLI
f)# script /usr/pkg/scripts/sample_scripts/cmd-server.pl
f)# no script /usr/pkg/scripts/sample_scripts/cmd-server.pl
You can run any PERL, Python, and UNIX script that is stored on the switch from the
FTOS CLI.
When you run a script from the FTOS CLI, you can specify an optional user name to
apply the associated read-write privileges when the script is run (see Creating a User
Name and Password for Smart Scripting). If you do not specify a user name, the
script is run with the privileges of the current user.
To run a PERL, Python, or UNIX script from the FTOS CLI, enter the
command. You must enter the script name and directory path to start the script. The
script can invoke any of the supported UNIX utilities listed in Table 3-2. You can
enter the command multiple times to run more than one script at the same time.
CONFIGURATIONRun an installed script; for examples, see Figure 3-1.
For script-path, enter the directory path and filename.
(Optional) For username name, enter the user name
whose read-write privileges will be applied when the script
is run. A username used to run scripts cannot contain
special characters.
(Optional) For script-parameter, enter the values of up to
three parameters to be applied when the script is run. Enter
a blank space between parameter values; for example:
script username admin /f10/flash/createVlans.py 1 2
To stop a script that is running. enter the
example:
no script admin.pl.
To display the scripts that are currently running, including the scripts you have
stopped, enter the
show running-config | grep command.
script
no version of the script command; for
Figure 3-1. Starting and Stopping PERL and Python Scripts: Examples
Tip: For information on how to run a script directly from a UNIX shell without using
the FTOS CLI, see Running a Script from the UNIX Shell.
Smart Scripting | 21
Logging in to a NetBSD UNIX Shell
To log in to the NetBSD UNIX shell on a switch to directly enter any of the UNIX
commands described in Table 3-2 or to run a script, enter the
You are prompted to enter a user name and password before you can access the shell.
Login is performed using SSHv2.
Command SyntaxCommand ModeTask
start shell command.
www.dell.com | support.dell.com
start shell
EXEC PrivilegeAccess the shell to run UNIX commands or a
script (see Running a Script from the UNIX
Shell).
Running a Script from the UNIX Shell
You can run any PERL, Python, and UNIX script stored on a switch from either the
FTOS CLI (see Running a Script from the FTOS CLI on page 21) or directly from a
NetBSD shell on the switch.
When you run a script from a UNIX shell, you must first access the shell by entering
start shell command (see Logging in to a NetBSD UNIX Shell). You are
the
prompted to enter a user name and password configured with the
(see Creating a User Name and Password for Smart Scripting).
Figure 3-2 shows examples of how to execute a PERL, Python, and UNIX shell script
directly from a NetBSD shell on the FTOS operating system.
username command
22|Smart Scripting
Figure 3-2. Execution of a PERL, Python, and Shell Script from a UNIX Shell: Example
The NetBSD Foundation, Inc. All rights reserved.
The Regents of the University of California. All rights reserved.
Using the PERL API
Use the information in this section to create a PERL script using the PERL API and
run the script on a Dell Force10 switch. For information on how to create and run a
Python script using the Python API, see Using the Python API.
Creating a PERL API Script
The Programmatic Management package provides a PERL API library containing the
supported functions (described in Table 3-2), which can be used in a PERL script to
invoke FTOS operations on a switch. The PERL API library is stored in the
F10SmartUtils.pl file at /usr/pkg/scripts/smartutils.
You code FTOS API functions in a PERL script as shown in the following example:
Smart Scripting | 23
www.dell.com | support.dell.com
#!/usr/pkg/bin/perl -w
require '/usr/pkg/scripts/smartutils/F10SmartUtils.pl'; <------ Load the PERL API
usage() if ($#ARGV < 1);
($start,$end)=@ARGV;
$startVlan = $start;
$endVlan = $end;
for (my $i=$startVlan;$i<=$endVlan;$i++) {
my $createvlanId = F10CreateVlanId($i); <-------------------- Invoke a PERL API function
}
sub usage {
print "usage: createVlans.pl <start> <end>\n";
exit;
}
Figure 3-3. PERL Script with API function call: Example
Table 3-2 describes the supported functions and required arguments that you can use
in PERL scripts run on a Dell Force10 switch to connect through a telnet session and
gather information or configure parameters through the CLI.
24|Smart Scripting
Table 3-3. Supported FTOS API Functions in PERL Scripts
PERL API Function ArgumentsDescription
F10AddLagIntToVlan(lagId, vlanId, tagFlag)Adds a LAG interface to a VLAN as either tagged or untagged.
tagFlag values: 1 (tagged) or 0 (untagged).
F10AddPhyIntToVlan(stackUnitNum, portId,
vlanId, tagFlag)
Adds a physical interface to a VLAN as either tagged or untagged.
tagFlag values: 1 (tagged) or 0 (untagged).
F10CreateVlanId(vlanId)Creates a VLAN on the switch.
F10DeleteVlanId(vlanId)Deletes a VLAN on the switch.
F10ExecShowCmd(command)Executes a specified show command.
F10MakeLagIntNoShutdown (lagId)Enables the specified port channel.
F10MakeLagIntShutdown(lagId)Disables the specified port channel.
F10MakeLagIntSwitch(lagId)Configures the specified port channel (LAG) as a Layer 2
switchport.
F10MakePhyIntNoShutdown (stackUnitNum, portId)Enables the specified port.
F10MakePhyIntShutdown(stackUnitNum, portId)Disables the specified port.
F10MakePhyIntSwitch(stackUnitNum, portId)Configures the specified port as a Layer 2 switchport.
F10MakeVlanIntNoShutdown(vlanId)Enables the specified VLAN interface.
F10MakeVlanIntShutdown(vlanId)Disables the specified VLAN interface.
F10Ping(ipAddress)Pings (via ICMP) an IP address from the switch.
F10ShowArpTblNoneReturns the table of learned ARP entries.
F10ShowBGPNeighborsNoneReturns list of BGP neighbors.
F10ShowBGPRouteNoneReturns the table of BGP-l earned routes.
F10ShowBGPSummaryNoneReturns summary information on BGP sessions.
F10ShowBootVarNoneReturns system boot variables.
F10ShowEnvironmentNoneReturns environment-monitoring variable values.
F10ShowIntBriefNoneReturns brief interface status (up/down/admin up/admin down) of
all interfaces.
F10ShowIntBriefLagNoneReturns brief interface status (up/down/ admin up/down) of all
port-channel interfaces.
F10ShowIntBriefManNoneReturns brief interface status (up/down/ admin up/down) of all
management interfaces.
F10ShowIntBriefPhyNoneReturns brief interface status (up/down/ admin up/down) of all
physical interfaces.
F10ShowIntBriefVlanNoneReturns brief interface status (up/down/ admin up/down) of all
VLAN interfaces.
F10ShowIPRouteNoneReturns routing table info rmation.
F10ShowISISNeighborsNoneReturns list of ISIS neighbors.
F10ShowISISRouteNoneReturns the table of ISIS-learned routes.
F10ShowLagIntStatus(lagId)Returns the detailed status of a specified port-channel interface.
Smart Scripting | 25
Table 3-3. Supported FTOS API Functions in PERL Scripts (continued)
F10ShowLagIntVlanMembers(lagId)Returns information on VLAN membership for a specified
port-channel interface.
F10ShowLogNoneReturns the switch log buffer.
F10ShowMacAddrTblNoneReturns the table of learned MAC addresses.
F10ShowMem(lagId) Returns switch memory usage.
F10ShowOSPFNeighborsNoneReturns list of OSPF neighbors.
F10ShowOSPFRouteNoneReturns the table of OSPF-learned routes.
F10ShowPhyIntBand(stackUnitNum, portId)Returns in/out bandwidth average for a specified port.
F10ShowPhyIntStatus(stackUnitNum, portId)Returns the detailed status of a specified physical interface.
F10ShowPhyIntVlanMembers(stackUnitNum, portId)Returns information on VLAN membership for a specified
www.dell.com | support.dell.com
physical interface.
F10ShowProcCpuNoneReturns switch CPU usage and running processes.
F10ShowRunNoneReturns the running configuration (in memory).
F10ShowVerNoneReturns software version information.
F10ShowVlanNoneReturns the
F10ShowVlanId(vlanId)Returns the
F10ShowVlanIntStatus(vlanId)Returns the detailed status of a specified VLAN interface.
F10ShowVrrpNoneReturns the full VRRP status output.
F10ShowVrrpBriefNoneReturns a brief VRRP session summary.
show vlan output for all VLANs.
show vlan output for a specific vlan.
F10Traceroute(ipAddress, timeout)Performs a traceroute operation to an IP address from the switch.
F10WriteMemNoneWrite the running configuration to the startup configuration file.
Running a PERL API Script
When you run a PERL script that invokes the API functions in Table 3-2, logon
credentials are read from the smartutils.cfg file, and a telnet session is opened on the
switch in which function calls are executed in the FTOS CLI. The script closes the
telnet session after running all the CLI commands.
The smartutils.cfg file is the configuration file used by the Programmatic
Management 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 is downloaded with the Programmatic Management
package and is stored at /usr/pkg/scripts/smartutils.
Note: The user name and passwords contained in the smartutils.cfg file are used to
log in and run only the scripts created using the PERL, Python, and UNIX APIs
described in this chapter
characters.
. A username used to run scripts cannot contain special
26|Smart Scripting
To configure the username and passwords in the smartutils.cfg file that are used to
run PERL API scripts, do one of the following:
•From the Web user interface, select
Options).
•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 FTOS CLI, use the
from the FTOS CLI.
•From a UNIX shell, follow the procedure described in Running a Script from the
UNIX Shell.
Using the Python API
Use the information in this section to create a Python script using the Python API and
run the script on a Dell Force10 switch. For information on how to create and run a
PERL script using the PERL API, see Supported UNIX Utilities.
Creating a Python API Script
Settings > SmartUtils Credentials (see Menu
script command as described in Running a Script
Use the information in this section to create a Python script to be run on a Dell
Force10 switch. For information on how to run a Python script from the FTOS CLI,
see Running a Script from the FTOS CLI.
F10SmartUtils.py is the Python API library containing the supported functions
(described in Table 3-4), which can be used in a Python script to invoke FTOS
operations on a switch. This file is downloaded with the Programmatic Management
package and is stored at /usr/pkg/scripts/smartutils.
You code FTOS API functions in a Python script as shown in the following example:
Smart Scripting | 27
www.dell.com | support.dell.com
Figure 3-4. Python Script with API function call: Example
#!/usr/pkg/bin/python
import sys
sys.path.append('/usr/pkg/scripts/smartutils') <--------------- Load the Python API
import F10SmartUtils
def create_vlans(startId,endId):
for vlanId in range(startId,endId+1):
result = F10SmartUtils.F10CreateVlanId(vlanId) <------- Invoke a Python API function
print result
if __name__=="__main__":
if len(sys.argv)>2:
main(sys.argv[1:])
else:
print "Please supply valid arguments"
print "createVlans.py <startId> <endId>"
Table 3-4 describes the supported functions and required arguments that you can use
in Python scripts run on a Dell Force10 switch to connect through a telnet session and
gather information or configure parameters through the CLI.
Table 3-4. Supported FTOS API Functions in Python Scripts
Python API Function ArgumentsDescription
F10AddLagInttoVlan(lagId, vlanId, tagFlag)Adds a LAG interface to a VLAN as either tagged or untagged.
tagFlag values: 1 (tagged) or 0 (untagged).
F10AddPhyInttoVlan(stackUnitNum, portId,
vlanId, tagFlag)
F10CreateVlanId(vlanId)Creates a VLAN on the switch.
F10DeleteVlanId(vlanId)Deletes a VLAN on the switch.
F10ExecShowCmd(command)Executes a specified show command.
F10MakeLagIntNoShutdown(lagId)Enables the specified port channel.
F10MakeLagIntShutdown(lagId)Disables the specified port channel.
F10MakeLagIntSwitch(lagId)Configures the specified port channel (LAG) as a Layer 2
F10MakePhyIntNoShutdown(stackUnitNum, portId)Enables the specified port.
F10MakePhyIntShutdown(stackUnitNum, portId)Disables the specified port.
Adds a physical interface to a VLAN as either tagged or untagged.
tagFlag values: 1 (tagged) or 0 (untagged).
switchport.
F10MakePhyIntSwitch(stackUnitNum, portId)Configures the specified port as a Layer 2 switchport.
28|Smart Scripting
Table 3-4. Supported FTOS API Functions in Python Scripts (continued)
F10MakeVlanIntNoShutdown (vlanId)Enables the specified VLAN interface.
F10MakeVlanIntShutdown(vlanId)Disables the specified VLAN interface.
F10Ping(ipAddress)Pings (via ICMP) an IP address from the switch.
F10ShowArpTblNoneReturns the table of learned ARP entries.
F10ShowBGPNeighborsNoneReturns list of BGP neighbors.
F10ShowBGPRouteNon eReturns the table of BGP-learned routes.
F10ShowBGPSummaryNoneReturns summary information on BGP sessions.
F10ShowBootVarNoneReturns system boot variables.
F10ShowEnvironmentNoneReturns environment-monitoring variable values.
F10ShowIntBriefNoneReturns brief interface status (up/down/admin up/admin down) of
all interfaces.
F10ShowIntBriefLagNoneReturns brief interface status (up/down/ admin up/down) of all
port-channel interfaces.
F10ShowIntBriefManNoneReturns brief interface status (up/down/ admin up/down) of all
management interfaces.
F10ShowIntBriefPhyNoneReturns brief interface status (up/down/ admin up/down) of all
physical interfaces.
F10ShowIntBriefVlanNoneReturns brief interface status (up/down/ admin up/down) of all
VLAN interfaces.
F10ShowIPRouteNoneReturns routing table information.
F10ShowISISNeighborsNoneReturns list of ISIS neighbors.
F10ShowISISRouteNoneReturns the table of ISIS-learned routes.
F10ShowLagIntStatus(lagId)Returns the detailed status of a specified port-channel interface.
F10ShowLagIntVlanMembers (lagId)Returns information on VLAN membership for a specified
port-channel interface.
F10ShowLogNoneReturns the switch log buffer.
F10ShowMacAddrTblNoneReturns the table of learned MAC addresses.
F10ShowMem(lagId) Returns switch memory usage.
F10ShowOSPFNeighborsNoneReturns list of OSPF neighbors.
F10ShowOSPFRouteNoneReturns the table of OSPF-learned routes.
F10ShowPhyIntBand(stackUnitNum, portId)Returns in/out bandwidth average for a specified port.
F10ShowPhyIntStatus(stackUnitNum, portId)Returns the detailed status of a specified physical interface.
F10ShowPhyIntVlanMembers (stackUnitNum, portId)Returns information on VLAN membership for a specified
physical interface.
F10ShowProcCpuNoneReturns switch CPU usage and running processes.
F10ShowRunNoneReturns the running configuration (in memory).
F10ShowVerNoneReturns so ftware version information.
F10ShowVlanNoneReturns the show vlan output for all VLANs.
F10ShowVlanId(vlanId)Returns the show vlan output for a specific vlan.
Smart Scripting | 29
Table 3-4. Supported FTOS API Functions in Python Scripts (continued)
F10ShowVlanIntStatus(vlanId)Returns the detailed status of a specified VLAN interface.
F10ShowVrrpNoneReturns the full VRRP status output.
F10ShowVrrpBriefNoneReturns a brief VRRP session summary.
F10Traceroute(ipAddress, timeout)Performs a traceroute operation to an IP address from the switch.
F10WriteMemNoneWrite the running configuration to the startup configuration file.
Running a Python API Script
When you run a Python script that invokes the API functions in Table 3-4, logon
www.dell.com | support.dell.com
credentials are read from the smartutils.cfg file, and a telnet session is opened on the
switch in which function calls are executed in the FTOS CLI. The script closes the
telnet session after running all the CLI commands.
The smartutils.cfg file is the configuration file used by the Programmatic
Management 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 is downloaded with the Programmatic Management
package and is stored at /usr/pkg/scripts/smartutils.
Note: The user name and passwords contained in the smartutils.cfg file are used to
log in and run only the scripts created using the PERL, Python, and UNIX APIs
described in this chapter
characters.
. A username used to run scripts cannot contain special
To configure the username and passwords in the smartutils.cfg file that are used to
run Python API scripts, do one of the following:
•From the Web user interface, select
Settings > SmartUtils Credentials (see Menu
Options).
•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 FTOS CLI, use the
script command as described in Running a Script
from the FTOS CLI.
•From a UNIX shell, follow the procedure described in Running a Script from the
UNIX Shell.
30|Smart Scripting
Loading...
+ 68 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.