-
Notifications
You must be signed in to change notification settings - Fork 26
/
ztp-debug.py
48 lines (35 loc) · 898 Bytes
/
ztp-debug.py
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
#!/usr/bin/env python2.7
#
# python -m py_compile sample_python_day0.py
print("\n Welcome to ZTP! \n")
import sys
print(" Python version is \n")
print(sys.version)
print("\n\n")
import time
import cli
import traceback
print("\n HellO! \n")
cli.configurep("hostname JCOHOE-ZTP-DEBUG")
cli.executep("show inv")
cli.executep("show version")
import os
os.system("sudo ifconfig")
os.system("sudo route -n")
cli.executep("show ip int br")
cli.executep("show ip int br | i up")
cli.executep("show run int vlan1")
cli.executep("show run int vlan4094")
cli.executep("show run | s iox")
cli.executep("show run | s app-h")
cli.executep("show lic all")
cli.executep("show run")
#
try:
print("Execute Show Version")
cli.executep("show version")
except:
print(traceback.format_exc())
print("Problem with show version CLI, cya later... \n")
#
print("\n \n ZTP complete! \n \n")