Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nothing is imported into netbox #40

Open
MROSSFTEK opened this issue Apr 16, 2024 · 10 comments
Open

nothing is imported into netbox #40

MROSSFTEK opened this issue Apr 16, 2024 · 10 comments

Comments

@MROSSFTEK
Copy link

im running python3 netbox-scanner.py nmap

its saying started 0 hosts.. the samples i ran and it went out and did nmap discovery , created the xml file and everything.
am i literally doing it wrong?

@andreigollo
Copy link

We tried the same. Apparently this does not work anymore even for a year the users had the same issues. Basically inmap identifes the hosts but cannot connect to netbox in any way.
The project's last change was 2 years ago, I imagine all libraries have changed , even netbox probably

@MROSSFTEK
Copy link
Author

shame.. had promise

@andreigollo
Copy link

yes , the proble seems at the connection to netbox, there we get a bad request so i guess the api has changed or something.

@MROSSFTEK
Copy link
Author

i can run the sudo ./nmap-scan.sh script.. runs.. finds what it should.. comes back with a file.. but of course it doesnt do anything
if i run python3 netbox-scanner.py i get this
Traceback (most recent call last):
File "/opt/netbox/netbox/netbox-scanner/netbox-scanner-master/netbox-scanner.py", line 15, in
argument = str(sys.argv[1])
IndexError: list index out of range

@andreigollo
Copy link

you should use python3 netbox-scanner.py nmap , but that command is already inside nmap-scan.sh script.
copy nmap-scan.sh to the same folder as netbox-scanner. We use as address = '217.0.0.1:8001'

@MROSSFTEK
Copy link
Author

so run
python3 netbox-scanner.py nmap 127.0.0.1:8001 (assuming the IP here) all in one command? i have the address of the netbox in the conf file already

@MROSSFTEK
Copy link
Author

if i run python3 netbox-scanner.py nmap what it comes back with is just
started: 0 hosts
finished: .0 +0 ~0 !0
thats all it says LOL

@andreigollo
Copy link

ok, when you run the nmap-scan.sh it creates the xml files, it calls the netbox-scanner.py and it archives the files at the end. When you run only the netbox-scanner , there are no xml files as input for it. so you must comment out the last 2 lines in nmap-scanner so the xml remain in place. After you can call netbox-scanner as oftne as you want as it gets the files

@MROSSFTEK
Copy link
Author

got it.. but.. what do i do with the XML files and how do i get it to import them into the netbox system?

@MROSSFTEK
Copy link
Author

got it!
had to put a scans folder in the root of /opt/netbox
then i changed the .sh script to move . xml files from the netbox scanner dir to that scans dir, it then runs the .py to import, then deletes the .xml files.. voila

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants