OpenParable
Skip to content
← Back to skills

Netalertx Plugin Run Development

Development
netalertx-plugin-run-development

Netalertx Plugin Run Development is an Agent Skill for development published in the netalertx/NetAlertX repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Create and run NetAlertX plugins. Use this when asked to create plugin, run plugin, test plugin, plugin development, or execute plugin script.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/netalertx/NetAlertX/blob/HEAD/.github/skills/plugin-run-development/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/netalertx-plugin-run-development, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Plugin Development

Expected Workflow for Running Plugins

  1. Read this skill document for context and instructions.
  2. Find the plugin in front/plugins/<code_name>/.
  3. Read the plugin's config.json and script.py to understand its functionality and settings.
  4. Formulate and run the command: python3 front/plugins/<code_name>/script.py.
  5. Retrieve the result from the plugin log folder (/tmp/log/plugins/last_result.<PREF>.log) quickly, as the backend may delete it after processing.

Run a Plugin Manually

python3 front/plugins/<code_name>/script.py

Ensure sys.path includes /app/front/plugins and /app/server (as in the template).

Plugin Structure

front/plugins/<code_name>/
├── config.json      # Manifest with settings
├── script.py        # Main script
└── ...

Manifest Location

front/plugins/<code_name>/config.json

  • code_name == folder name
  • unique_prefix drives settings and filenames (e.g., ARPSCAN)

Settings Pattern

  • <PREF>_RUN: execution phase
  • <PREF>_RUN_SCHD: cron-like schedule
  • <PREF>_CMD: script path
  • <PREF>_RUN_TIMEOUT: timeout in seconds
  • <PREF>_WATCH: columns to watch for changes

Data Contract

Scripts write to /tmp/log/plugins/last_result.<PREF>.log

Important: The backend will almost immediately process this result file and delete it after ingestion. If you need to inspect the output, run the plugin and immediately retrieve the result file before the backend processes it.

Use front/plugins/plugin_helper.py:

from plugin_helper import Plugin_Objects

plugin_objects = Plugin_Objects()
plugin_objects.add_object(...)  # During processing
plugin_objects.write_result_file()  # Exactly once at end

Execution Phases

  • once: runs once at startup
  • schedule: runs on cron schedule
  • always_after_scan: runs after every scan
  • before_name_updates: runs before name resolution
  • on_new_device: runs when new device detected
  • on_notification: runs when notification triggered

Plugin Formats

FormatPurposeRuns
publisherSend notificationson_notification
dev scannerCreate/manage devicesschedule
name discoveryDiscover device namesbefore_name_updates
importerImport from servicesschedule
systemCore functionalityschedule

Starting Point

Copy from front/plugins/__template and customize.