Added warning message for Token v2 with Netbox 4.5 or higher. This is according to Netbox recommendations and to warn our users.

This commit is contained in:
TheNetworkGuy
2026-02-23 10:35:41 +00:00
parent d5e3199e92
commit 7cfed2ec76
2 changed files with 74 additions and 0 deletions
+7
View File
@@ -96,6 +96,13 @@ class Sync:
nb_host,
)
return False
# Warning message for Netbox token v1 with Netbox v4.5 and higher
if not str(nb_token).startswith("nbt_") and self.nb_version >= "4.5":
logger.warning(
"Using Netbox v1 token format. "
"Consider updating to a v2 token. For more info, see "
"https://netboxlabs.com/docs/netbox/integrations/rest-api/#v1-and-v2-tokens"
)
# Set Zabbix API
if (zbx_pass or zbx_user) and zbx_token:
e = (