An Introduction to the Golang eAPI

Introduction Since the release of Arista EOS Command API (eAPI) many have grown to appreciate its stability and easy-to-use syntax which allow applications or scripts complete programmatic control over EOS. Development of applications that interface with your Arista device for the purpose of configuration or monitoring is simple and fairly straight forward. With a little knowledge of Python, Perl, Ruby, or your favorite language of choice, and familiarity with the underlying transport mechanism (JSON-RPC), it’s easy to write some custom functionality to help with deployments, provisioning, configurations and many other things.  Arista has continued its ongoing effort to make life...
Continue reading →

Adding Interface DHCP Support with an Event Handler

While EOS does not support DHCP on interfaces natively from the CLI, it is easy to leverage the underlying Linux operating system along with event-handlers to add this support yourself! dhclient is available natively within EOS. The trick is that you need to first get dhclient to run for a given interface you want to DHCP an address for, and then you need to take the result from dhclient and apply that to the CLI as if it were a static configured IP address. The following script (installed at /mnt/flash/dhcpintf) can be run out of an interface event-handler to start/stop...
Continue reading →

Working with the Python eAPI Client

This article builds on the Introduction to the Python Client for eAPI by taking a look at the pyeapi client a little deeper.  The client module provides a number of functions for making it easier to build connectivity to Arista EOS nodes running eAPI. To get started, lets begin by simply importing the pyeapi client in Python and review the how to build a node object. >>> import pyeapi >>> node = pyeapi.connect_to('veos01') As discussed in the introduction article, the above will search for and load the eapi.conf file.  Once the configuration file has been found and loaded by pyeapi,...
Continue reading →

Introducing the Python Client for eAPI (pyeapi)

The Arista EOS command API (eAPI) has been available in versions of EOS since the release of version 4.12.  It has proven to be an invaluable tool for building management plane applications, making it easy to develop solutions that interface with the device configuration and state information.  Building on the capabilities of eAPI, this article introduces the initial release of the Python Client for eAPI (pyeapi). The Python Client for eAPI (pyeapi) is a language specific client to make working eAPI even easier.  It is designed to assist network engineers, operators and devops teams to build eAPI applications faster without...
Continue reading →

Introduction to Managing EOS Devices – Automation and Extensibility

Note: This article is part of the Introduction to Managing EOS Devices series: https://eos.arista.com/introduction-to-managing-eos-devices/      5) Automation and Extensibility   The Arista EOS facilitates task automation, provisioning, and extending capabilities on the Arista switches. The following features are available on all the platforms: Managing extensions and applications AEM: Event Manager AEM: CLI Scheduler     5.1) Managing EOS Extensions   The most simple and efficient way to make the most of the extensibility on which EOS is built is through the use of extensions.  An extension is a pre-packaged optional feature or set of scripts in an RPM or SWIX format....
Continue reading →

Intelligent Bootstrap with Arista EOS and ZTPServer

Many customers inquire about how to get started with automation into their operational networks. These conversations tend to revolve around how to reduce the operational expense and risk associated with managing data center networks. In most cases, the general consensus leads to starting automation around the bootstrap process or, in other words, how to find a better way to introduce consistency and agility into the deployment process.  Arista’s early heritage grew from solving real world operational problems that enhance our customers ability to deliver massively scalable data center networks efficiently. Throughout the development process EOS has provided innovative solutions that...
Continue reading →

Introducing Arista EOS Roles for Ansible

This article introduces the newly released Arista EOS role for Ansible.  The Arista EOS role provides a set of Ansible modules that can used in playbooks for automating the configuration of network resources contained in Arista EOS nodes.  The EOS role replaces the existing arista_* modules that are currently available in the Ansible distribution.  The base code that comprises the EOS role has been re-worked from the beginning, influenced by lessons learned from the first generation modules.   In addition, the EOS role now takes advantage of Ansible Galaxy to provide a streamlined distribution mechanism to make getting started with...
Continue reading →

Running a Guest VM on EOS

Introduction One of the key features of Arista EOS is its Extensibility. (that is what the E in EOS stands for.) Many people already love that EOS is based on unmodified Linux kernel and basically runs a subset of Fedora Linux (as of writing, Fedora Core 14). To anyone familiar with Unix or Linux an Arista switch basically looks like a Linux server with lots of ethernet interfaces: switch>enable switch#bash Arista Networks EOS shell [admin@switch ~]$ uname -a Linux switch 2.6.32.28.Ar-957380.EOS4104gaurav #1 SMP PREEMPT Sat Nov 3 13:07:31 PDT 2012 x86_64 x86_64 x86_64 GNU/Linux [admin@switch ~]$ ifconfig -a cpu Link encap:Ethernet HWaddr 00:1C:73:19:F6:46...
Continue reading →

Packaging and installing EOS extensions

EOS follows the Fedora model of packaging and distributing software as RPMs. EOS extensions can be packaged either as normal RPMs, or as a bundle of RPMs called a SWIX. Creating an EOS extension as an RPM A standard RPM can be used for packaging EOS extensions. Documentation on how to build an RPM can be found in the rpmbuild man page, on the rpm.org website at http://www.rpm.org/wiki/Docs, or on the Fedora Project Wiki at http://fedoraproject.org/wiki/How_to_create_an_RPM_package. The following example shows a quick way to create an RPM extension for a fixed set of files, in this case a script called MyTestExtension...
Continue reading →

Automatic MD5 Verification of EOS image

Introduction This article describes how EOS can be extended in order to check the integrity of software images. The extension described below adds the ability to automatically download the MD5 sum of an EOS image and check its integrity.  This is done by adding an optional verify parameter to the existing copy command. When verify is specified, the switch will first attempt to copy the requested EOS image (e.g. EOS-4.12.5.swi), and then it will try to retrieve an MD5 sum for the same resource (e.g. EOS-4.12.5.swi.md5sum). Assuming both files are successfully downloaded, the MD5 sum of the software image will be...
Continue reading →

Dynamically update your interface name via port auto-description

Overview: Port auto-description will dynamically update the port description based on the LLDP information received from the neighbour. As always we are looking for your feedback please let us know if you have ideas on how to improve this script or other ideas… The tool: The script, called ‘portAuto’, will dynamically change the port description based on the neighbour’s LLDP information. This could be used as a stand alone script or part of a larger toolset. How to get the code: Get the code directly from Github https://github.com/arista-eosext/PortAutoDescription4 forks.8 stars.2 open issues.Recent commits: Update README.md, GitHub Add unix socket support, Philip DiLeo...
Continue reading →

Understanding EOS CLI implementation

This document gives an overview of the some of the APIs used for developing CLI Plugins. Although it tries to be as complete as possible, it only focuses on the most common APIs used by the CLI Plugins and it is not an exhaustive description of all the interfaces. The document is relevant for EOS version 4.12.0, although parts of the document might also apply to older releases. “Hello world!” example TestCli.py # Copyright(c)2013 AristaNetworks,Inc. All rights reserved. # Arista Networks, Inc. Confidential and Proprietary. import BasicCli import CliParser from CliModel import Model # Model ­ only required for eAPI...
Continue reading →

Reacting to syslog-triggered events

EOS in tandem with Python scripting can provide the network operator an invaluable tool that is driven by local log entries on the switch. The script presented here continuously monitors /var/log/messages for new entries as it contains verbose, unfiltered entries. The script then searches each log entry using the built-in Python regular expression module. When a matching entry is found (this script is looking for major errors) it saves the output of ‘show tech-support’ to internal flash. For every match, the script checks for the existence of a ‘show tech-support’ file to ensure it doesn’t create a duplicate entry for...
Continue reading →

EOS extensions on GitHub

A collection of scripts and examples on how to extend EOS using Python can be found in the following repository on GitHub: arista-eosext13 repositories, 0 followers.