Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import netmiko
- import json
- user_name = raw_input("username:")
- user_pass = raw_input("password:")
- ip_input = raw_input("please enter the IP of the device:")
- #netmiko.ConnectHandler(ip='ip_input',device_type='cisco_ios',username=user_name,password =user_pass)
- #netmiko.ssh_dispatcher
- #netmiko.BaseConnection.remote_conn
- #establish functions used to send commands for output verification.
- def tracemac():
- if raw_input() == "tracemac":
- netmiko.BaseConnection.send_command('show cdp neighbor',
- 'show mac address-table',)
- def netinfo():
- if raw_input() == "netinfo":
- netmiko.BaseConnection.send_command('show ip interface brief',
- 'show run',
- 'show vlan')
- def pingtest():
- if raw_input() == "pingtest":
- netmiko.BaseConnection.send_command('ping' (raw_input('ip: ')))
- def neighboradj():
- if raw_input() == "neighadj(eigrp)":
- netmiko.BaseConnection.send_command('show ip eigrp neighbor\n,',
- 'show ip eigrp summary\n',
- 'show ip eigrp status')
- print('sending commands...')
- elif raw_input(ospf) == "neighadj(ospf)":
- netmiko.BaseConnection.send_command('\n','\n','\n')
- elif raw_input(bgp) == "neighadj(bgp)":
- netmiko.BaseConnection.send_command('\n','\n','\n')
- #ask user option they would like to use after posting the legend.
- print("LEGEND:\n",
- "tracemac = shows neighbors and cam table \n",
- "netinfo = shows standard information about network config \n",
- "pingtest = self-explanatory\n",
- "neighadj(eigrp) = show discovered peering devices \n",
- "neighadj(ospf) = show discovered peering devices \n",
- "neighadj(bgp) = show discovered peering devices \n")
- raw_input('which option?: ')
- tracemac()
- netinfo()
- pingtest()
- neighboradj()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement