#!/usr/local/bin/python3 from Config import config from Network import Network from NetDB import NetDB netDB = NetDB(config['databases']['netdata']) yknet = Network() # Not passing a DB, this is just testing. yknet.routerCommunity = 'fartknocker' #yknet.routers = netDB.getRouters() yknet.routers = ['199.68.200.242'] yknet.scanRouterArpTables() #yknet.getHosts() #yknet.scanRouterRoutingTables() #yknet.commitRoutes(netDB)
updatedhcp = False scannetwork = False scanhostbridges = True # Currently doesn't even write to a database... if __name__ == '__main__': if initdbs: netdb = NetDB(config['databases']['netdata']) raddb = RadDB(config['databases']['radius']) zabdb = ZabDB(config['databases']['zabbix']) fsdb = FreesideDB(config['databases']['freeside']) if initnet: yknet = Network() yknet.routerCommunity = config['snmp']['routercommunity'] yknet.radioCommunity = config['snmp']['radiocommunity'] yknet.routers = netdb.getRouters() if scanarp: print('Updating Arp...') yknet.scanRouterArpTables() netdb.updateArp(yknet.globalArpTable) yknet.getHosts() # Populate hosts from that arp table. if scanroutes: print('Updating Routing Table...') yknet.scanRouterRoutingTables() netdb.updateAllRoutes(yknet.routers.values()) if pullforeigndbs: print('Updating Radius...') netdb.updateRadius(raddb)