title: Detecting Change In Ip addresses status
body: <p>I have this code that displays the ip addresses that are on my network as well as the mac address and the status. I have it running in this loop so it always updates. How could i have it so when it updates and the ip address that was offline goes online it will instead say New instead of online for that one cycle and then show online at the next cycle if its still active.</p>
  
  <pre><code>import os
  
  from getmac import get_mac_address
  
  class bcolors:
      HEADER = '\033[95m'
      OKBLUE = '\033[94m'
      OKGREEN = '\033[92m'
      WARNING = '\033[93m'
      FAIL = '\033[91m'
      ENDC = '\033[0m'
      BOLD = '\033[1m'
      UNDERLINE = '\033[4m'
  
  minr = int(input("Starting Ip: "))
  maxr = int(input("Ending Ip: "))
  
  
  while True:
  
      for num in range(minr, maxr + 1): #plus one is to include the last digit entered
          ip = "192.168.2." + str(num)
  
          from getmac import getmac
  
          exit_code = os.system("ping -n 1 -w 1 " + ip + " &gt; nul") # Windows
          #exit_code = os.system("ping -c 1 -W 1 " + ip + " &gt; /dev/null") # Linux
  
          getmac.PORT = 44444  # Default: 55555
  
          if exit_code == 0:
              print(ip, bcolors.OKGREEN + "ONLINE " + bcolors.ENDC + bcolors.OKBLUE + get_mac_address(ip=ip, network_request=True) + bcolors.ENDC)
  
          elif (ip == '192.168.2.' + str(maxr + 1) and exit_code == 0):
              print('192.168.2.' + str(maxr), bcolors.OKGREEN + "ONLINE " + bcolors.ENDC + bcolors.OKBLUE + get_mac_address(ip=ip, network_request=True) + bcolors.ENDC)
              print("")
              print(bcolors.HEADER + "Beginning" + bcolors.ENDC)
              print("")
  
          elif (ip == '192.168.2.' + str(maxr)):
              print('192.168.2.' + str(maxr), bcolors.FAIL + "OFFLINE" + bcolors.ENDC)
              print("")
              print(bcolors.HEADER + "Refreshed" + bcolors.ENDC)
              print("")
  
          else:
              print(ip, bcolors.FAIL + "OFFLINE" + bcolors.ENDC)
  </code></pre>
  
  <p>What should happen is if the ip goes online it will show new and at the next cycle show online.</p>