Comments (6)
Ah, the issue with the setup script is the accented e character in your name, I removed that and the setup runs, but doesn't help.
# python ./setup.py
SyntaxError: Non-ASCII character '\xc3' in file ./setup.py on line 11, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
[root@simon-test netbox-scanner-master]# vi setup.py
[root@simon-test netbox-scanner-master]# python ./setup.py
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied
from netbox-scanner.
I was receiving the same error you initially created this issue to resolve. I was able to resolve it myself by editing line 200 of my previously unedited, freshly unzipped nbscanner.py script file. In your case, based on your first posting, you will need to edit your script's line 195 instead. I am unsure why our nbscanner.py scripts are different. To resolve, remove the "f" from the line.
So, the offensive line changes from:
parsing = self.parser([f'{h[0]}/32' for h in hosts])
to this instead:
parsing = self.parser(['{h[0]}/32' for h in ``hosts])
Once the file is edited, you should be able to run python3 nbscanner
or python nbscanner
. This should run successfully now and output this success message, with an install path unique to your system:
Config file was created at /home/netbox/.netbox-scanner.conf
Fill all fields before run the script again.
The installation instructions for both this utility and even for the Netbox web app leave so very much to be desired. I had to fight my way through both installations on a pretty standard Ubuntu install that meets all requirements. Regardless of that critique, I am still hopeful that both this utility and Netbox can serve my needs for an IPAM system that self discovers my network. I wish NetDisco had an IPAM component
Best wishes on your endeavors into using NetBox...luck will be required!
from netbox-scanner.
Thanks for the reply. I think the difference in line numbers was to do with one being from the tar.gz and the other from git, which may be newer. The one from git has the issue on line 200.
I made the modification you suggested, which seems to work, except now I'm having issues with it finding the nmap module, even though I have both python-nmap and nmap installed..
\# python ./nbscanner.py
Traceback (most recent call last):
File "./nbscanner.py", line 6, in <module>
from nmap import PortScanner
ImportError: No module named nmap
[root@simon-test netbox-scanner]# python3 ./nbscanner.py
Traceback (most recent call last):
File "./nbscanner.py", line 6, in <module>
from nmap import PortScanner
ImportError: cannot import name 'PortScanner'
# pip3 install python-nmap
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Requirement already satisfied: python-nmap in /usr/local/lib/python3.6/site-packages
[root@simon-test netbox-scanner]# pip3 install nmap
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Requirement already satisfied: nmap in /usr/local/lib/python3.6/site-packages
from netbox-scanner.
OK, I thought perhaps my issue was trying to run nbscanner.py instead of nbscanner, but that doesn't get me any further. That complains about missing module named ConfigParser (which I was able to install with no effect), and the same for "PortScanner", which doesn't exist as anything I can install with pip3.
I don't know enough about python/pip to keep arguing with this, I guess I'll just write my own nmap scanner shell script and import it into netbox instead.
from netbox-scanner.
@squigley I had the same issue using the pip module. remove it with pip3 uninstall python-nmap and install it manually from the release tarball https://xael.org/pages/python-nmap-en.html - that made it work for me.
from netbox-scanner.
This module will discontinued in the new version and overall script will be simplified focusing on the standar library, see #18 .
from netbox-scanner.
Related Issues (20)
- different configs for cron run HOT 1
- [Feat] Adding reverse DNS info to DNS name in NetBox HOT 2
- Version 2.0 HOT 1
- nmap: duplicated entries detected that I cannot explain HOT 3
- Compatibility to netbox 2.9 HOT 16
- KeyError HOT 2
- Netbox-scanner fails to run with error "TypeError: __init__() got an unexpected keyword argument 'ssl_verify'"
- Misleading error message HOT 1
- Traceback error on netbox 2.10.1 HOT 1
- Is there a way to have dns_name field populated instead of description? HOT 1
- Mistake in NetBoxScanner class
- netbox-scanner.py creates IP Addresses, does not show up in Netbox HOT 1
- nmap scan not iterating through subnets HOT 1
- pip install not working HOT 1
- error when executing nmap-scan.sh HOT 1
- Could not open requirements file HOT 2
- No hosts.. wrong path? HOT 3
- No hosts being imported into Netbox while running nmap-scan HOT 2
- requirements mismatch: urllib3==1.26.5 vs requests==2.23.0 HOT 1
- nothing is imported into netbox HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netbox-scanner.