Skip to content

Commit 8c3159d

Browse files
committed
Cleanup, readme progress
1 parent 4cb8ca3 commit 8c3159d

File tree

3 files changed

+50
-22
lines changed

3 files changed

+50
-22
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ All contributions are welcome.
55
## How to contribute
66

77
- Report bugs at https://github.com/kkthxbye-code/netbox_script_manager/issues.
8-
- Submit pull requests for issue
8+
- Submit pull requests for issues

README.md

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,76 @@
1-
# NetBox Script Manager Plugin
1+
# NetBox Script Manager
22

3-
Improved custom script support for netbox
4-
5-
6-
* Free software: MIT
7-
* Documentation: https://kkthxbye-code.github.io/netbox-plugin-script-manager/
3+
Improved custom script support for netbox. Netbox version 3.5 removed several features related to custom scripts. This plugin attempts to undo these changes and add other improvements to scripts in netbox.
84

5+
The plugin can be used in addition to the built-in script support and does not disable any netbox features.
96

107
## Features
118

12-
The features the plugin provides should be listed here.
9+
* Scripts can be stored in nested modules.
10+
* Scripts can rely on non-script module files.
11+
* Scripts are loaded from a file-system folder.
12+
* It's possible to sync scripts by pulling any git repo located in the `SCRIPT_ROOT` (WIP)
13+
* Name, group, description, task queues, comments and tags are editable in the UI.
14+
* Task queue is selectable in the UI.
15+
* Exceptions caused by errors in script files are displayed in the UI.
16+
* Log messages are saved and displayed when the script is running allowing live output for long running scripts.
17+
* It's possible to filter log lines by message and/or log level.
18+
* Script executions are listed in a tab when viewing a script.
19+
* Changelog entries are listed in a tab when viewing a finished script execution.
20+
* It's possible to save script artifacts during the execution of a script. These artifacts will show up as downloadable files.
21+
* Possibility to re-run scripts.
22+
23+
## What is not supported
24+
25+
* Reports
26+
* DataSource/DataFile
27+
* `load_json` and `load_yaml` convenience methods
28+
* `script_order` - the ordering of scripts is instead based on `group` and `weight`
1329

1430
## Compatibility
1531

1632
| NetBox Version | Plugin Version |
1733
|----------------|----------------|
18-
| 3.4 | 0.1.0 |
34+
| 3.5 | 0.1.0 |
1935

20-
## Installing
36+
## Script folder
2137

22-
For adding to a NetBox Docker setup see
23-
[the general instructions for using netbox-docker with plugins](https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins).
38+
The loading of scripts is a little different with netbox-script-manager. The `SCRIPT_ROOT` plugin setting must be set to define the path of the custom scripts, however the scripts must be located in a folder named `customscripts` in this path.
2439

25-
While this is still in development and not yet on pypi you can install with pip:
40+
A folder structure like this is required (`SCRIPT_ROOT` pointing to the `netboxscripts` folder):
2641

2742
```bash
28-
pip install git+https://github.com/kkthxbye-code/netbox_script_manager
43+
├── netboxscripts
44+
│ ├── customscripts
45+
│ │ ├── __init__.py
46+
│ │ ├── nestedmodule
47+
│ │ ├── root_script.py
48+
│ │ └── util
49+
│ └── __init__.py
2950
```
3051

31-
or by adding to your `local_requirements.txt` or `plugin_requirements.txt` (netbox-docker):
52+
The reason for requiring this layout with a `customscripts` folder is to avoid name collisions when dynamically loading scripts. It also makes it easier to clear the internal python module cache which is needed for reloading scripts.
3253

33-
```bash
34-
git+https://github.com/kkthxbye-code/netbox_script_manager
54+
## Installing
55+
56+
Add the plugin to `local_requirements.txt` or `plugin_requirements.txt` (netbox-docker):
57+
58+
```
59+
netbox-script-manager
3560
```
3661

3762
Enable the plugin in `/opt/netbox/netbox/netbox/configuration.py`,
38-
or if you use netbox-docker, your `/configuration/plugins.py` file :
63+
or if you use netbox-docker, your `/configuration/plugins.py` file:
3964

4065
```python
4166
PLUGINS = [
42-
'Script Manager'
67+
'netbox_script_manager'
4368
]
4469

4570
PLUGINS_CONFIG = {
46-
"Script Manager": {},
71+
"netbox_script_manager Manager": {
72+
"SCRIPT_ROOT": "/path/to/script/folder/",
73+
"DEFAULT_QUEUE": "high"
74+
},
4775
}
4876
```

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
"""The setup script."""
44

5-
from setuptools import setup, find_packages
5+
from setuptools import find_packages, setup
66

77
with open("README.md") as readme_file:
88
readme = readme_file.read()
99

1010
requirements = []
1111

1212
setup(
13-
author="Simon Toft",
13+
author="kkthxbye-code",
1414
author_email="festll234@gmail.com",
1515
python_requires=">=3.8",
1616
classifiers=[

0 commit comments

Comments
 (0)