Using Redis for a Custom Script as key value store #14334
-
Hello I'm testing to use the netbox redis database as replacement for a key value textfile. It works as stated below, but my only concern is that it might mess up internal processes in NetBox.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
As long as you're talking to a different Redis database than Netbox is using (and as you've observed, the default config uses db=0 and db=1 on localhost) then they're not going to conflict. It would probably work to create a new section in the REDIS global setting in configuration.py, but technically that's part of Netbox's own configuration. If you're writing a plugin, then PLUGINS_CONFIG would be the official place to put it. If it's only a Custom Script then there's no official place to put shared configuration settings that I know of, so do whatever works for you (even within the script itself). |
Beta Was this translation helpful? Give feedback.
As long as you're talking to a different Redis database than Netbox is using (and as you've observed, the default config uses db=0 and db=1 on localhost) then they're not going to conflict.
It would probably work to create a new section in the REDIS global setting in configuration.py, but technically that's part of Netbox's own configuration. If you're writing a plugin, then PLUGINS_CONFIG would be the official place to put it.
If it's only a Custom Script then there's no official place to put shared configuration settings that I know of, so do whatever works for you (even within the script itself).