{"id":16526533,"url":"https://github.com/guanana/netbox-sync-physical-hosts","last_synced_at":"2025-07-17T02:33:31.023Z","repository":{"id":41996113,"uuid":"322877141","full_name":"guanana/netbox-sync-physical-hosts","owner":"guanana","description":"Because automated source of truth can be handy sometimes ;-)","archived":false,"fork":false,"pushed_at":"2025-03-12T04:48:21.000Z","size":291,"stargazers_count":14,"open_issues_count":8,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-12T05:27:07.367Z","etag":null,"topics":["netbox","netbox-scanner","nmap-netbox","nmap-parser"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guanana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-19T15:23:28.000Z","updated_at":"2024-11-03T15:53:04.000Z","dependencies_parsed_at":"2022-09-21T11:52:39.428Z","dependency_job_id":"f4c03437-aa7e-42e1-8a4d-453d9ae0a54e","html_url":"https://github.com/guanana/netbox-sync-physical-hosts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guanana%2Fnetbox-sync-physical-hosts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guanana%2Fnetbox-sync-physical-hosts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guanana%2Fnetbox-sync-physical-hosts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guanana%2Fnetbox-sync-physical-hosts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guanana","download_url":"https://codeload.github.com/guanana/netbox-sync-physical-hosts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244771512,"owners_count":20507817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["netbox","netbox-scanner","nmap-netbox","nmap-parser"],"created_at":"2024-10-11T17:28:43.097Z","updated_at":"2025-03-21T09:30:58.910Z","avatar_url":"https://github.com/guanana.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![codecov](https://codecov.io/gh/guanana/netbox-sync-physical-hosts/branch/main/graph/badge.svg?token=AJUM01SDMX)](https://codecov.io/gh/guanana/netbox-sync-physical-hosts)\n[![Known Vulnerabilities](https://snyk.io/test/github/guanana/netbox-sync-physical-hosts/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/guanana/netbox-sync-physical-hosts?targetFile=requirements.txt)\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/guanana/netbox-sync-physical-hosts\"\u003e\n    \u003cimg src=\"images/logo.png\" alt=\"Logo\" width=\"320\" height=\"160\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003enetbox-sync-physical-hosts\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Scan your network and populate info to Netbox, fast and reliable\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/guanana/netbox-sync-physical-hosts/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/guanana/netbox-sync-physical-hosts/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003e\u003ch2 style=\"display: inline-block\"\u003eTable of Contents\u003c/h2\u003e\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#get-services\"\u003eGet Services\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#get-mac-address\"\u003eGet MAC address info\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#help\"\u003eHelp\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\nThe project is meant to be as stable as robust as possible. \nThere's a reason behind Netbox project not wanting to create a scanner, if you use Netbox it is recommended\nto be your `source of truth`. In order to make that statement true we need to make sure Netbox doesn't contain\noutdated, not acurate or not useful info. \nThis script aims to keep things as simple as possible and pre-populate info into Netbox to make your life easier.\n\nIt's recommended to first run the script pointing at a dev instance of Netbox first. This project tries to populate\ninfo in a safe way but there's never 100% certainty and things can get ugly if you run this script directly in prod\nand something goes wrong.\nBecause automated source of truth can be handy sometimes ;-)\n\n### Built With\n\n* [Python](https://www.python.org/)\n* [PyNetbox](https://github.com/digitalocean/pynetbox)\n* [python3-nmap](https://pypi.org/project/python3-nmap/)\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\nTo get a local copy up and running follow these simple steps.\n\n### Prerequisites\n\nThis script works with Netbox \u003e= 2.9 and python \u003e=3.6 \nIn order to run the software you just need to install the requirement.\n* python \u003e= 3.6\n  ```sh\n  pip install -r requirements.txt\n  ```\n\n### Installation\n\n1. Clone the repo\n   ```sh\n   git clone https://github.com/guanana/netbox-sync-physical-hosts.git\n   ```\n2. Install python packages\n  ```sh\n  pip install -r requirements.txt\n  ```\n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\nThe script can be run with multiple configuration options. \nMost of the configuration options can be overwrite using environment variables\n```buildoutcfg\n[GENERAL]\ncleanup: false\ntag: nmap-sync\n\n[NETBOX]\nnb_url: http://your-server-here:your-port-here\nnb_token: your-token-here\nnb_ignore-tls-errors: false\n\n[NMAP]\nget_mac: true\nget_services: false\nnetworks: your-networks-separated-by-comma-here ie: (192.168.4.0/24,192.168.3.0/24)\n```\n```shell\nexport NETBOX_URL=http://your-server-here:your-port-here\nexport NETBOX_TOKEN=your-token-here\nexport NETWORKS=your-networks-separated-by-comma-here\n```\n\n\n\u003c!-- Get Service --\u003e\n### Get Services\n\nBe aware that if you activate get service option `it will take between 15sec and 30sec per host` (so it can be slow)\n\n\n\u003c!-- Get Mac --\u003e\n### Get Mac address\n\nThis service is pretty fast but will only work if the scan is performed from the same subnet \nie: scanning subnet `192.168.1.0/24` from `192.168.1.2`\n\n\n\u003c!-- Get Help --\u003e\n### Help\n\n```sh\n python netbox-sync.py --help\nusage: netbox-sync.py [-h] [-c CONFIG] -u NB_URL [-l L] -p NB_TOKEN [-x] [-f] [-t TAG] -n NETWORKS [-o] [-s]\n\nArgs that start with '--' (eg. -u) can also be set in a config file (./Netbox-sync-physical-hosts/netbox-sync-physical-hosts/netbox-\nsync.conf or specified via -c). Config file syntax allows: key=value, flag=true, stuff=[a,b,c] (for details, see syntax at https://goo.gl/R74nmi). If an arg is specified\nin more than one place, then commandline values override environment variables which override config file values which override defaults.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c CONFIG, --config CONFIG\n                        Config file path\n  -u NB_URL, --nb_url NB_URL\n                        Netbox URL [env var: NETBOX_URL]\n  -l L                  log level [env var: LOG_LEVEL]\n  -p NB_TOKEN, --nb_token NB_TOKEN\n                        Token for Netbox connection [env var: NETBOX_TOKEN]\n  -x, --nb_ignore-tls-errors\n                        Ignore TLS conection errors\n  -f, --cleanup         Cleanup orphans\n  -t TAG, --tag TAG     Tag to use for device identification [env var: TAG]\n  -n NETWORKS, --networks NETWORKS\n                        Networks/Hosts to scan [env var: NETWORKS]\n  -o, --get_mac         Enable if you want the script to try to collect MAC addresses/vendor [env var: MAC_DISCOVER]\n  -s, --get_services    Enable if you want the script to discover host services [env var: SERVICE_DISCOVER]\n```\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. \nAny contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the GNU General Public License v3.0. \nSee \u003ca href=\"https://github.com/guanana/netbox-sync-physical-hosts/blob/main/LICENSE\"\u003e\u003cstrong\u003eLICENSE\u003c/strong\u003e\u003c/a\u003e for more information.\n    \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguanana%2Fnetbox-sync-physical-hosts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguanana%2Fnetbox-sync-physical-hosts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguanana%2Fnetbox-sync-physical-hosts/lists"}