bugfix in nbscan

This commit is contained in:
José Lopes 2018-09-20 16:58:34 -03:00
parent c8dfe5adc4
commit d41ba6fce7
3 changed files with 11 additions and 2 deletions

View File

@ -6,6 +6,15 @@ A scanner util for NetBox, because certain networks can be updated automagically
$ pip3 install netbox-scanner
Another way is download from GitHub:
$ wget https://github.com/forkd/netbox-scanner/archive/master.zip
$ unzip netbox-scanner-master.zip -d netbox-scanner
$ cd netbox-scanner
$ pip install -r requirements.txt
$ vi netbox-scanner/config.py # edit this file, save and exit
$ python netbox-scanner/netbox-scanner.py
Note that `netbox-scanner` will require Nmap and an instance of NetBox ready to use.
## Usage

View File

@ -42,7 +42,7 @@ class NetBoxScanner(object):
try:
description = self.get_description(nm[host]['hostnames'][0]['name'],
nm[host]['osmatch'][0]['osclass'][0]['cpe'])
except (KeyError, AttributeError):
except (KeyError, AttributeError, IndexError):
description = self.unknown
hosts.append({'address':address,'description':description})
return hosts

View File

@ -7,7 +7,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name="netbox-scanner",
version="0.1.0",
version="0.1.1",
author='José Lopes de Oliveira Jr.',
author_email="jlojunior@gmail.com",
description="A scanner util for NetBox",