Dell Open Automation Owner's Manual

Open Automation Guide
Configuration and Command Line Reference
February 2013
Notes, Cautions, and Warnings
NOTE: A NOTE indicates important information that helps you make better use of your computer.
CAUTION: A CAUTION WARNING: A WARNING indicates a potential for property damage, personal injury, or death.
Information in this publication is subject to change without notice. © 2013 Dell Force10. All rights reserved.
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.
February 2013
1 About this Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
Supported Platforms and Required FTOS Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
Information Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
2 Open Automation Framework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
Bare Metal Provisioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10
Smart Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
Virtual Server Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
Programmatic Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12
Web Graphical User Interface and HTTP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12
3 Smart Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13
Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
Downloading the Smart Scripting Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
Installing Smart Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
Displaying Installed Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
Uninstalling Smart Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
Limits on System Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
Supported UNIX Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18
Creating PERL, Python and UNIX Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
Creating a User Name and Password for Smart Scripting . . . . . . . . . . . . . . . . . . . . . . .20
Running a Script from the FTOS CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
Logging in to a NetBSD UNIX Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
Running a Script from the UNIX Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
Using the PERL API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
Creating a PERL API Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
Running a PERL API Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26
Using the Python API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
Creating a Python API Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
Running a Python API Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
Using UNIX Shell Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
Creating a UNIX API Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
Running a UNIX API Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
4 Smart Scripting CLI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
| 3
www.dell.com | support.dell.com
5 Virtual Server Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
Hypervisor Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
VSN Persistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
VLAN configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
Management VLAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
Data VLANS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
Hypervisor-unaware VLANs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46
Installing VSN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46
Enabling VSN in a Hypervisor Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48
Discovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
Running VSN Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51
Stopping a Hypervisor Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
Disabling a Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
Removing a Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
Uninstalling VSN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53
Viewing VSN information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53
6 Virtual Server Networking CLI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
7 Programmatic Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
Using the REST API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70
Plug-In Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73
8 Web GUI and HTTP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
HTTP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
Web Graphical User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
Menu Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77
9 Web Graphical User Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79
10 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97
4 |

About this Guide

Objectives

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

Convention Description
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
keyword Keywords are shown in bold and should be entered in the CLI as listed.
parameter Parameters 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
Symbol Type Description
Note Informs you about important operational information.
FTOS Behavior Informs 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
https://www.force10networks.com/CSPortal20/Main/SupportMain.aspx. Click
Login, enter your user ID and password, and click the Login button.
2. On the Customer Support page, click the Software Center tab.
3. In the left hand column, click Automation Software.
4. At the bottom of the Terms and Conditions page, click I agree.
5. On the Automation Software page, under Software, click the
SMARTSCRIPTS2.0.x.tar.gz file for S55, S60 and S4810 switches. Click the SMARTSCRIPTS-Z.2.0.x.tar.gz file for Z9000 switches.
6. In the dialog box, select the path for the local flash on the switch or a directory path on a network server where you want to download the
SMARTSCRIPTS2.0.x.tar.gz file for S55, S60 and S4810 switches or the SMARTSCRIPTS-Z.2.0.x.tar.gz file for Z9000 switches.
Command Syntax Command Mode Task
package install {flash://filename | ftp://userid:password@host-ipaddress/dir-path | tftp://
host-ipaddress/dir-path}
Where:
flash://filename installs the Smart Scripting file
stored in flash memory on the switch.
ftp://userid:password@host-ipaddress/filepath logs
in and installs Smart Scripting from a file stored on an FTP server.
tftp://host-ipaddress/filepath installs Smart Scripting
from a file stored on a TFTP server.
16 | Smart Scripting
7. When the download is complete, enter the
package install command from the
FTOS CLI on a switch to install the Smart Scripting package.
EXEC Privilege Install 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 Syntax Command Mode Task
show packages
EXEC Privilege View 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 Syntax Command Mode Task
package uninstall package-name
Enter the name of the Smart Scripting package, exactly as it appears in the list.
show packages
EXEC Privilege Uninstall 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 Attribute Value Description
cputime unlimited Maximum amount of time used by a process. filesize unlimited Largest file size that can be created.
Smart Scripting | 17
Table 3-1. Limits on System Attributes
System Attribute Value Description
datasize 131,072 KB Maximum 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.
stacksize 2,048 KB Maximum 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. coredumpsize unlimited Largest size of a core file that may be created memory use 233,244 KB Maximum size to which a process’s resident set size may grow. This
www.dell.com | support.dell.com
memorylocked 77,741 Maximum size (in bytes) which a process may lock into memory using
maxproc 160 Maximum number of simultaneous processes allowed for the user ID. openfiles 64 Maximum 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
arp Address resolution display and control. awk Pattern scanning and processing language. basename Return filename or directory portion of pathname. cat Concatenate and print files. chmod Change file modes. chown Change fi le own er and group. cksum Display file checksums and block counts. cut Select portions of each line of a file. date Display or set date and time. dd Convert and copy a file. df Display free disk space. env Set and print environment.
18 | Smart Scripting
expr Evaluate expression.
Table 3-2. Supported UNIX Utilities (continued)
fc List the history of commands on the computer. fg Change the background process to foreground. file Determine file type. find Walk a file hierarchy. ftp Internet file transfer program. getopts Called each time you want to process an argument. grep Print lines matching a pattern. hostname Set or print name of current host system. ifconfig Configure network interface parameters. iostat Report I/O statistics. ln Make links. ls List directory contents. md5 Calculates and verifies 128-bit MD5 hashes. more A filter for browsing text files. netstat Show network status nice Execute a utility with an altered scheduling priority. nohup Invoke a command immune to hangups. ping Send ICMP ECHO_REQUEST packets to network hosts. ps Process status. pwd Return working directory name. sed Stream editor. sleep Suspend execution for an interval of time. sort Sort or merge text files. ssh Open SSH client (remote login program). stty Used for changing the settings of a UNIX computer terminal. tail Display the last part of a file. test Condi tion evaluation utility. ulimit Get and set process limits. umask Set file creation mode mask. vmstat Report virtual memory statistics. wait Await process completion. wc Word, line, and byte count. who Display 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 Syntax Command Mode Task
username name password password CONFIGURATION Create 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
f)# script username admin /usr/pkg/scripts/sample_scripts/DisplayAlarms.py f)# no script username admin /usr/pkg/scripts/sample_scripts/DisplayAlarms.py
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.
Command Syntax Command Mode Task
script [username name]
script-path [script-parameter script-parameter ...]
CONFIGURATION Run 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 Syntax Command Mode Task
start shell command.
www.dell.com | support.dell.com
start shell
EXEC Privilege Access 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 Arguments Description
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. F10ShowArpTbl None Returns the table of learned ARP entries. F10ShowBGPNeighbors None Returns list of BGP neighbors. F10ShowBGPRoute None Returns the table of BGP-l earned routes. F10ShowBGPSummary None Returns summary information on BGP sessions. F10ShowBootVar None Returns system boot variables. F10ShowEnvironment None Returns environment-monitoring variable values. F10ShowIntBrief None Returns brief interface status (up/down/admin up/admin down) of
all interfaces. F10ShowIntBriefLag None Returns brief interface status (up/down/ admin up/down) of all
port-channel interfaces. F10ShowIntBriefMan None Returns brief interface status (up/down/ admin up/down) of all
management interfaces. F10ShowIntBriefPhy None Returns brief interface status (up/down/ admin up/down) of all
physical interfaces. F10ShowIntBriefVlan None Returns brief interface status (up/down/ admin up/down) of all
VLAN interfaces. F10ShowIPRoute None Returns routing table info rmation. F10ShowISISNeighbors None Returns list of ISIS neighbors. F10ShowISISRoute None Returns 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. F10ShowLog None Returns the switch log buffer. F10ShowMacAddrTbl None Returns the table of learned MAC addresses. F10ShowMem (lagId) Returns switch memory usage. F10ShowOSPFNeighbors None Returns list of OSPF neighbors. F10ShowOSPFRoute None Returns 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. F10ShowProcCpu None Returns switch CPU usage and running processes. F10ShowRun None Returns the running configuration (in memory). F10ShowVer None Returns software version information. F10ShowVlan None Returns the F10ShowVlanId (vlanId) Returns the F10ShowVlanIntStatus (vlanId) Returns the detailed status of a specified VLAN interface. F10ShowVrrp None Returns the full VRRP status output. F10ShowVrrpBrief None Returns 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. F10WriteMem None Write 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
def main(args): try: startId = int(args[0]) endId = int(args[1]) if(startId<=endId): create_vlans(startId, endId) else : print "Invalid range: startId cannot be larger than endId",startId,endId except ValueError: print "Invalid arguments",args
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 Arguments Description
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. F10ShowArpTbl None Returns the table of learned ARP entries. F10ShowBGPNeighbors None Returns list of BGP neighbors. F10ShowBGPRoute Non e Returns the table of BGP-learned routes. F10ShowBGPSummary None Returns summary information on BGP sessions. F10ShowBootVar None Returns system boot variables. F10ShowEnvironment None Returns environment-monitoring variable values. F10ShowIntBrief None Returns brief interface status (up/down/admin up/admin down) of
all interfaces.
F10ShowIntBriefLag None Returns brief interface status (up/down/ admin up/down) of all
port-channel interfaces.
F10ShowIntBriefMan None Returns brief interface status (up/down/ admin up/down) of all
management interfaces.
F10ShowIntBriefPhy None Returns brief interface status (up/down/ admin up/down) of all
physical interfaces.
F10ShowIntBriefVlan None Returns brief interface status (up/down/ admin up/down) of all
VLAN interfaces. F10ShowIPRoute None Returns routing table information. F10ShowISISNeighbors None Returns list of ISIS neighbors. F10ShowISISRoute None Returns 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. F10ShowLog None Returns the switch log buffer. F10ShowMacAddrTbl None Returns the table of learned MAC addresses. F10ShowMem (lagId) Returns switch memory usage. F10ShowOSPFNeighbors None Returns list of OSPF neighbors. F10ShowOSPFRoute None Returns 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. F10ShowProcCpu None Returns switch CPU usage and running processes. F10ShowRun None Returns the running configuration (in memory). F10ShowVer None Returns so ftware version information. F10ShowVlan None Returns 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. F10ShowVrrp None Returns the full VRRP status output. 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.

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