Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the configuration of django-healthcheck #12

Open
jsenecal opened this issue Apr 29, 2024 · 2 comments
Open

Support the configuration of django-healthcheck #12

jsenecal opened this issue Apr 29, 2024 · 2 comments

Comments

@jsenecal
Copy link

jsenecal commented Apr 29, 2024

NetBox HealthCheck Plugin version

v0.1.4

NetBox version

v3.7.6

Feature type

New functionality

Proposed functionality

It would be great if the plugin would allow for customization of netbox-healthcheck-plugin configuration parameters.

Use case

For instance, not everyone runs Redis at 127.0.0.1 (the default value), and being allowed to configure REDIS_URL or individual HEALTH_CHECK parameters would be appreciated.

External dependencies

Support for additional parameters may have to be supported by the PluginConfig Class and netbox's settings.py.

@rizlas
Copy link

rizlas commented Oct 9, 2024

To use the Redis healthcheck, please make sure that there is a variable named REDIS_URL on django.conf.settings with the required format to connect to your redis server. For example:

REDIS_URL = "redis://localhost:6370"

From official doc. Indeed a custom setting is necessary.

@grimurd
Copy link

grimurd commented Nov 1, 2024

There is a simple fix that can be done without modifying any netbox files.

Create the file local_settings.py inside the same folder that has settings.py.

Insert the following:

import os

REDIS_URL = f"redis://{os.environ.get('REDIS_HOST', 'localhost')}:{os.environ.get('REDIS_PORT', '6379')}/{os.environ.get('REDIS_DATABASE', '1')}"

Then restart netbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants