Synchronization of description #20543
Replies: 1 comment
-
I do a similar thing. I update descriptions of interfaces when things on the interface change (I have custom fields for transceiver type and customer base description for example). I have a event rule that triggers a custom script on create and update of an interface. try logging your "data".
Using netbox 4.4.2 (but it has been working in earlier versions, but I can't remember since when), it produces output like this for me:
So I do get some data. Oh and maybe do a full_clean() before you save() an object so the data validation gets triggered. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I need help synchronizing descriptions. I want the description of the switch interface, the connection, the patch panel, and the assigned IP address to be synchronized when they are connected. This should happen when one of the descriptions changes. I've tried using an event rule that then executes a Python script. However, this script doesn't seem to receive any data because the notification only shows "null" under "data." I've tried transferring something with and without action data, so far without success. Could you help me figure out where I'm going wrong? As a test, the script should only adjust the IP description when the interface changes so I can expand it later:
The Script: (some Infotext are in German)
from extras.scripts import Script
from dcim.models import Interface
from ipam.models import IPAddress
class SyncInterfaceIPDescription(Script):
class Meta:
name = "Sync Interface → IP Description"
description = "Synchronisiert die Beschreibung eines Interface auf zugehörige IP-Adressen."
commit_default = True
Beta Was this translation helpful? Give feedback.
All reactions