ictu / netbox_slm Goto Github PK
View Code? Open in Web Editor NEWNetbox Software Lifecycle Management Extension
License: Other
Netbox Software Lifecycle Management Extension
License: Other
<class 'TypeError'>
Object of type SoftwareProductInstallation is not JSON serializable
Python version: 3.10.6
NetBox version: 3.4.5
SLM version: 1.2
Error Log
Internal Server Error: /api/plugins/slm/softwareproductinstallations/
Traceback (most recent call last):
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 56, in inner
response = get_response(request)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 220, in _get_response
response = response.render()
File "/opt/netbox/venv/lib/python3.10/site-packages/django/template/response.py", line 114, in render
self.content = self.rendered_content
File "/opt/netbox/venv/lib/python3.10/site-packages/rest_framework/response.py", line 70, in rendered_content
ret = renderer.render(self.data, accepted_media_type, context)
File "/opt/netbox/venv/lib/python3.10/site-packages/rest_framework/renderers.py", line 723, in render
context = self.get_context(data, accepted_media_type, renderer_context)
File "/opt/netbox/venv/lib/python3.10/site-packages/rest_framework/renderers.py", line 679, in get_context
'content': self.get_content(renderer, data, accepted_media_type, renderer_context),
File "/opt/netbox/venv/lib/python3.10/site-packages/rest_framework/renderers.py", line 412, in get_content
content = renderer.render(data, accepted_media_type, renderer_context)
File "/opt/netbox/venv/lib/python3.10/site-packages/rest_framework/renderers.py", line 99, in render
ret = json.dumps(
File "/opt/netbox/venv/lib/python3.10/site-packages/rest_framework/utils/json.py", line 25, in dumps
return json.dumps(*args, **kwargs)
File "/usr/lib/python3.10/json/__init__.py", line 238, in dumps
**kw).encode(obj)
File "/usr/lib/python3.10/json/encoder.py", line 201, in encode
chunks = list(chunks)
File "/usr/lib/python3.10/json/encoder.py", line 431, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/usr/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/usr/lib/python3.10/json/encoder.py", line 325, in _iterencode_list
yield from chunks
File "/usr/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/usr/lib/python3.10/json/encoder.py", line 438, in _iterencode
o = _default(o)
File "/opt/netbox/venv/lib/python3.10/site-packages/rest_framework/utils/encoders.py", line 67, in default
return super().default(obj)
File "/usr/lib/python3.10/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type SoftwareProductInstallation is not JSON serializable
You doc says:
The Netbox SLM plugin currently only works with v3.0.9 of Netbox due to backwards incompatible changes in newer version of Netbox
What are these changes?
We are very interested in such a plugin and would like to help to update and test the plugin with Netbox 3.1 and upcoming 3.2 releases.
Currently, the plugin has only been tested against release v3.4. I am currently running it successfully on 3.4.10.
When trying to run it on 3.5.7, it fails to start with the following error:
ImportError: cannot import name 'DynamicModelChoiceField' from 'utilities.forms' (/opt/netbox/netbox/utilities/forms/__init__.py)
Hello Guys, thanks for this awesome plugin.
May I ask you guys, supporting from Netbox v4.0 are on the table? If it is, do you have planned date for it?
Here is the announce from Netbox team - https://github.com/netbox-community/netbox/releases/tag/v4.0.0
Thanks in advance!
It seems relationships can only be imported based on their numeral primary key (which might makes sense as the name does not currently have a unique constraint)
Please add netbox-plugin
to your topic section so this plugin comes up on https://github.com/topics/netbox-plugin
Is it compatible with latest netbox?
Possibly get rid of Software Products Model and associate SoftwareProductVersion directly to a platform since software actually links to a platform IE it runs on top of a platform or is the platform. You could create a list view bubbling up SoftwareVersion to Platform and show software summaries.
I also recommend some rework of the model to include the below fields.
Possible models.py example
class SoftwareVersion(NetBoxModel)
platform = models.ForeignKey(to="dcim.Platform", on_delete=models.CASCADE, verbose_name="Platform")
version = models.CharField(max_length=50)
alias = models.CharField(max_length=50, blank=True, null=True)
release_date = models.DateField(null=True, blank=True, verbose_name="Release Date")
end_of_support = models.DateField(null=True, blank=True, verbose_name="End of Software Support")
documentation_url = models.URLField(blank=True, verbose_name="Documentation URL")
long_term_support = models.BooleanField(verbose_name="Long Term Support", blank=True, null=True)
release_type = models.BooleanField(verbose_name="Release Type", default=False) # Options (Pre-Release, Stable, Feature, etc)
file_checksum= models.CharField(max_length=200, blank=True, null=True)
filename = models.CharField(max_length=50, blank=True, null=True)
file_link = models.URLField(blank=True, verbose_name="File Link")
This would allow for something more similar to:
Currently, the plugin has only been tested against release v3.2.
Latest Netbox release; https://github.com/netbox-community/netbox/releases/tag/v3.4.7
The plugin to compare this to would be Nautbot's Device Lifecycle Mgmt
It would be nice to eventually expand to hardware life cycle items. I am raising this feature request for debate. I think we should button up the software lifecycle before expanding to include hardware, but I wanted to get this idea out sooner rather than later. Something like this makes sense:
class HardwareLM:
# Set model columns
device_type = models.ForeignKey(
to="dcim.DeviceType",
on_delete=models.CASCADE,
verbose_name="Device Type",
blank=True,
null=True,
)
module_type = models.ForeignKey(
to="dcim.ModuleType",
on_delete=models.CASCADE,
verbose_name="Module Type",
blank=True,
null=True,
)
inventory_item = models.CharField(verbose_name="Inventory Item Part", max_length=255, blank=True, null=True)
release_date = models.DateField(null=True, blank=True, verbose_name="Release Date")
end_of_sale = models.DateField(null=True, blank=True, verbose_name="End of Sale")
end_of_support = models.DateField(null=True, blank=True, verbose_name="End of Support")
end_of_sw_releases = models.DateField(null=True, blank=True, verbose_name="End of Software Releases")
end_of_security_patches = models.DateField(null=True, blank=True, verbose_name="End of Security Patches")
documentation_url = models.URLField(blank=True, verbose_name="Documentation URL")
comments = models.TextField(null=True, blank=True, verbose_name="Comments")
This will include:
I would also like to be able to specify a URL of the 'Storage Location'.
In the overview, the entered 'Storage Location' (default to "Link" if not given) should then be clickable with this URL.
As shown in this issue the class "NetBoxModelCSVForm" is now deprecated netbox-community/netbox#10923
Currently, the plugin has only been tested against release v3.6.x
v3.7.0 - 2023-12-29: https://github.com/netbox-community/netbox/releases/tag/v3.7.0
Hi,
would love (in comparison to other plugins) to have the ability to put the SLM on the top level menu instead below plugins.
Many other plugins already support this (as it is easier for navigation, IMHO). Should be a "standard" option for many.
Change SoftwareProductInstallation.render_type
to property, so filtering and sorting works the same throughout.
Now, the same logic is particularly reimplemented in tables.py order_type
Please add the ability to register the software license used for a software installation.
Preferably, allow for the software license to be shared among installations.
License would include:
NOTE Actual license keys should not be stored here. They should be kept in a separate secure place. A reference to that place could be included here.
I'd like to store some more information about some licenses
for example a confluence Server License:
number of licensed Users
users currently assigned
as comment: users get there license via ldap group synchronization
or for example volumelicenses:
number of licenses
users currently holding these licenses
as comment: where to find the installer
Step 1 is incorrect since Netbox 3.4.x. It should be placed in configuration/plugins.py. Please refer to https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins#step-3---enable-plugins-in-the-configuration for more information.
Allow to link installations on "VM Cluster" objects, like "Kubernetes Cluster".
Deployments or StateFulSets are not VM, but reside in a "VM Cluster" (Kubernetes)
I have Just Started Using this plugin With Netbox 3.7.5 for managing Licenses in my organisation. Everything looks good and it's a perfect fit for my needs.
I just have 2 Queries regarding this:
Hello,
When I try to add a new license for a software product. I have the following message :
Server Error
A database programming error was detected while processing this request. Common causes include the following:
Database migrations missing. When upgrading to a new NetBox release, the upgrade script must be run to apply any new database migrations.
You can run migrations manually by executing python3 manage.py migrate from the command line.
Unsupported PostgreSQL version. Ensure that PostgreSQL version 12 or later is in use.
You can check this by connecting to the database using NetBox's credentials and issuing a query for SELECT VERSION().
The complete exception is provided below:
<class 'django.db.utils.ProgrammingError'>
column "stored_location_url" of relation "netbox_slm_softwarelicense" does not exist
LINE 1: ..."name", "description", "type", "stored_location", "stored_lo...
^
Python version: 3.11.4
NetBox version: 3.6.3
Plugins:
netbox_dns: 0.19.3
netbox_slm: 1.5
However, I have the correct version of Postgres and of the plugin.
I've already seen in another issue that the problem was fixed but in my case, it doesn't work.
In advance, thank you for your answer.
Hello everyone,
I've tried to install the netbox_slm plugin. But it fails when I run bash docker-compose up -d
.
I've followed the instructions on netbox_slm README.md. Moreover, I use the 1.4 version of the plugin. I have created the following files in the netbox's repository.
plugin_requirements.txt
netbox-slm
plugins.py
PLUGINS = ["netbox_slm"]
docker-compose.override.yml
version: '3.4' # This is NOT the version of NetBox! No need to adjust :)
services:
netbox:
image: netbox:latest-plugins
ports:
- 8000:8080
build:
context: .
dockerfile: Dockerfile-Plugins
netbox-worker:
image: netbox:latest-plugins
build:
context: .
dockerfile: Dockerfile-Plugins
netbox-housekeeping:
image: netbox:latest-plugins
build:
context: .
dockerfile: Dockerfile-Plugins
Dockerfile-Plugins
FROM netboxcommunity/netbox:v3.6-2.7.0 //last version of netbox
COPY ./plugin_requirements.txt /opt/netbox/
RUN /opt/netbox/venv/bin/pip install --no-warn-script-location -r /opt/netbox/plugin_requirements.txt
# These lines are only required if your plugin has its own static files.
COPY configuration/configuration.py /etc/netbox/config/configuration.py
COPY configuration/plugins.py /etc/netbox/config/plugins.py
RUN SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
The build works.
I have the following logs :
netbox-docker-netbox-1 | **ImportError: cannot import name 'DynamicModelChoiceField'** from 'utilities.forms' (/opt/netbox/netbox/utilities/forms/__init__.py)
How can I resolve this issue ?
Add the following:
release_date = models.DateField(null=True, blank=True, verbose_name="Release Date")
end_of_support = models.DateField(null=True, blank=True, verbose_name="End of Software Support")
documentation_url = models.URLField(blank=True, verbose_name="Documentation URL")
long_term_support = models.BooleanField(verbose_name="Long Term Support", blank=True, null=True)
release_type = models.BooleanField(verbose_name="Release Type", default=False) # Options (Pre-Release, Stable, Feature, etc)
file_checksum= models.CharField(max_length=200, blank=True, null=True)
filename = models.CharField(max_length=50, blank=True, null=True)
file_link = models.URLField(blank=True, verbose_name="File Link")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.