pyATS | Scripts básicos

# Instalación

pip install pyats[full]
pip install pyats[full] --upgrade

# Crear archivo testbed (similar al host file de Ansible:
 
pyats create testbed interactive --output="my_testbed.yml"

OR

pyats create testbed file --path=my_excel_file.csv --output=my_testbed.yml

OR

Create a testbed file manually on YAML format (nano my_testbed.yml)


# Obtener informacion del host en formato estructurado (Ejemplo BGP, OSPF, Interfaces, etc) 


pyats learn all --testbed-file my_testbed.yml --output /home/angel/scripts/pyATS/
pyats learn bgp --testbed-file my_testbed.yml --output /home/angel/scripts/pyATS/
pyats learn interface --testbed-file my_testbed.yml --output /home/angel/scripts/pyATS/
pyats learn platform --testbed-file my_testbed.yml --output /home/angel/scripts/pyATS/
pyats learn config --testbed-file my_testbed.yml --output /home/angel/scripts/pyATS/

# Comparar output despues de un cambio de configuración

pyats learn config --testbed-file SWITCH1.yml --output SWITCH1_config_before
pyats learn config --testbed-file SWITCH1.yml --output SWITCH1_config_after
pyats diff SWITCH1_config_before SWITCH1_config_after --output SWITCH1_config_diff

Comentarios

Entradas populares de este blog

EVE-NG: Instalación de EVE-NG

Cisco Security | Bloquear MAC address en un switch

Nornir | Introducción, instalación y primer script básico