alsigna / netbox-software-manager Goto Github PK
View Code? Open in Web Editor NEWNetBox Plugin to deal with Cisco IOS & XE software
License: MIT License
NetBox Plugin to deal with Cisco IOS & XE software
License: MIT License
Pypi does not reflect the new release
https://pypi.org/project/netbox-plugin-software-manager/#history
If using this to track multivendor images and you use no automated upgrade process in netbox or you have an external automated process, it would be ideal to allow the admin to disable the upgrade process links and API targets for Scheduled Tasks and Upgrade Devices.
The other option would be to enable/disable the process per platform.
NetBox 3.2.0 was just released and has a number of extension improvements.
Furthermore, a NetBox 3.2 plugin tutorial was released
When I run netbox with software manager i got this error in log:
from utilities.tables import BaseTable, ToggleColumn, ColoredLabelColumn, TagColumn gunicorn[2836854]: ImportError: cannot import name 'BaseTable' from 'utilities.tables' (/opt/netbox/netbox/utilities/tables.py)
cat /opt/netbox/netbox/utilities/tables.py
def linkify_phone(value):
"""
Render a telephone number as a hyperlink.
"""
if value is None:
return None
return f"tel:{value}"
As an FYI here is what changed that could impact or help the plugin:
If you find any issues or have any questions feel free to hit us on the slack or add a bug /issue or add to the umbrella UI issue netbox-community/netbox/issues/6797
Given the shift to multi-vendor support, in the plugin config, you should be able to provide a list of file extensions.
We could likely create another issue to set a filte extension check for each platform.
For now, we should focus on allowing the list to be edited.
As an example:
Arista: ".swi"
Cisco: ".bin"
Fortinet: ".out"
Palo Alto: no extension (might be challenging, but most use the UI)
Cumulus: ".bin"
Sonic: looks like no file extension
Juniper: I cannot remember
Opengear: ".flash"
Typing this out, we may want to allow any filename/extension. Thoughts?
I personally already run an HTTP/S container on the NetBox Host systems list all our golden firmware. Currently, I link to said URLs for each device model. I just prefer HTTP/HTTPS to download over FTP and SCP. Would you be open to a toggle to allow multiple transfer protocols?
Possible to consider adding API Key from Cisco API to get the current Image that should be installed, and possibly even download via the provided Image URLs?
Hey! would like to request an update to the plugin to run on netbox 3.7, tried to install and got the following error
(venv) user@snetbox1:/opt/netbox/netbox$ python3 manage.py migrate
Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/core/management/init.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/core/management/base.py", line 106, in wrapper
res = handle_func(*args, **kwargs)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 100, in handle
self.check(databases=[database])
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/core/management/base.py", line 485, in check
all_issues = checks.run_checks(
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/core/checks/urls.py", line 24, in check_resolver
return check_method()
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 494, in check
for pattern in self.url_patterns:
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/utils/functional.py", line 57, in get
res = instance.dict[self.name] = self.func(instance)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/utils/functional.py", line 57, in get
res = instance.dict[self.name] = self.func(instance)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 848, in exec_module
File "", line 219, in _call_with_frames_removed
File "/opt/netbox-3.7.0/netbox/netbox/urls.py", line 12, in
from netbox.plugins.urls import plugin_admin_patterns, plugin_patterns, plugin_api_patterns
File "/opt/netbox-3.7.0/netbox/netbox/plugins/urls.py", line 31, in
urlpatterns = import_string(f"{plugin_path}.urls.urlpatterns")
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/utils/module_loading.py", line 30, in import_string
return cached_import(module_path, class_name)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/django/utils/module_loading.py", line 15, in cached_import
module = import_module(module_path)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/software_manager/urls.py", line 2, in
from . import views
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/software_manager/views.py", line 20, in
from .tables import SoftwareListTable, GoldenImageListTable, UpgradeDeviceListTable, ScheduledTaskTable
File "/opt/netbox-3.7.0/venv/lib/python3.8/site-packages/software_manager/tables.py", line 5, in
from utilities.tables import BaseTable, ToggleColumn, ColoredLabelColumn, TagColumn
ImportError: cannot import name 'BaseTable' from 'utilities.tables' (/opt/netbox-3.7.0/netbox/utilities/tables.py)
This is all in one image now.
I am testing the new 0.0.4 release using pip
It looks like you have a migration issue:
/opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py migrate
🧬 loaded config '/etc/netbox/config/configuration.py'
🧬 loaded config '/etc/netbox/config/logging.py'
🧬 loaded config '/etc/netbox/config/plugins.py'
SystemCheckError: System check identified some issues:
ERRORS:
software_manager.SoftwareImage.image: (fields.E202) FileField's 'upload_to' argument must be a relative path, not an absolute path.
HINT: Remove the leading slash.
https://realpython.com/pypi-publish-python-package/
This makes adding to netbox-docker images or just plain old install on no containerized deployments so much easier.
See https://github.com/ryanmerolle/netbox-acls/blob/dev/netbox_acls/navigation.py for an example approach.
Instead of adding custom fields to the device model, you can create a new model that models host software version.
I do something similar with ACL to interface assignments. It is not 100% like your model because I have an ACL linked to only 1 host(vm, device, virtual_cluster), and than that said ACL can be assigned any interface assigned to that "host"
https://github.com/ryanmerolle/netbox-acls/blob/dev/netbox_acls/models/access_lists.py#L90-L155
I would love this model to be extended to more OS in order to track golden firmware drift.
Would you have any interest in being able to allow a user to disable the upgrade process and track software versions for more platform/NOS'?
Given standard NAPALM drivers already leveraged in NetBox and included in the netbox-docker, you could use NAPALM to get the software version from the device using the already set NAPALM user and password settings in NetBox.
With those model, more users could leverage the plugin for SoT type functionality, but leverage their existing workflows to upgrade their devices (ansible, python, salt, vendor specific platforms).
The following config values should have default config:
# Default transport method, [tfp|http]
"DEFAULT_TRANSFER_METHOD": "http",
# Log file
"UPGRADE_LOG_FILE": "/var/log/upgrade.log",
# Queue name. Check step 1 (dockerfile). Should be the same
"UPGRADE_QUEUE": "software_manager",
# Custom field name which is used for store current SW version
"CF_NAME_SW_VERSION": "sw_version",
# folder name for image storing. located in netbox media.
"IMAGE_FOLDER": "software-images",
# Threshold for non-ACK check
"UPGRADE_THRESHOLD": 2,
# Number of tries to connect to device before declare that we lost it.
"UPGRADE_MAX_ATTEMPTS_AFTER_RELOAD": 10,
# Hold timer between tries
"UPGRADE_SECONDS_BETWEEN_ATTEMPTS": 60,
You can assign this to me.
Hey guys,
I'm trying to install on my netbox (not docker) but I get error 503, does anyone have a step by step to deploy in this scenario?
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.