Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from __future__ import print_function
- from netmiko import ConnectHandler
- import os
- import sys
- import time
- import select
- import paramiko
- import re
- fd = open('C:Test.txt','w')
- old_stdout = sys.stdout
- sys.stdout = fd
- platform = 'cisco_ios'
- username = 'cisco'
- password = 'cisco'
- ip_add_file = open('C:IPAddressList.txt','r')
- for host in ip_add_file:
- #host = host.strip()
- device = ConnectHandler(device_type=platform, ip=host, username=username, password=password)
- output = device.send_command('sh ver | i upt')
- print(output)
- fd.close()
Add Comment
Please, Sign In to add comment