Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
40 lines (31 loc) · 912 Bytes

File metadata and controls

40 lines (31 loc) · 912 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from netmiko import ConnectHandler
iosv_l2 = {
#'device_type':'cisco_ios',
#'device_type'='generic_termserver_telnet'
'device_type':'linux',
'ip':'192.168.1.42',
'username':'rahul',
'password':'mastlappyubuntu12',
#'port':2000
}
net_connect = ConnectHandler(**iosv_l2)
output = net_connect.send_command('ls')
#if("folder2" in output):
# print("Command successful")
#else:
# print("command did not succed")
print(output)
print(type(output))
res = net_connect.is_alive()
print(type(res))
print(res)
#print(type(output))
#print("abc\n def\n")
#commands = ['mkdir abc']
#output = net_connect.send_config_set(config_commands=commands, delay_factor=100)
#print(output)
#for n in range(2,22):
# print("Creating vlan "+ str(n))
# config_commands = ['vlan '+str(n), 'name Python_VLAN '+str(n)]
# output = net_connect.send_config_set(config_commands)
# print(output)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.