guanana / netbox-sync-physical-hosts Goto Github PK
View Code? Open in Web Editor NEWBecause automated source of truth can be handy sometimes ;-)
License: GNU General Public License v3.0
Because automated source of truth can be handy sometimes ;-)
License: GNU General Public License v3.0
Hi there - running into a bit of an issue and hoping you can help me figure it out - it seems every time I run my config, it does indeed scan but ends up making duplicate entries. I thought it was a cleanup issue at first.
Config below
[GENERAL]
clenaup: true
tag: edison-nmap-sync
[NETBOX]
nb_url: https://netbox.somehost.com:443
nb_token: 560somenumbers
nb_ignore-tls-errors: false
[NMAP]
get_mac: true
get_services: false
networks: 10.100.0.0/24,10.100.1.0/24
Also worth mentioning - when I saw the sample config I thought clenaup was just mispelled but changing it cleanup breaks it :)
Perhaps the NMap output format has changed?
Traceback (most recent call last):
File "NetboxSync.py", line 29, in <module>
sys.exit(main(conf))
File "NetboxSync.py", line 22, in main
nmap = NmapBasic(conf.networks)
File "/home/user/netbox-sync-physical-hosts/netbox-sync-physical-hosts/modules/NmapHandler.py", line 12, in __init__
self.scan_results = self.basic_scan()
File "/home/user/netbox-sync-physical-hosts/netbox-sync-physical-hosts/modules/NmapHandler.py", line 33, in basic_scan
self.scan_results[host]["subnet"] = item
TypeError: list indices must be integers or slices, not str
[GENERAL]
clenaup: false
tag: auto-sync
[NETBOX]
nb_url: https://netbox.domain.com
nb_token: 0123456789abcdef0123456789abcdef01234567
nb_ignore-tls-errors: false
[NMAP]
get_mac = false
get_services = false
networks: 10.0.10.0/24
Version: c97575ff3bc6 (v3.5.4)
nmap -v
Starting Nmap 7.80 ( https://nmap.org ) at 2023-07-02 20:29 BST
Read data files from: /usr/bin/../share/nmap
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.02 seconds
python --version Python 3.6.13 :: Anaconda, Inc.
pip list
Package Version
------------------ ---------
aiofiles 0.8.0
aiohttp 3.8.4
aiosignal 1.2.0
asgiref 3.4.1
async-timeout 4.0.2
asynctest 0.13.0
attrs 22.2.0
certifi 2021.5.30
chardet 3.0.4
charset-normalizer 3.0.1
ConfigArgParse 1.2.3
Django 3.1.14
frozenlist 1.2.0
getmac 0.8.3
idna 2.10
idna-ssl 1.1.0
mac-vendor-lookup 0.1.12
multidict 5.2.0
pip 21.2.2
pynetbox 5.3.1
python3-nmap 1.6.0
pytz 2023.3
requests 2.25.1
setuptools 58.0.4
simplejson 3.19.1
six 1.16.0
sqlparse 0.4.4
typing_extensions 4.1.1
urllib3 1.26.16
wheel 0.37.1
yarl 1.7.2
Hello there -
First - I wanted to thank you for taking the time to make the changes that you did, I wanted to give it a try immediately.
I am running into an issue where any additional subnets after the first (192.168.0.0/24,192.168.1.0/24,192.168.9.0/24) are being ignored.
This appears correct - INFO:root:Start NMAP scan for ['192.168.0.0/24', '192.168.1.0/24']
but when it comes to write down results it seems to fail.
Additionally - the 'get_mac: false' directive seems to be ignored as I still see quite a few of these in debug -
DEBUG:getmac:Raw MAC found: None
DEBUG:getmac:Raw MAC found: None
DEBUG:getmac:Raw MAC found: None
DEBUG:getmac:Raw MAC found: None
DEBUG:getmac:Raw MAC found: None
DEBUG:getmac:Raw MAC found: None
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.