I have a arista 7050S as a backup for a n3k-c3064pq-10gx i want to have an script in arista to ping the n3k-c3064 mgmt IP and if it has 4 or 5 timedout then no shut interface vlan 100-150 , can any one guide me how can i do this? thanks,

  • Seconding @ditrapanij below - please add to your question: a network diagram, relevant config of your devices and details to the challenge you're actually facing. Likely, there's a better (faster) and simpler approach.
    – Zac67
    Dec 2 '20 at 12:24
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Dec 17 '20 at 22:43

Firstly, without knowing too much about your environment I feel like you're going about this the wrong way, this is the exact reason (well, one of many) why dynamic protocols exist (e.g. STP, BGP or even OSPF).

Regardless, If you wished to achieve your desired outcome of performing a no shut on an interface(s), I would recommend you take a look at a few automation frameworks that will assist you perform this small task by taking care of the heavy lifting. Here are a few that may assist you:

Arista Netmiko - Low level Python wrapper around Paramiko. Handles a lot of the SSH connectivity to the device. A lot of your logic & parsing will need to be performed on your own.

NAPALM - NAPALM combines a lot of vendor specific & open source API's into a single point of execution that'll return structured data. Can be used in conjunction with Ansible to write some really neat test suites.

Nornir - Automation framework that keeps the logic & control of the tool within the Python you're executing from while still giving you base constructs like inventory management.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.