Limit Custom Scripts to manual/event execution #191

Open
opened 2026-04-05 16:22:50 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @mburggraf on 3/8/2026

NetBox version

v4.5.4

Feature type

Change to existing functionality

Proposed functionality

It should be possible, to define if a custom script is allowed to be executed by event rule or manually.

For example you could define some new script attributes (similar to scheduling_enabled), like event_enabled and manual_enabled.
If event_enabled is set to false, the corresponding script won't appear in the drop-down menu when creating an event rule. If manual_enabled is false, there won't be any run-button in the script view.

Another way to achieve the same behavior could be, by defining different run() methods for manual and event execution, though this would break downward compatibility.

Use case

Currently every custom script can be executed manually with the "run" button, as well as being set for an event rule.

However some scripts may be specifically written to be called in case of an event, while others may require manual settings and can't be meaningfully be executed by event handler.

Database changes

Don't know, probably not.

External dependencies

No response

*Originally created by @mburggraf on 3/8/2026* ### NetBox version v4.5.4 ### Feature type Change to existing functionality ### Proposed functionality It should be possible, to define if a custom script is allowed to be executed by event rule or manually. For example you could define some new script attributes (similar to `scheduling_enabled`), like `event_enabled` and `manual_enabled`. If `event_enabled` is set to `false`, the corresponding script won't appear in the drop-down menu when creating an event rule. If `manual_enabled` is `false`, there won't be any run-button in the script view. Another way to achieve the same behavior could be, by defining different `run()` methods for manual and event execution, though this would break downward compatibility. ### Use case Currently every custom script can be executed manually with the "run" button, as well as being set for an event rule. However some scripts may be specifically written to be called in case of an event, while others may require manual settings and can't be meaningfully be executed by event handler. ### Database changes Don't know, probably not. ### External dependencies _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#191