Giter VIP home page Giter VIP logo

Comments (6)

squigley avatar squigley commented on June 16, 2024

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.

mjforrester avatar mjforrester commented on June 16, 2024

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.

squigley avatar squigley commented on June 16, 2024

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.

squigley avatar squigley commented on June 16, 2024

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.

TeraHz avatar TeraHz commented on June 16, 2024

@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.

lopes avatar lopes commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.