DOCS: plugins dev

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2026-01-08 12:04:31 +11:00
parent 041dfd3e6d
commit 28dd9fb5f2
2 changed files with 107 additions and 98 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
If a Plugin supplies data to the main app it's done either vie a SQL query or via a script that updates the `last_result.log` file in the plugin log folder (`app/log/plugins/`). If a Plugin supplies data to the main app it's done either vie a SQL query or via a script that updates the `last_result.log` file in the plugin log folder (`app/log/plugins/`).
For a more in-depth overview on how plugins work check the [Plugins development docs](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md). For a more in-depth overview on how plugins work check the [Plugins development docs](./PLUGINS_DEV.md).
### Prerequisites ### Prerequisites
+11 -2
View File
@@ -41,7 +41,17 @@ If you wish to develop a plugin, please check the existing plugin structure. Onc
## ⚠ Disclaimer ## ⚠ Disclaimer
Please read the below carefully if you'd like to contribute with a plugin yourself. This documentation file might be outdated, so double-check the sample plugins as well. Please read the below carefully if you'd like to contribute with a plugin yourself. This documentation file might be outdated, so double-check the existing plugins as well.
## Plugin development quick start
1. Create a new folder for your plugin (e.g. `my_plugin`)
1. Copy the files from the `__template` folder into the newly created folder
1. Update the relevant attributes in the `config.json` file, especially `code_name` and `unique_prefix`, e.g.:
- `"code_name": "my_plugin"` - must match the folder name
- `"unique_prefix": "MYPLG"` - has to be unique, upper case letters only
1. Update the `RUN` setting to point to your script file
1. Update the rest of the `config.json` sections and implement the actual data retrieval in our python script
## Plugin file structure overview ## Plugin file structure overview
@@ -53,7 +63,6 @@ Please read the below carefully if you'd like to contribute with a plugin yourse
| `config.json` | yes | Contains the plugin configuration (manifest) including the settings available to the user. | | `config.json` | yes | Contains the plugin configuration (manifest) including the settings available to the user. |
| `script.py` | no | The Python script itself. You may call any valid linux command. | | `script.py` | no | The Python script itself. You may call any valid linux command. |
| `last_result.<prefix>.log` | no | The file used to interface between NetAlertX and the plugin. Required for a script plugin if you want to feed data into the app. Stored in the `/api/log/plugins/` | | `last_result.<prefix>.log` | no | The file used to interface between NetAlertX and the plugin. Required for a script plugin if you want to feed data into the app. Stored in the `/api/log/plugins/` |
| `script.log` | no | Logging output (recommended) |
| `README.md` | yes | Any setup considerations or overview | | `README.md` | yes | Any setup considerations or overview |
More on specifics below. More on specifics below.