Exemplo n.º 1
0
 def __init__(self):
     Mnet.__init__(self)
     Mac.__init__(self)
     
     """
     Arp testing tools
     
     # new dict format
     # arp_dict = {}
     # arp_dict['b0096'] = {}
     # arp_dict['b0096']['Vlan200'] = {}
     # arp_dict['b0096']['Vlan200']['10.67.6.81_0000.0c07.acc9'] = {}
     # arp_dict['b0096']['Vlan200']['10.67.6.81_0000.0c07.acc9']['ip'] = '10.67.6.81'
     # arp_dict['b0096']['Vlan200']['10.67.6.81_0000.0c07.acc9']['vendor'] = 'Cisco'
     # arp_dict['b0096']['Vlan200']['10.67.6.81_0000.0c07.acc9']['desc'] = 'hsrp_gw'
     # arp_dict['b0096']['Vlan200']['10.67.6.81_0000.0c07.acc9']['dns_name'] = ''
     # arp_dict['b0096']['Vlan200']['10.67.6.81_0000.0c07.acc9']['port_scan'] = {'22': ('SSH-2.0-Cisco-1.25\n',), '23': ('http hello'), '80': ('fail', 'timed out')}
     # arp_dict['b0096']['Vlan200']['10.67.6.81_0000.0c07.acc9']['ping'] = '38 ms'
     # arp_dict['b0096']['Vlan200']['10.67.6.81_0000.0c07.acc9']['date'] = '2013-04-08'
     # arp_dict['b0096']['Vlan200']['10.67.6.81_0000.0c07.acc9']['time'] = '00:14:19'
     
     new nexus format
     Address         Age       MAC Address     Interface
     172.19.167.5    00:00:57  0001.d7e8.0046  Vlan167         
     """
     
     self.verbose = 1
     self.path = os.getcwd() + '\\'
     self.cfile = self.path +  'r++'
     self.db_file = self.path + 'arp_db'
     self.mping_load_file = '//an/produban/Systems/Comms/Network Operations\Software\Multi Ping 1 & 2\R++ load.txt'
     self.ip_index = {}
     self.mac_index = {}
     self.name_index = {}
     self.branch_list = []
     self.test_list = []    #just the devices in current test run
     self.test_ip = []
     self.report_out = []
     self.nexus = 0
     
     try:    #load the arp dict file
         self.arp_file = open(self.db_file)
         self.arp_dict = pickle.load(self.arp_file)
         self.arp_file.close()
     except: self.arp_dict = {}
     
     self.make_index()