This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| network_stuff:netbox [2020/03/14 11:34] – created jotasandoku | network_stuff:netbox [2025/07/04 16:41] (current) – jotasandoku | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| NETBOX\\ | NETBOX\\ | ||
| - | IPAM: Document | + | IPAM: (TODO: Document |
| + | * DCIM: data center infrastructure management | ||
| + | * Source of truth / Source of record: System with authoritative status for the data. Note is **single source of truth for a data domain** (eg: we can have one sst for ipam and another one for dcim | ||
| + | * data sets | ||
| + | |||
| + | |||
| + | ---- | ||
| + | === NETBOX DOCKER INSTALL (FOR LABS MAINLY) === | ||
| + | * Deploy container: [[https:// | ||
| + | * Reset password: '' | ||
| + | * Clone the demo data and run the script below to load it into the container: | ||
| + | |||
| + | |||
| + | git clone https:// | ||
| + | cd netbox-demo-data | ||
| + | |||
| + | The script wipes the existing NetBox schema, imports netbox-demo-v4.3.sql, | ||
| + | This is the script: | ||
| + | # | ||
| + | # load_netbox_demo.sh | ||
| + | # Load NetBox demo SQL data into a docker-compose NetBox stack. | ||
| + | |||
| + | set -euo pipefail | ||
| + | |||
| + | # ---------------------------------------------------------------------- | ||
| + | # Adjust these if your environment differs | ||
| + | SQL_PATH=" | ||
| + | POSTGRES_USER=" | ||
| + | POSTGRES_DB=" | ||
| + | # ---------------------------------------------------------------------- | ||
| + | |||
| + | echo " | ||
| + | docker compose up -d | ||
| + | |||
| + | # Get running container IDs | ||
| + | PG_CONTAINER=$(docker compose ps -q postgres) | ||
| + | NB_CONTAINER=$(docker compose ps -q netbox) | ||
| + | |||
| + | # Wait until Postgres accepts connections | ||
| + | echo " | ||
| + | until docker exec " | ||
| + | sleep 2 | ||
| + | done | ||
| + | echo " | ||
| + | |||
| + | # Copy SQL file into the Postgres container | ||
| + | echo " | ||
| + | docker cp " | ||
| + | |||
| + | # Drop and recreate the public schema | ||
| + | echo " | ||
| + | docker compose exec postgres \ | ||
| + | psql -U " | ||
| + | -c 'DROP SCHEMA public CASCADE; CREATE SCHEMA public;' | ||
| + | |||
| + | # Load the demo data | ||
| + | echo " | ||
| + | docker compose exec postgres \ | ||
| + | psql -U " | ||
| + | |||
| + | # Run Django migrations to align with current code | ||
| + | echo " | ||
| + | docker compose exec netbox \ | ||
| + | python / | ||
| + | |||
| + | # Restart NetBox services so they use the new data | ||
| + | echo " | ||
| + | docker compose restart netbox netbox-worker netbox-housekeeping | ||
| + | |||
| + | echo "" | ||
| + | echo "Demo data loaded successfully. Visit http:// | ||
| - | * Source of true / Source of record: System with authoritative status for the data | ||