Package: netbox-slm
NetBox SLMNetBox SLM is a plugin for lifecycle management of software components, including versions and installations.Known IssuesWARNING: This plugin is only tested with a single NetBox version at this time.CSV/Bulk imports for SoftwareProduct, Version and Installation are currently broken (WIP)Installation GuideWhen using the Docker version of NetBox, first follow the netbox-dockerquickstartinstructions to clone the netbox-docker repo and set up thedocker-compose.override.yml.Next, follow these instructions (based on the NetBox docker variantinstructions)
to install the NetBox SLM plugin:Addnetbox_slmto thePLUGINSlist inconfiguration/plugins.py.Create aplugin_requirements.txtwithnetbox-slmas
contents.Create aDockerfile-SLMwith contents:FROM netboxcommunity/netbox:vX.Y.Z

COPY ./plugin_requirements.txt /
RUN /opt/netbox/venv/bin/pip install --no-warn-script-location -r /plugin_requirements.txtCreate adocker-compose.override.ymlwith contents:version: '3.7'
services:
  netbox:
    ports:
      - 8000:8080
    build:
      context: .
      dockerfile: Dockerfile-SLM
    image: netbox:slm
  netbox-worker:
    image: netbox:slm
  netbox-housekeeping:
    image: netbox:slmNow, build the image:docker compose build --no-cacheAnd finally, run NetBox with the SLM plugin:docker compose upReleasing GuideTo draft a release;update thenetbox_slm/__init__.pyfile to reflect the new version, then from thesrcdirectory run$ python -m build
$ twine upload dist/*On Github.com create a similar tag and version. These steps could be
automated with a github workflow.Developer Guide (local installation)Follow the steps below on your local system to run netbox and the
netbox_slm plugin in developer modeSetupThe goal below is to run all NetBox components in Docker and run a local
NetBox Django copy with auto-reload to develop the plugin pointing to
the Dockerized postgres and redis instances, basically ignoring the
netbox docker runtime server.Stepsfrom your projects directory clone the netbox repository$ git clone https://github.com/netbox-community/netbox
$ cd netboxinstall the virtual environment$ pipenv shell
$ pipenv installcreate and edit netbox/configuration.py (based on the template file) add these lines at the end of the file;DEBUG = True
SECRET_KEY = 'dummy'
DEVELOPER = True
PLUGINS = [
    'netbox_slm',
]The NetBox installation above will be used to run Django management
commands like runserver, makemigrations and migrate, which will be
explained in the next steps below;from your projects directory clone the netbox-slm repository$ git clone https://github.com/ICTU/netbox_slm
$ cd netbox_slm
$ ./start-netbox.shThis will start NetBox locally (requires Docker) and forward the redis
and postgres ports to the localhost (make sure there’s no processes
using these ports or change the dockerfiles accordingly)Note, you can also start and stop netbox by hand:$ cd netbox-docker
$ docker-compose up -dor stop the stack with$ docker-compose downto start fresh:$ docker-compose down
$ docker volume rm netbox-docker_netbox-postgres-data  # et cetera
$ docker-compose up -d --force-recreatethis will require you to re-run the migrate commando's for netbox-slm, see further down belowGo back to the netbox configuration.py file and update the postgres and
redis connection strings (username, password) to the ones the netbox
docker backend is using, for example (using default user and passwords
from the netbox docker example):<<collapsed>>

# PostgreSQL database configuration. See the Django documentation for a complete list of available parameters:
#   https://docs.djangoproject.com/en/stable/ref/settings/#databases
DATABASE = {
    'NAME': 'netbox',               # Database name
    'USER': 'netbox',               # PostgreSQL username
    'PASSWORD': 'J5brHrAXFLQSif0K', # PostgreSQL password
    'HOST': 'localhost',            # Database server
    'PORT': '',                     # Database port (leave blank for default)
    'CONN_MAX_AGE': 300,            # Max database connection age
}

# Redis database settings. Redis is used for caching and for queuing background tasks such as webhook events. A separate
# configuration exists for each. Full connection details are required in both sections, and it is strongly recommended
# to use two separate database IDs.
REDIS = {
    'tasks': {
        'HOST': 'localhost',
        'PORT': 6379,
        # Comment out `HOST` and `PORT` lines and uncomment the following if using Redis Sentinel
        # 'SENTINELS': [('mysentinel.redis.example.com', 6379)],
        # 'SENTINEL_SERVICE': 'netbox',
        'PASSWORD': 'H733Kdjndks81',
        'DATABASE': 0,
        'SSL': False,
        # Set this to True to skip TLS certificate verification
        # This can expose the connection to attacks, be careful
        # 'INSECURE_SKIP_TLS_VERIFY': False,
    },
    'caching': {
        'HOST': 'localhost',
        'PORT': 6379,
        # Comment out `HOST` and `PORT` lines and uncomment the following if using Redis Sentinel
        # 'SENTINELS': [('mysentinel.redis.example.com', 6379)],
        # 'SENTINEL_SERVICE': 'netbox',
        'PASSWORD': 'H733Kdjndks81',
        'DATABASE': 1,
        'SSL': False,
        # Set this to True to skip TLS certificate verification
        # This can expose the connection to attacks, be careful
        # 'INSECURE_SKIP_TLS_VERIFY': False,
    }
}

<<collapsed>>Now you can run commands from the netbox repository like this;$ cd netbox/netbox
$ export PYTHONPATH=../../netbox_slm/netbox_slm/  # or with the pipenv activated run `python3 setup.py develop` from the netbox_slm directory
$ python3 manage.py migrate netbox_slm
$ python3 manage.py runserver 8001Visithttp://127.0.0.1:8001in the browser to see the auto reloading
version of the netbox UI. Port 8000 is taken by the docker ran variant.Get in touchPoint of contact for this repository isMart Visser, who can be reached byopening a new issue in this repository's issue tracker.