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,
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.