Just a beginner on python, need some expert advice. I am working on windows machine, have python 2.7 installed , trying to run one script which will connect to one of the cisco call manager CLI and run some commands (example -admin:utils create report hardware). I have attached screen shot of putty trough which I connect in normally, but would like to automate this. Any help on this will be appreciated.
I have tried using netmiko but it says below error - enter image description here
>>> from netmiko import ConnectHandler
>>> cisco_881 = {'device_type': 'cisco_ios','ip': '10.10.201.11','username':
'Admin','password': 'admin123'}
>>> net_connect = ConnectHandler(**cisco_881)
Traceback (most recent call last):
File "<pyshell#18>", line 1, in <module>
net_connect = ConnectHandler(**cisco_881)
File "build\bdist.win32\egg\netmiko\ssh_dispatcher.py", line 122, in
ConnectHandler
return ConnectionClass(*args, **kwargs)
File "build\bdist.win32\egg\netmiko\base_connection.py", line 146, in
__init__
self.session_preparation()
File "build\bdist.win32\egg\netmiko\cisco\cisco_ios.py", line 11, in
session_preparation
self.set_base_prompt()
File "build\bdist.win32\egg\netmiko\base_connection.py", line 634, in
set_base_prompt
raise ValueError("Router prompt not found: {0}".format(prompt))
ValueError: Router prompt not found: admin:
I recommend using the prompt feature below. With this method, you can quickly configure the device by exploring the prompt.