Better Event rule support for scripts and add tagging #348

Closed
opened 2026-04-05 16:26:52 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @G0nz0uk on 2/14/2026

NetBox version

v4.5.2

Feature type

Change to existing functionality

Proposed functionality

Hello,

I'm not sure if this is a bug or something that webhooks do better.

I have an event rule that looks for the device status change to 'TOC' which is a new status I added.

Condition:

{
    "and": [
        {
            "attr": "status.value",
            "value": "TOC"
        }
    ]
}

It is set to use a script and not a webkook, the script is just a Python script that emails a group of people. So if any device is change to 'TOC' we get an email and showing the name of the device and it's status.

Oddly if I set it to the reverse:

{
    "and": [
        {
            "attr": "status.value",
            "value": "active"
        }
    ]
}

I started to get 100s of emails. We update our devices custom fields every hour with important data from various APIs, but I think it triggers this as a change and ignores my condition to just look for the value changing to 'active'.

Here you see nothing changed, but only custom data at the bottom, but we got an email alert because of it. My condition was just if a device changes to 'active' but it's as if it updated all of it so it fire off the event.

Image

It would be great to:

Look at the previous status and current and create an event off that for example if the devices previous state was 'TOC' and went to 'Active' then it's triggered and sends an email (script) or webhook.

Also for it to use tags, so we can great events only against certain devices with certain tags.

All this would be a game changer.

Thanks

Use case

The devices we have are in Netbox create revenue, if we set to 'TOC' (take out of charge), it emails a team to stop selling to it, if set to 'active' then start using again.

One day we want to use the webhook to send into a system to automate this.

Database changes

Don't think so

External dependencies

No response

*Originally created by @G0nz0uk on 2/14/2026* ### NetBox version v4.5.2 ### Feature type Change to existing functionality ### Proposed functionality Hello, I'm not sure if this is a bug or something that webhooks do better. I have an event rule that looks for the device status change to 'TOC' which is a new status I added. Condition: ``` { "and": [ { "attr": "status.value", "value": "TOC" } ] } ``` It is set to use a script and not a webkook, the script is just a Python script that emails a group of people. So if any device is change to 'TOC' we get an email and showing the name of the device and it's status. Oddly if I set it to the reverse: ``` { "and": [ { "attr": "status.value", "value": "active" } ] } ``` I started to get 100s of emails. We update our devices custom fields every hour with important data from various APIs, but I think it triggers this as a change and ignores my condition to just look for the value changing to 'active'. Here you see nothing changed, but only custom data at the bottom, but we got an email alert because of it. My condition was just if a device changes to 'active' but it's as if it updated all of it so it fire off the event. <img width="1048" height="633" alt="Image" src="https://github.com/user-attachments/assets/71ac118b-c383-445f-b88a-f891f2de9805" /> It would be great to: Look at the previous status and current and create an event off that for example if the devices previous state was 'TOC' and went to 'Active' then it's triggered and sends an email (script) or webhook. Also for it to use tags, so we can great events only against certain devices with certain tags. All this would be a game changer. Thanks ### Use case The devices we have are in Netbox create revenue, if we set to 'TOC' (take out of charge), it emails a team to stop selling to it, if set to 'active' then start using again. One day we want to use the webhook to send into a system to automate this. ### Database changes Don't think so ### External dependencies _No response_
MrUnknownDE added the type: featurenetboxtype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featuretype: featurenetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetboxnetbox labels 2026-04-05 16:26:56 +02:00
Sign in to join this conversation.
No Label netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox netbox type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature type: feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#348