It is necessary to fasten monitor of hosts to flask. When a user visits a page, he should see:

192.168.0.1 - в сети 192.168.0.2 - не в сети 192.168.0.3 - в сети 

Let's say it will be checked on port 22

 import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.connect(('192.168.0.1', 22)) print("Хост в сети") except socket.error as e: print("Хост не в сети") s.close() 

It is desirable that dynamically updated Prompt how to implement.

  • At first you implement the work check on python. Try connecting the socket to the specified address, and if there are no errors, it means "on the network" - gil9red
  • Here's a good guide, what and how to do: codereview.stackexchange.com/questions/200159/… on the codereview. It will help. - 0-Level UNIX Monk
  • @ 1st Sentinel 31 Year Perl Hist - Thank you! - Vadim

0