mirror of
https://github.com/lopes/netbox-scanner.git
synced 2025-07-20 20:34:38 +02:00
added method to retrieve list of netbox prefixes
This commit is contained in:
parent
e0da9eb354
commit
96e16e30fc
@ -1,3 +1,10 @@
|
||||
# This script can be used sanitize the list of networks
|
||||
# to be scanned. In practice, (almost) the same routine
|
||||
# is executed everytime NetBoxScanner().sync() is
|
||||
# called, but if you want to debug this list or even
|
||||
# keep a more organized version, you can use dac.py.
|
||||
##
|
||||
|
||||
import re
|
||||
|
||||
from config import NETWORKS
|
||||
|
@ -42,6 +42,10 @@ class NetBoxScanner(object):
|
||||
return net
|
||||
return False
|
||||
|
||||
def get_networks(self):
|
||||
'''Retrieves all networks/prefixes recorded into NetBox.'''
|
||||
return [str(net) for net in self.netbox.ipam.prefixes.all()]
|
||||
|
||||
def get_description(self, address, name, cpe):
|
||||
'''Define a description based on hostname and CPE'''
|
||||
if name:
|
||||
|
Loading…
x
Reference in New Issue
Block a user