Giter VIP home page Giter VIP logo

netbox-sync-physical-hosts's People

Contributors

guanana avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

netbox-sync-physical-hosts's Issues

Duplicates

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 :)

Bug: 'TypeError: list indices must be integers or slices, not str'

Perhaps the NMap output format has changed?

Bug log output

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

config/netbox-sync.conf

[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

Env info

Netbox info

Version: c97575ff3bc6 (v3.5.4)

Nmap info

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 info

python --version Python 3.6.13 :: Anaconda, Inc.

Pip info

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

Additional subnets in configuration ignored

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

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.