Skip to main content

An implementation of Cisco pyATS

Project description

pyYAHTS

An interpretation of pyATS

pyYAHTS is a dyanmic, on-demand, YAML-free / testbed.yaml free, implementation of pyATS.

It works with any IOS / IOS-XE / IOS-XR / NXOS device!

The results are Rich JSON printed to the screen

Requirements

pyYAHTS is an extension of pyATS, which is required, and only runs on Linux operating systems

Installation

  1. pip install pyYAHTS

Getting Started

pyYAHTS works on any Cisco OS IOS / IOS-XE / IOS-XR / NXOS

pyYAHTS requires the follow options be speficied at runtime:

  1. (Required) Hostname of the device - must exactly match the configured hostname

  2. (Required) Operating System - Either ios, iosxe, iosxr, or nxos

  3. (Required) Username

  4. (Required) Password

  5. (Required) Command - Either a pyATS Learn Function, such as ospf, or any supported pyATS Parsed CLI Show Command, such as "show ip interface brief"

  6. (Optional) Filetype - Creates an output file -

    Supported filetpyes: JSON, YAML, HTML, Datatable HTML, Markdown, PDF, CSV

  7. (Optional) Email - 3 required fields if you want to e-mail the output with GMail

    --from_email - Your GMail Address

    --email_password - Your Gmail Password

    --to_email - The recipients Email

Help

For a list of supported Learn Functions please visit Available Learn Functions

Available Learn Functions

For a list of supported Parsers please visit Available Show Command Parsers

Available Show Parsers

A sample of "Show IP Interface" Parsers for IOS-XE IOS-XE Show IP Interface Sample

Using pyYAHTS

In any virtual environment with pyATS installed pyYAHTS can be executed several ways

  1. Prompted Inputs
(virtualenv)$ pyYAHTS
Hostname: dist-sw01
OS (ios, iosxe, iosxr, nxos): nxos
Username: cisco
Password:
Command: ospf
  1. Directly supplying options
(virtualenv)$ pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf
  1. Mixing supplied options and prompted responses
(virtualenv)$ pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco
Command: ospf

Creating Output files

If you include the optional --filetype flag you can create JSON and YAML files from the data

pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype json
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype yaml
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype html
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype datatable
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype markdown
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype pdf
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype csv

E-Mail Network State

If you include the optional E-Mail flags you can send the network state data using GMail

You will have to enable IMAP permissions on your GMail Account Enable IMAP in GMail

You may also have to enable support for Less Secure Apps

The three required flags to send an email are:

--from_email - Your GMail Address

--email_password - Your Gmail Password

--to_email - The recipients Email

Additonally if you specify a filetype (--filetype) the output file will be automatically attached to the email

Help

pyYAHTS includes a handy Rich Click Help! Simple type:

$ pyYAHTS --help

More Help

Contact

Please reach out on Twitter Twitter or open an issue if you hit any snags or have any questions!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyYAHTS-1.0.24.tar.gz (104.4 kB view details)

Uploaded Source

Built Distribution

pyYAHTS-1.0.24-py3-none-any.whl (105.9 kB view details)

Uploaded Python 3

File details

Details for the file pyYAHTS-1.0.24.tar.gz.

File metadata

  • Download URL: pyYAHTS-1.0.24.tar.gz
  • Upload date:
  • Size: 104.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.3 Linux/5.4.72-microsoft-standard-WSL2

File hashes

Hashes for pyYAHTS-1.0.24.tar.gz
Algorithm Hash digest
SHA256 e6f386f17c948cffe522dbbaf1bfdc0a341932025105cecb83745b99a1d6e0ac
MD5 1a51239044e4ac9fa759a0b6fa5baf89
BLAKE2b-256 2627ac72de8d418389acf37620ca4eeb540268910ee710e816ce7c686224baa6

See more details on using hashes here.

File details

Details for the file pyYAHTS-1.0.24-py3-none-any.whl.

File metadata

  • Download URL: pyYAHTS-1.0.24-py3-none-any.whl
  • Upload date:
  • Size: 105.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.3 Linux/5.4.72-microsoft-standard-WSL2

File hashes

Hashes for pyYAHTS-1.0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 9e31b8026b80b98327210ca1e98110213f69b28fe5d6d0044049f13bd7720754
MD5 8d209e835afcb2649dc4eab112aad0fe
BLAKE2b-256 250eb670cfa2bcdf3aa7632ef476a125967da9ae64abe8272b691a570004ec2d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page