• Tag : eapi


CPU Utilization over EAPI

I’m trying to automate some performance monitoring tasks on my Arista switch. Is there is a supported command in the EAPI that can provide CPU utilization in a json format? I know that there are alternatives like using the HOST-RESOURCES MIB or getting the data in plaintext format but all of my existing management scripts are setup to handle json responses so I’d like to avoid having to implement a one-off solution if possible.

How to use Arista eAPI

I am new to Arista switch and EOS. I followed the guide in this website: https://eos.arista.com/arista-eapi-101/   However, when I tried to enter “show management api http-commands” into the switch,  I only got switch#show management api http-commands Enabled: Yes HTTPS server: running, set to use port 443 HTTP server: running, set to use port 8080 Local HTTP server: shutdown, no authentication, set to use port 8080 Unix Socket server: shutdown, no authentication VRFs: default Hits: 0 Last hit: never Bytes in: 0 Bytes out: 0 Requests: 0 Commands: 0 Duration: 0.000 seconds SSL Profile: none FIPS Mode: No QoS DSCP: 0...
Continue reading →

Robot framework authorization issue

Hello! I’ve just read an article https://eos.arista.com/arista-robot-testing/ about network validation and started building demo using Arista Robot Framework and network_validation-1.0.1.tar.gz package. I started with a simple topology of 2 switches based on cEOS-lab 4.23.2F. For external connectivity I exposed 443 and 80 ports like this “>80/tcp,>443/tcp”. Using python I can get access to eAPI: eapi_param = pyeapi.client.connect( transport=’http’, host=’localhost’, username=’admin’, password=’admin’, port=9000, ) eapi = pyeapi.client.Node(eapi_param) version_info = eapi.run_commands([‘show version’,]) print(version_info) [{‘memTotal’: 65931188, ‘cEosToolsVersion’: ‘1.1’, ‘uptime’: 30838457.12, ‘modelName’: ‘cEOSLab’, ‘internalVersion’: ‘4.23.2F-15405360.4232F’, ‘mfgName’: ”, ‘serialNumber’: ”, ‘systemMacAddress’: ’00:02:53:70:03:df’, ‘bootupTimestamp’: 1557660755.0, ‘memFree’: 20228108, ‘version’: ‘4.23.2F’, ‘architecture’: ‘i686’, ‘isIntlVersion’: False, ‘internalBuildId’: ‘4cde5c53-3642-4934-8bcc-05691ffd79b3’, ‘hardwareRevision’:...
Continue reading →

Timeout parameter for eAPI requests

Description Some monitoring tools have a limited time to receive information from the switch and may break if waiting for a response for too long. To avoid this, an additional, optional parameter has been added to the eAPI requests. requestTimeout (Float) Specifying it may cause the request to get interrupted and return prematurely. This may be useful in situations where the issuer of the request is blocking and needs to unblock within a certain amount of time. Should the time limit be exceeded, the response will contain the expected messages from any commands executed before the timeout had occurred, followed by an...
Continue reading →

“show run” eAPI response

Hello All, I wanted to parse some values from eAPI output of “show running-config” of a device. I have attached the sample response from one of my device. In this, the commands are not split in “key” and “value” format. I.e. for eg. “ip address” should be the “key” and actual IP should be its “value”. But ip address and actual IP coming in “key” part and value part shows “null”. Is there an alternate way to utilise this output to parse the value? Also when can we expect show run output in parsable format? Thanks in advance!

How to Automate MAC Address Lookups

Introduction MAC addresses are often overlooked, compared to higher layers of the OSI model, but they are a necessity in the transfer of data across the network. MAC addresses are unique in nature, with the vendor OUI portion of the MAC, and the client portion of the MAC. There are many reasons why locating a device is necessary, a few of them are: A device is causing adverse affects to the network and the port needs to be shutdown A port needs to be re-configured for a new device, but it is not known where the device is connected to...
Continue reading →

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 →

Valid Python Scripts may fail in OS X ‘El Capitan’

Python scripts can be run on OS X using eAPI to access Arista Switches or vEOS instances. Python Scripts can also be run on OS X to automate the installation of vEOS: (https://github.com/arista-eosplus/packer-veos). After installing or upgrading to OSX ‘El Capitan’ (OS X version 10.11.5) Python Scripts that previously worked fine under earlier versions of OS X or work on other operating systems may fail. This is evident when making a Python Script executable after issuing the chmod +x command.  This is due to operating system changes Apple has introduced in ‘El Capitan’. Although, this problem may affect eAPI and...
Continue reading →

static ARP inspection – configure IP-MAC bindings?

Based on TOI: https://eos.arista.com/eos-4-15-0f/static-arp-inspection/ static ARP inspection is now Available but how can we add and remove IP-MAC paars? on IP Source Guard this is documented: https://eos.arista.com/eos-4-15-2f/ip-source-guard/ but not on Static IP Inspection, did i miss something? Thanks for helping

eAPI error code: -32603

We are getting error code 32603 after running this command: aaa authorization exec default local group tacacs+ Restarting ngnix, disabling/enabling eAPI, removing the aaa command did not make a difference. We will try rebooting the switch at the end of the day to see if this fixes it.   eOS is EOS-4.14.6M. We will be upgrading to EOS-4.14.12M soon but wanted to see if there are known issues with current eOS and eAPI.

eapi library for golang (goeapi)

start working on a goeapi library, any help would be appreciated eapi binding and library for arista EOS https://github.com/cxfcxf/goeapi 0 forks. 0 stars. 0 open issues. Recent commits: ssh method updated, cxfcxf syntax, cxfcxf update system.go, cxfcxf syntax on readme, cxfcxf readme update, cxfcxf doesn’t really support python’s ParseConfig, so using json instead, syntax maybe different, will completing the library, the good part is, command line tool can be compiled and run on any systems.

Arista’s EOS Innovation Enabling Ecosystem Partner Software Development

Network software automation and intelligence is a passion we share as network engineering software developers at Intelligent Visibility, Inc. Creating innovative software solutions in the rising world of software-defined networking (SDN) can prove challenging. The source data that we require for our software is mostly located within the network device’s operating system. In the past accessing this source data has been a serious time investment mainly due to inconsistent API implementation types across different operating systems for many different hardware platforms.

eAPI and Unix Domain Socket

Introduction Today’s data centers cry out for automation. There are many approaches that Network Operators can leverage, but one method that is very powerful is using Arista’s eAPI command interface. When eAPI is enabled, the switch accepts commands using Arista’s CLI syntax, and responds with machine-readable output and errors serialized in JSON, served over HTTP or HTTPS. It’s very easy to use and exceptionally powerful. Other blogs and articles have discussed the usage of eAPI for scripts. The purpose of this article is to cover a new access method introduced in EOS 4.14.5, which allows local access to the eAPI...
Continue reading →

Securing eAPI

Introduction In this article we will talk about a few tips to secure our eAPI access, for example, HTTPS, changing port, certificate, ACL, on-box, AAA, vrf etc. Turning on/off eAPI First of all, the most secure way is turning off eAPI, which is by default. myswitch#configure myswitch(config)#management api http-commands myswitch(config-mgmt-api-http-cmds)#shutdown To turn eAPI on by “no shutdown”, by default the HTTPS protocol is running and HTTP is turned off for secure purpose, because HTTP send user and password in clear text. HTTP can be used by “protocol http”, however, we recommend using HTTPS. Both HTTP and HTTPS can be used concurrently. myswitch#configure terminal myswitch(config)#management api http-commands...
Continue reading →

EOS Extension – autoipcfg

With the release of the pyeapi library, its even easier to use the EOS eAPI interface to write some custom functionality to help with deployments, provisioning, configurations and many other things. Arista’s EOS+ organization has developed a full turn-key solution for provisioning new nodes on your network, known as ZTP server.  This is a full featured server that provides a bootstrap environment for Arista switches.  Its highly customizable and if you are looking for a lot of bells and whistles this would be the way to go. However the eAPI interface allows for extensions to be written really quickly if...
Continue reading →

Script example – Automating VXLAN deployments with EAPI

  1) Introduction This article describes briefly what is required to deploy overlay networks with VXLAN, but we assume a good understanding of the VXLAN fundamentals. To achieve such VXLAN deployments, multiple options exist, from simple but manual, to fully automated service chaining (orchestration) at the cost of having to also set a Cloud Management Platform or a network virtualization controler This article focuses on an easy option that is a good balance between simplicity of operation (automation), and simplicity of  setting up (script ready to go)   2) Working towards automation: it is an evolution This article is not providing...
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 →

Arista eAPI 101

In this article, you will get some quick ideas to use Arista eAPI to configure the switch via JSON-RPC remotely. Here is one Youtube video on eAPI if you prefer to watch something live: EOS Bits & Bytes – Episode 3 “Command API” The Arista Command eAPI is a simple and complete API that allows you to configure and monitor your Arista switches. Once the API is enabled, the switch accepts HTTP(S)  requests containing a list of industry standard CLI commands, and responds with machine-readable output and errors serialized in JSON (served over HTTP or HTTPS). eAPI was first introduced in...
Continue reading →


Get every new post on this blog delivered to your Inbox.

Join other followers: