-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathCheckShow_Commands.py
More file actions
71 lines (62 loc) · 2.62 KB
/
CheckShow_Commands.py
File metadata and controls
71 lines (62 loc) · 2.62 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from netmiko import ConnectHandler
from equipos import *
from paramiko.ssh_exception import SSHException
pregunta = input("ingrese show command para analizar en la red: ")
try:
Device1 = ConnectHandler(**Equipo1)
output = Device1.send_command(pregunta)
print("========================================================")
print("Results from command output to host: ",Equipo1["host"])
print(output)
print("========================================================")
print()
except Exception as ex:
print(ex,Equipo1["host"])
print("========================================================")
try:
Device2 = ConnectHandler(**Equipo2)
output2 = Device2.send_command(pregunta)
print("========================================================")
print("Results from command output to host: ",Equipo2["host"])
print(output2)
print("========================================================")
except Exception:
print('SSH is not enabled for this device.',Equipo2["host"])
print("========================================================")
print()
try:
Device3 = ConnectHandler(**Equipo3)
output3 = Device3.send_command(pregunta)
print("========================================================")
print("Results from command output to host: ",Equipo3["host"])
print(output3)
print("========================================================")
print()
except Exception:
print('SSH is not enabled for this device.',Equipo3["host"])
print("========================================================")
print()
try:
Device4 = ConnectHandler(**Equipo4)
output4 = Device4.send_command(pregunta)
print("========================================================")
print("Results from command output to host: ",Equipo4["host"])
print(output4)
print("========================================================")
print()
except Exception:
print('SSH is not enabled for this device.',Equipo4["host"])
print("========================================================")
print()
try:
Device5 = ConnectHandler(**Equipo5)
output5 = Device5.send_command(pregunta)
print("========================================================")
print("Results from command output to host: ",Equipo5["host"])
print(output5)
print("========================================================")
print()
except Exception:
print('SSH is not enabled for this device.',Equipo5["host"])
print("========================================================")
print()