Logo vun Netbox Administration

Netbox Administration

Organisatioun
netboxlabs
netbox-administration

NetBox server administration: configuration, authentication backends (local/LDAP/SAML/OIDC), object permissions, API tokens, performance tuning, backups, upgrades, and housekeeping. Use when managing a NetBox instance rather than consuming its API.

Iwwersiicht

Editeurnetboxlabs
Repositoryskills
Skill-Nummnetbox-administration
Stären
21
Forks
4
Matgeliwwert Fichieren
5
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum netboxlabs op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Netbox Administration an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/netboxlabs/skills/tree/main/skills/netbox-administration
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/netboxlabs/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/netbox-administration .claude/skills/netbox-administration
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Netbox Administration an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Netbox Administration automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Netbox Administration net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

NetBox Administration

Your knowledge of NetBox administration may be outdated. Configuration settings, authentication backends, and permission models evolve between releases. Prefer retrieval over pre-trained knowledge.

Retrieval Sources

SourceURL / MethodUse for
Installation docshttps://netboxlabs.com/docs/netbox/installation/Setup, dependencies, upgrades
Configuration docshttps://netboxlabs.com/docs/netbox/configuration/All configuration settings
Authentication docshttps://netboxlabs.com/docs/netbox/administration/authentication/overview/LDAP, SAML, OIDC, SSO
NetBox repohttps://github.com/netbox-community/netboxSource code, release notes
NetBox MCP serverIf configured — check instance status, user permissionsVerify current config state

Use this skill when you need to configure, secure, maintain, or troubleshoot a NetBox server installation. For API consumption patterns, see netbox-api-integration.

Quick Reference

Service Management

bash
sudo systemctl restart netbox netbox-rq   # After config changes
sudo systemctl status netbox netbox-rq     # Check health

Essential Management Commands

CommandPurpose
python manage.py nbshellInteractive NetBox shell
python manage.py reindexRebuild search index
python manage.py trace_pathsRebuild cable path traces
python manage.py rebuild_prefixesRebuild prefix hierarchy
python manage.py runscriptExecute a custom script (core scripts deprecated in 4.7, removed in 5.0 — see netbox-custom-scripts)
python manage.py rebuild_config_context_cache [--force](4.7) Populate the pre-rendered config context cache; --force re-renders populated entries after writes that bypassed signals
python manage.py rebuild_ltree_paths [--check] [app.Model ...](4.7) Detect (--check, no locks) or repair stale hierarchy path/sort_path columns

Housekeeping: Since 4.4, housekeeping runs automatically via the built-in system job — remove any housekeeping cron jobs. The manual python manage.py housekeeping command is removed in 4.7; on 4.6 it still runs but emits a FutureWarning.

Key File Locations

FilePurpose
netbox/netbox/configuration.pyMain config (Python module)
netbox/netbox/ldap_config.pyLDAP settings (if used)
local_requirements.txtExtra Python packages
gunicorn.pyWSGI server config

Configuration

Configuration lives in configuration.py — a Python module. Override its path with NETBOX_CONFIGURATION env var. After changes, restart: sudo systemctl restart netbox.

Required Parameters

ParameterPurpose
ALLOWED_HOSTSFQDNs/IPs for Host header validation
DATABASESPostgreSQL connection(s)
REDISRedis config — must use separate DB IDs for tasks vs caching
SECRET_KEYDjango secret (≥50 chars, never expose)
API_TOKEN_PEPPERSPepper dict for v2 token hashing (4.5+)

Dynamic vs Static Parameters

Some parameters are dynamic — editable at Admin > System > Configuration without restart. Hard-coded values in configuration.py always take precedence over UI-set values.

Dynamic parameters include: CHANGELOG_RETENTION, CHANGELOG_RETAIN_CREATE_LAST_UPDATE (4.6 — keep each object's original create + latest update record when pruning), JOB_RETENTION, MAINTENANCE_MODE, MAX_PAGE_SIZE, BANNER_*, GRAPHQL_ENABLED, CUSTOM_VALIDATORS, PROTECTION_RULES, and others.

NetBox 4.7 configuration changes — fix these in configuration.py before upgrading:

  • SENTRY_DSN, SENTRY_SAMPLE_RATE, SENTRY_SEND_DEFAULT_PII, SENTRY_TRACES_SAMPLE_RATE are removed — set them as keys of SENTRY_CONFIG (dsn, sample_rate, ...). SENTRY_ENABLED = True with no dsn in SENTRY_CONFIG refuses to start.
  • JINJA2_FILTERS renamed JINJA_FILTERS (old name works with a DeprecationWarning until 5.0).
  • EMAIL['SERVER'] is mandatory to send mail — if omitted, sends raise InvalidMailer at send time, not at startup.
  • New WEBHOOK_DEFAULT_TIMEOUT (default 60 s) must be lower than RQ_DEFAULT_TIMEOUT or NetBox refuses to start — if you lowered RQ_DEFAULT_TIMEOUT to ≤ 60, set it explicitly.
  • New BULK_UPDATE_CHUNK_SIZE (default 5000) bounds rows per bulk UPDATE; custom-field create-with-default/delete moves to a background job above this many objects.

See references/configuration-guide.md for the complete parameter catalog.

Authentication

NetBox supports multiple authentication backends, tried in order. Configure via REMOTE_AUTH_BACKEND (string or list).

Backend Options

BackendWhen to UseConfig Location
Local (default)Small teams, no central IdPconfiguration.py (AUTH_PASSWORD_VALIDATORS)
LDAPActive Directory / OpenLDAP environmentsldap_config.py (separate file)
Remote UserReverse proxy auth (nginx/Apache)configuration.py (REMOTE_AUTH_*)
Social AuthSAML, OIDC, OAuth2 (Azure AD, Okta, Keycloak, etc.)configuration.py (SOCIAL_AUTH_*)

Common Auth Gotchas

  1. Gunicorn header stripping — gunicorn v22.0+ silently drops HTTP headers with underscores. Add header_map = dangerous to gunicorn config for remote auth headers.
  2. LOGIN_FORM_HIDDEN lockout — If SSO breaks and the login form is hidden, there's no way to log in. Must edit config and restart.
  3. Backend order matters — Backends are tried in sequence; first success wins. Ensure intentional ordering when combining LDAP + local.
  4. Client IP behind a proxy (NetBox 4.6.1+) — HTTP_CLIENT_IP_HEADERS controls which request headers determine the client IP (default ('HTTP_X_REAL_IP', 'HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR')). Set it to match your reverse proxy so IP-based token restrictions (allowed_ips) and logging see the real client address, not the proxy.
  5. LOGIN_REQUIRED is deprecated (4.6, removal in v5.0). Don't recommend it for new deployments; anonymous access is governed by DEFAULT_PERMISSIONS / EXEMPT_VIEW_PERMISSIONS.
  6. SSO library major bumps in 4.7 — social-auth-app-django 6.0 / social-auth-core 5.1. Test every SAML/OIDC backend on a non-production 4.7 instance before upgrading; keep a local-credential admin (and LOGIN_FORM_HIDDEN = False) until verified.

See references/authentication-backends.md for setup details.

Permissions

NetBox uses object-based permissions instead of Django's built-in model-level permissions.

Object Permission Model

Each ObjectPermission has:

  • Object types — which models it applies to
  • Actions — view, add, change, delete (plus custom like run)
  • Constraints — JSON-based ORM filters restricting which objects

Constraint Syntax

python
# AND — single dict
{"status": "active", "region__name": "US"}

# OR — list of dicts
[{"vid__gte": 100}, {"status": "reserved"}]

# Current user reference
{"created_by": "$user"}

# Django lookups supported: __in, __gte, __lt, __startswith, __isnull, etc.

Constraints are evaluated against the database record, not the in-memory instance. For create/change, NetBox saves in an atomic transaction then re-queries — if the constraint doesn't match, it rolls back.

Token Management

NetBox 4.5+: v2 tokens use Bearer nbt_<key>.<token> format. Plaintext is never stored (HMAC-SHA256 digest only). Requires API_TOKEN_PEPPERS in config. On 4.6.1+ the v2 plaintext token is returned exactly once, in the creation response — capture it then. v1 tokens (Token <plaintext> format): formally deprecated in 4.6, removed in v5.0. Migrate all integrations to v2 tokens before upgrading to 5.0.

NetBox 4.7+: the token field is read-only on REST create — clients can no longer choose the plaintext (any supplied value is ignored). Executing a custom script via REST requires a token with write_enabled = true. 4.7.0/4.7.1 recorded the plaintext of tokens created via ?background=true bulk requests in job results (readable by anyone who can view jobs) — run ≥4.7.3 (4.7.3 also adds branch-safe background writes and the config-context omit optimisation) and replace any token created that way.

Token features: write_enabled (read-only toggle; (4.7) also gates REST script execution), allowed_ips (IP restriction), expires, enabled (soft disable).

Critical: DEFAULT_PERMISSIONS

DEFAULT_PERMISSIONS applies to all authenticated users. The default grants token self-management. Setting custom DEFAULT_PERMISSIONS erases these defaults — you must reproduce token permissions if desired.

See references/permissions-guide.md for complete details.

Operations

Backup Checklist

  1. Database: pg_dump --username netbox netbox > netbox.sql
    • Exclude changelog for smaller backups: --exclude-table-data=core_objectchange
  2. Media: tar -czf netbox_media.tar.gz netbox/media/
  3. Config files: configuration.py, ldap_config.py, local_requirements.txt, gunicorn.py
  4. Custom scripts: SCRIPTS_ROOT directory
  5. Secrets: SECRET_KEY and API_TOKEN_PEPPERS if stored externally
  6. Restore with psql -v ON_ERROR_STOP=1 (or pg_restore --exit-on-error) and check the exit status — plain psql reports success on a partial restore. A 4.7.0 dump restored that way silently lost the ltree cascade triggers (fixed 4.7.1); after restoring or upgrading from 4.7.0, run python manage.py rebuild_ltree_paths --check.

See references/backup-restore.md for restore procedures.

Upgrade Process

  1. Review all release notes between current and target version; confirm every plugin supports the target release
  2. Back up database and media
  3. Check version compatibility (Python, PostgreSQL, Redis) against the matrix in the reference
  4. Cannot skip major versions — upgrade to latest minor of current major first
  5. Let the RQ queues drain (Admin > Background Tasks) before stopping workers
  6. Extract/checkout new version, copy config files
  7. Run sudo ./upgrade.sh
  8. Restart services: sudo systemctl restart netbox netbox-rq

NetBox 4.7: Python 3.12–3.14, PostgreSQL 15+ required (a system check aborts migrate on 14), Redis 6.0+ required, Django 6.1. The PostgreSQL ltree extension is required; migrations install it automatically if the NetBox DB user has CREATE on the database (GRANT CREATE ON DATABASE netbox TO netbox;), or a DBA can pre-install it with CREATE EXTENSION IF NOT EXISTS ltree;. The upgrade is long and effectively irreversible: the MPTT→ltree migration holds ACCESS EXCLUSIVE locks while it backfills, then rebuild_config_context_cache issues one UPDATE per device/VM — take a backup and plan a maintenance window. Queued send_webhook jobs from before the upgrade fail with TypeError, so drain queues first. Run ≥4.7.3 (4.7.0/4.7.1 token-plaintext exposure; 4.7.0 pg_dump trigger loss; 4.7.3 branch-safe background writes and config-context omit perf). NetBox 4.5–4.6: Python 3.12–3.14, PostgreSQL 14+ (14 deprecated in 4.6 — move to 15+ before 4.7), Redis 5.0+. 4.6 runs Django 6.0, 4.5 Django 5.x.

See references/upgrade-procedures.md for step-by-step instructions.

Performance Tuning

Key Parameters

ParameterDefaultImpact
CONN_MAX_AGE (in DATABASES)300Persistent DB connections; reduces overhead
MAX_PAGE_SIZE1000Caps API response size; prevents runaway queries
LOGIN_PERSISTENCEFalseIf True, causes DB write on every authenticated request
CHANGELOG_RETENTION90 daysAuto-prune core_objectchange (fastest-growing table)
RQ_DEFAULT_TIMEOUT300Background task timeout; increase for heavy scripts. (4.7) Must exceed WEBHOOK_DEFAULT_TIMEOUT
WEBHOOK_DEFAULT_TIMEOUT (4.7)60Per-request webhook timeout (1–3600 s); a webhook's own timeout field overrides it
BULK_UPDATE_CHUNK_SIZE (4.7)5000Rows per bulk UPDATE statement; lower it if large backfills hit statement_timeout (None disables chunking)

Redis: Separate DBs Required

Always use different Redis DB IDs for tasks and caching. Flushing the cache DB will destroy queued background jobs if they share the same DB.

PostgreSQL Tuning

For large deployments, tune at the PostgreSQL level:

  • shared_buffers — 25% of RAM
  • work_mem — 4-16MB depending on query complexity
  • effective_cache_size — 50-75% of RAM
  • Monitor core_objectchange table size — it grows fastest

Anti-Patterns

IssueCauseFix
v2 tokens unavailableAPI_TOKEN_PEPPERS not configuredAdd pepper dict to config
SECRET_KEY rotation breaks sessionsAll sessions/tokens invalidatedPlan migration window; users must re-authenticate
EXEMPT_VIEW_PERMISSIONS = ['*'] incompleteWildcard excludes sensitive modelsExplicitly list additional models if needed
CHANGELOG_RETENTION = 0Retains forever; DB grows unboundedSet to non-zero (default 90 days)
Read-only standby can't authSessions stored in DBUse SESSION_FILE_PATH for file-based sessions
Metrics endpoint 404METRICS_ENABLED = FalseSet to True and restart
Running NetBox 4.6.0RCE via template environment_params (CVE-2026-29514)Run ≥4.6.1; treat ExportTemplate/config-template edit rights as code-execution-grade and restrict them
Running NetBox 4.7.0/4.7.1Plaintext of tokens created via ?background=true bulk requests recorded in job resultsRun ≥4.7.3 (4.7.3 also brings branch-safe background writes and config-context omit perf); treat such tokens as exposed and replace them
NetBox won't start after 4.7 upgrade (webhook timeout error)RQ_DEFAULT_TIMEOUT ≤ 60 with the default WEBHOOK_DEFAULT_TIMEOUT = 60Set WEBHOOK_DEFAULT_TIMEOUT below RQ_DEFAULT_TIMEOUT
InvalidMailer when NetBox sends mail (4.7)EMAIL['SERVER'] not setSet EMAIL = {'SERVER': ..., ...} — Django EMAIL_* settings are no longer populated
New/edited objects missing from global search (4.7)Search index updates deferred to a background jobEnsure netbox-rq is running; a brief lag is expected (updates are synchronous only when no worker exists)
Renamed/moved region, location, etc. not reflected in descendants (4.7)Database restored from a 4.7.0 dump without ON_ERROR_STOP — ltree triggers missingUpgrade to ≥4.7.1, rebuild_ltree_paths --check, then rebuild_ltree_paths <app.model>

Version Notes

NetBox 4.7 (2026-09-02)

  • Platform: PostgreSQL 15+ with ltree, Redis 6.0+, Django 6.1. Long, effectively irreversible upgrade — see references/upgrade-procedures.md. Run ≥4.7.3 (4.7.0/4.7.1 token leak; 4.7.3 adds branch-safe background writes and the config-context omit optimisation).
  • Removed: housekeeping management command; SENTRY_DSN/SENTRY_SAMPLE_RATE/SENTRY_SEND_DEFAULT_PII/SENTRY_TRACES_SAMPLE_RATE (use SENTRY_CONFIG).
  • Config: JINJA2_FILTERS → JINJA_FILTERS; new WEBHOOK_DEFAULT_TIMEOUT, BULK_UPDATE_CHUNK_SIZE; EMAIL['SERVER'] mandatory; Django MAILERS replaces the EMAIL_* settings (plugin code reading EMAIL_HOST etc. or calling get_connection() with an explicit backend breaks).
  • Security: REST token token read-only on create; REST script execution needs a write-enabled token; custom link request context is a sanitized subset (id, path, path_info, method, GET, user — no cookies, headers, or session); URL custom fields validated against ALLOWED_URL_SCHEMES (scheme-less values stored as https://).
  • Behavior: global search index updates deferred to a background job; custom field create-with-default/delete deferred to a job above BULK_UPDATE_CHUNK_SIZE objects; config context pre-rendered and cached per device/VM (rebuild_config_context_cache).
  • Deprecated: core custom scripts (supported through 4.8, removed 5.0) and SCRIPTS_ROOT with them — see netbox-custom-scripts.
  • Install path: NetBox is published to PyPI; the Python-package install/upgrade (netbox upgrade --no-input) is experimental — not for production.

NetBox 4.6 (2026-05-05)

  • Django 6.0; PostgreSQL 14 deprecated; housekeeping command deprecated (FutureWarning); LOGIN_REQUIRED deprecated; v1 tokens deprecated (removed 5.0); v2 plaintext returned once at creation and HTTP_CLIENT_IP_HEADERS added (4.6.1+); CHANGELOG_RETAIN_CREATE_LAST_UPDATE added. Run ≥4.6.1 (CVE-2026-29514).

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Netbox Administration?

NetBox server administration: configuration, authentication backends (local/LDAP/SAML/OIDC), object permissions, API tokens, performance tuning, backups, upgrades, and housekeeping. Use when managing a NetBox instance rather than consuming its API.

Firwat Netbox Administration op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Netbox Administration besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Netbox Administration an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/netboxlabs/skills/tree/main/skills/netbox-administration an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Netbox Administration benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Netbox Administration benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Netbox Administration domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Netbox Administration gratis?

Jo. De Skill gëtt vum netboxlabs ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇