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
|
import re
|
||||||
|
|
||||||
from config import NETWORKS
|
from config import NETWORKS
|
||||||
|
@ -42,6 +42,10 @@ class NetBoxScanner(object):
|
|||||||
return net
|
return net
|
||||||
return False
|
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):
|
def get_description(self, address, name, cpe):
|
||||||
'''Define a description based on hostname and CPE'''
|
'''Define a description based on hostname and CPE'''
|
||||||
if name:
|
if name:
|
||||||
|
2
setup.py
2
setup.py
@ -7,7 +7,7 @@ with open('README.md', 'r') as fh:
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name='netbox-scanner',
|
name='netbox-scanner',
|
||||||
version='0.5.5',
|
version='0.5.6',
|
||||||
author='José Lopes de Oliveira Jr.',
|
author='José Lopes de Oliveira Jr.',
|
||||||
author_email='jlojunior@gmail.com',
|
author_email='jlojunior@gmail.com',
|
||||||
description='A scanner util for NetBox',
|
description='A scanner util for NetBox',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user