-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTroubleshooting.py
More file actions
40 lines (35 loc) · 1.29 KB
/
Troubleshooting.py
File metadata and controls
40 lines (35 loc) · 1.29 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
#!/usr/bin/env python3
from NetFunctions import ping_host, dns_lookup, check_port, traceroute, arp_table_view
def main():
print("Welcome to Networking Tools!\n")
while True:
print("Select an option:")
print("1. Ping a host")
print("2. Perform a DNS lookup")
print("3. Check port status")
print("4. Traceroute")
print("5. View ARP Table")
print("6. Exit")
choice = input("Enter your choice (1-6): ")
if choice == "1":
host = input("Enter the host to ping: ")
ping_host(host)
elif choice == "2":
hostname = input("Enter the hostname to perform DNS lookup: ")
dns_lookup(hostname)
elif choice == "3":
host = input("Enter the host to check port status: ")
port = int(input("Enter the port to check: "))
check_port(host, port)
elif choice == "4":
destination = input("Enter the destination for traceroute: ")
traceroute(destination)
elif choice == "5":
arp_table_view()
elif choice == "6":
print("Exiting Networking Tools. Goodbye!")
break
else:
print("Invalid choice. Please select a valid option.\n")
if __name__ == "__main__":
main()