mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Compare commits
5 Commits
4274913c1e
...
f99aebf437
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f99aebf437 | ||
![]() |
6022433a40 | ||
![]() |
878c624eaf | ||
![]() |
453ca57225 | ||
![]() |
b882fc9f67 |
@ -1,17 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=NetBox Housekeeping Service
|
|
||||||
Documentation=https://docs.netbox.dev/
|
|
||||||
After=network-online.target
|
|
||||||
Wants=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
|
|
||||||
User=netbox
|
|
||||||
Group=netbox
|
|
||||||
WorkingDirectory=/opt/netbox
|
|
||||||
|
|
||||||
ExecStart=/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py housekeeping
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# This shell script invokes NetBox's housekeeping management command, which
|
|
||||||
# intended to be run nightly. This script can be copied into your system's
|
|
||||||
# daily cron directory (e.g. /etc/cron.daily), or referenced directly from
|
|
||||||
# within the cron configuration file.
|
|
||||||
#
|
|
||||||
# If NetBox has been installed into a nonstandard location, update the paths
|
|
||||||
# below.
|
|
||||||
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py housekeeping
|
|
@ -1,13 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=NetBox Housekeeping Timer
|
|
||||||
Documentation=https://docs.netbox.dev/
|
|
||||||
After=network-online.target
|
|
||||||
Wants=network-online.target
|
|
||||||
|
|
||||||
[Timer]
|
|
||||||
OnCalendar=daily
|
|
||||||
AccuracySec=1h
|
|
||||||
Persistent=true
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
@ -1,49 +0,0 @@
|
|||||||
# Housekeeping
|
|
||||||
|
|
||||||
NetBox includes a `housekeeping` management command that should be run nightly. This command handles:
|
|
||||||
|
|
||||||
* Clearing expired authentication sessions from the database
|
|
||||||
* Deleting changelog records older than the configured [retention time](../configuration/miscellaneous.md#changelog_retention)
|
|
||||||
* Deleting job result records older than the configured [retention time](../configuration/miscellaneous.md#job_retention)
|
|
||||||
* Check for new NetBox releases (if [`RELEASE_CHECK_URL`](../configuration/miscellaneous.md#release_check_url) is set)
|
|
||||||
|
|
||||||
This command can be invoked directly, or by using the shell script provided at `/opt/netbox/contrib/netbox-housekeeping.sh`.
|
|
||||||
|
|
||||||
## Scheduling
|
|
||||||
|
|
||||||
### Using Cron
|
|
||||||
|
|
||||||
This script can be linked from your cron scheduler's daily jobs directory (e.g. `/etc/cron.daily`) or referenced directly within the cron configuration file.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
sudo ln -s /opt/netbox/contrib/netbox-housekeeping.sh /etc/cron.daily/netbox-housekeeping
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! note
|
|
||||||
On Debian-based systems, be sure to omit the `.sh` file extension when linking to the script from within a cron directory. Otherwise, the task may not run.
|
|
||||||
|
|
||||||
### Using Systemd
|
|
||||||
|
|
||||||
First, create symbolic links for the systemd service and timer files. Link the existing service and timer files from the `/opt/netbox/contrib/` directory to the `/etc/systemd/system/` directory:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ln -s /opt/netbox/contrib/netbox-housekeeping.service /etc/systemd/system/netbox-housekeeping.service
|
|
||||||
sudo ln -s /opt/netbox/contrib/netbox-housekeeping.timer /etc/systemd/system/netbox-housekeeping.timer
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, reload the systemd configuration and enable the timer to start automatically at boot:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable --now netbox-housekeeping.timer
|
|
||||||
```
|
|
||||||
|
|
||||||
Check the status of your timer by running:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo systemctl list-timers --all
|
|
||||||
```
|
|
||||||
|
|
||||||
This command will show a list of all timers, including your `netbox-housekeeping.timer`. Make sure the timer is active and properly scheduled.
|
|
||||||
|
|
||||||
That's it! Your NetBox housekeeping service is now configured to run daily using systemd.
|
|
@ -264,18 +264,6 @@ cd /opt/netbox/netbox
|
|||||||
python3 manage.py createsuperuser
|
python3 manage.py createsuperuser
|
||||||
```
|
```
|
||||||
|
|
||||||
## Schedule the Housekeeping Task
|
|
||||||
|
|
||||||
NetBox includes a `housekeeping` management command that handles some recurring cleanup tasks, such as clearing out old sessions and expired change records. Although this command may be run manually, it is recommended to configure a scheduled job using the system's `cron` daemon or a similar utility.
|
|
||||||
|
|
||||||
A shell script which invokes this command is included at `contrib/netbox-housekeeping.sh`. It can be copied to or linked from your system's daily cron task directory, or included within the crontab directly. (If installing NetBox into a nonstandard path, be sure to update the system paths within this script first.)
|
|
||||||
|
|
||||||
```shell
|
|
||||||
sudo ln -s /opt/netbox/contrib/netbox-housekeeping.sh /etc/cron.daily/netbox-housekeeping
|
|
||||||
```
|
|
||||||
|
|
||||||
See the [housekeeping documentation](../administration/housekeeping.md) for further details.
|
|
||||||
|
|
||||||
## Test the Application
|
## Test the Application
|
||||||
|
|
||||||
At this point, we should be able to run NetBox's development server for testing. We can check by starting a development instance locally.
|
At this point, we should be able to run NetBox's development server for testing. We can check by starting a development instance locally.
|
||||||
|
@ -183,13 +183,3 @@ Finally, restart the gunicorn and RQ services:
|
|||||||
```no-highlight
|
```no-highlight
|
||||||
sudo systemctl restart netbox netbox-rq
|
sudo systemctl restart netbox netbox-rq
|
||||||
```
|
```
|
||||||
|
|
||||||
## 6. Verify Housekeeping Scheduling
|
|
||||||
|
|
||||||
If upgrading from a release prior to NetBox v3.0, check that a cron task (or similar scheduled process) has been configured to run NetBox's nightly housekeeping command. A shell script which invokes this command is included at `contrib/netbox-housekeeping.sh`. It can be linked from your system's daily cron task directory, or included within the crontab directly. (If NetBox has been installed in a nonstandard path, be sure to update the system paths within this script first.)
|
|
||||||
|
|
||||||
```shell
|
|
||||||
sudo ln -s /opt/netbox/contrib/netbox-housekeeping.sh /etc/cron.daily/netbox-housekeeping
|
|
||||||
```
|
|
||||||
|
|
||||||
See the [housekeeping documentation](../administration/housekeeping.md) for further details.
|
|
||||||
|
@ -434,7 +434,7 @@ A new management command has been added: `manage.py housekeeping`. This command
|
|||||||
* Delete change log records which have surpassed the configured retention period (if configured)
|
* Delete change log records which have surpassed the configured retention period (if configured)
|
||||||
* Check for new NetBox releases (if enabled)
|
* Check for new NetBox releases (if enabled)
|
||||||
|
|
||||||
A convenience script for calling this command via an automated scheduler has been included at `/contrib/netbox-housekeeping.sh`. Please see the [housekeeping documentation](../administration/housekeeping.md) for further details.
|
A convenience script for calling this command via an automated scheduler has been included at `/contrib/netbox-housekeeping.sh`. Please see the housekeeping documentation for further details.
|
||||||
|
|
||||||
#### Custom Queue Support for Plugins ([#6651](https://github.com/netbox-community/netbox/issues/6651))
|
#### Custom Queue Support for Plugins ([#6651](https://github.com/netbox-community/netbox/issues/6651))
|
||||||
|
|
||||||
|
@ -158,7 +158,6 @@ nav:
|
|||||||
- Okta: 'administration/authentication/okta.md'
|
- Okta: 'administration/authentication/okta.md'
|
||||||
- Permissions: 'administration/permissions.md'
|
- Permissions: 'administration/permissions.md'
|
||||||
- Error Reporting: 'administration/error-reporting.md'
|
- Error Reporting: 'administration/error-reporting.md'
|
||||||
- Housekeeping: 'administration/housekeeping.md'
|
|
||||||
- Replicating NetBox: 'administration/replicating-netbox.md'
|
- Replicating NetBox: 'administration/replicating-netbox.md'
|
||||||
- NetBox Shell: 'administration/netbox-shell.md'
|
- NetBox Shell: 'administration/netbox-shell.md'
|
||||||
- Data Model:
|
- Data Model:
|
||||||
|
@ -1,8 +1,16 @@
|
|||||||
import logging
|
import logging
|
||||||
import requests
|
|
||||||
import sys
|
import sys
|
||||||
|
from datetime import timedelta
|
||||||
|
from importlib import import_module
|
||||||
|
|
||||||
|
import requests
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.core.cache import cache
|
||||||
|
from django.utils import timezone
|
||||||
|
from packaging import version
|
||||||
|
|
||||||
|
from core.models import Job, ObjectChange
|
||||||
|
from netbox.config import Config
|
||||||
from netbox.jobs import JobRunner, system_job
|
from netbox.jobs import JobRunner, system_job
|
||||||
from netbox.search.backends import search_backend
|
from netbox.search.backends import search_backend
|
||||||
from utilities.proxy import resolve_proxies
|
from utilities.proxy import resolve_proxies
|
||||||
@ -50,16 +58,23 @@ class SystemHousekeepingJob(JobRunner):
|
|||||||
if settings.DEBUG or 'test' in sys.argv:
|
if settings.DEBUG or 'test' in sys.argv:
|
||||||
return
|
return
|
||||||
|
|
||||||
# TODO: Migrate other housekeeping functions from the `housekeeping` management command.
|
|
||||||
self.send_census_report()
|
self.send_census_report()
|
||||||
|
self.clear_expired_sessions()
|
||||||
|
self.prune_changelog()
|
||||||
|
self.delete_expired_jobs()
|
||||||
|
self.check_for_new_releases()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def send_census_report():
|
def send_census_report():
|
||||||
"""
|
"""
|
||||||
Send a census report (if enabled).
|
Send a census report (if enabled).
|
||||||
"""
|
"""
|
||||||
# Skip if census reporting is disabled
|
logging.info("Reporting census data...")
|
||||||
if settings.ISOLATED_DEPLOYMENT or not settings.CENSUS_REPORTING_ENABLED:
|
if settings.ISOLATED_DEPLOYMENT:
|
||||||
|
logging.info("ISOLATED_DEPLOYMENT is enabled; skipping")
|
||||||
|
return
|
||||||
|
if not settings.CENSUS_REPORTING_ENABLED:
|
||||||
|
logging.info("CENSUS_REPORTING_ENABLED is disabled; skipping")
|
||||||
return
|
return
|
||||||
|
|
||||||
census_data = {
|
census_data = {
|
||||||
@ -76,3 +91,94 @@ class SystemHousekeepingJob(JobRunner):
|
|||||||
)
|
)
|
||||||
except requests.exceptions.RequestException:
|
except requests.exceptions.RequestException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def clear_expired_sessions():
|
||||||
|
"""
|
||||||
|
Clear any expired sessions from the database.
|
||||||
|
"""
|
||||||
|
logging.info("Clearing expired sessions...")
|
||||||
|
engine = import_module(settings.SESSION_ENGINE)
|
||||||
|
try:
|
||||||
|
engine.SessionStore.clear_expired()
|
||||||
|
logging.info("Sessions cleared.")
|
||||||
|
except NotImplementedError:
|
||||||
|
logging.warning(
|
||||||
|
f"The configured session engine ({settings.SESSION_ENGINE}) does not support "
|
||||||
|
f"clearing sessions; skipping."
|
||||||
|
)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def prune_changelog():
|
||||||
|
"""
|
||||||
|
Delete any ObjectChange records older than the configured changelog retention time (if any).
|
||||||
|
"""
|
||||||
|
logging.info("Pruning old changelog entries...")
|
||||||
|
config = Config()
|
||||||
|
if not config.CHANGELOG_RETENTION:
|
||||||
|
logging.info("No retention period specified; skipping.")
|
||||||
|
return
|
||||||
|
|
||||||
|
cutoff = timezone.now() - timedelta(days=config.CHANGELOG_RETENTION)
|
||||||
|
logging.debug(f"Retention period: {config.CHANGELOG_RETENTION} days")
|
||||||
|
logging.debug(f"Cut-off time: {cutoff}")
|
||||||
|
|
||||||
|
count = ObjectChange.objects.filter(time__lt=cutoff).delete()[0]
|
||||||
|
logging.info(f"Deleted {count} expired records")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def delete_expired_jobs():
|
||||||
|
"""
|
||||||
|
Delete any jobs older than the configured retention period (if any).
|
||||||
|
"""
|
||||||
|
logging.info("Deleting expired jobs...")
|
||||||
|
config = Config()
|
||||||
|
if not config.JOB_RETENTION:
|
||||||
|
logging.info("No retention period specified; skipping.")
|
||||||
|
return
|
||||||
|
|
||||||
|
cutoff = timezone.now() - timedelta(days=config.JOB_RETENTION)
|
||||||
|
logging.debug(f"Retention period: {config.CHANGELOG_RETENTION} days")
|
||||||
|
logging.debug(f"Cut-off time: {cutoff}")
|
||||||
|
|
||||||
|
count = Job.objects.filter(created__lt=cutoff).delete()[0]
|
||||||
|
logging.info(f"Deleted {count} expired records")
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def check_for_new_releases():
|
||||||
|
"""
|
||||||
|
Check for new releases and cache the latest release.
|
||||||
|
"""
|
||||||
|
logging.info("Checking for new releases...")
|
||||||
|
if settings.ISOLATED_DEPLOYMENT:
|
||||||
|
logging.info("ISOLATED_DEPLOYMENT is enabled; skipping")
|
||||||
|
return
|
||||||
|
if not settings.RELEASE_CHECK_URL:
|
||||||
|
logging.info("RELEASE_CHECK_URL is not set; skipping")
|
||||||
|
return
|
||||||
|
|
||||||
|
# Fetch the latest releases
|
||||||
|
logging.debug(f"Release check URL: {settings.RELEASE_CHECK_URL}")
|
||||||
|
try:
|
||||||
|
response = requests.get(
|
||||||
|
url=settings.RELEASE_CHECK_URL,
|
||||||
|
headers={'Accept': 'application/vnd.github.v3+json'},
|
||||||
|
proxies=resolve_proxies(url=settings.RELEASE_CHECK_URL)
|
||||||
|
)
|
||||||
|
response.raise_for_status()
|
||||||
|
except requests.exceptions.RequestException as exc:
|
||||||
|
logging.error(f"Error fetching release: {exc}")
|
||||||
|
return
|
||||||
|
|
||||||
|
# Determine the most recent stable release
|
||||||
|
releases = []
|
||||||
|
for release in response.json():
|
||||||
|
if 'tag_name' not in release or release.get('devrelease') or release.get('prerelease'):
|
||||||
|
continue
|
||||||
|
releases.append((version.parse(release['tag_name']), release.get('html_url')))
|
||||||
|
latest_release = max(releases)
|
||||||
|
logging.debug(f"Found {len(response.json())} releases; {len(releases)} usable")
|
||||||
|
logging.info(f"Latest release: {latest_release[0]}")
|
||||||
|
|
||||||
|
# Cache the most recent release
|
||||||
|
cache.set('latest_release', latest_release, None)
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
from django.contrib.contenttypes.models import ContentType, ContentTypeManager
|
from django.contrib.contenttypes.models import ContentType, ContentTypeManager
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
|
from netbox.plugins import PluginConfig
|
||||||
from netbox.registry import registry
|
from netbox.registry import registry
|
||||||
|
from utilities.string import title
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
'ObjectType',
|
'ObjectType',
|
||||||
@ -48,3 +50,29 @@ class ObjectType(ContentType):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
proxy = True
|
proxy = True
|
||||||
|
|
||||||
|
@property
|
||||||
|
def app_labeled_name(self):
|
||||||
|
# Override ContentType's "app | model" representation style.
|
||||||
|
return f"{self.app_verbose_name} > {title(self.model_verbose_name)}"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def app_verbose_name(self):
|
||||||
|
if model := self.model_class():
|
||||||
|
return model._meta.app_config.verbose_name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def model_verbose_name(self):
|
||||||
|
if model := self.model_class():
|
||||||
|
return model._meta.verbose_name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def model_verbose_name_plural(self):
|
||||||
|
if model := self.model_class():
|
||||||
|
return model._meta.verbose_name_plural
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_plugin_model(self):
|
||||||
|
if not (model := self.model_class()):
|
||||||
|
return # Return null if model class is invalid
|
||||||
|
return isinstance(model._meta.app_config, PluginConfig)
|
||||||
|
@ -1507,7 +1507,7 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
|||||||
tx_power = forms.IntegerField(
|
tx_power = forms.IntegerField(
|
||||||
required=False,
|
required=False,
|
||||||
label=_('Transmit power (dBm)'),
|
label=_('Transmit power (dBm)'),
|
||||||
min_value=0,
|
min_value=-40,
|
||||||
max_value=127
|
max_value=127
|
||||||
)
|
)
|
||||||
vrf_id = DynamicModelMultipleChoiceField(
|
vrf_id = DynamicModelMultipleChoiceField(
|
||||||
|
24
netbox/dcim/migrations/0209_interface_tx_power_negative.py
Normal file
24
netbox/dcim/migrations/0209_interface_tx_power_negative.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import django.core.validators
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('dcim', '0208_platform_manufacturer_uniqueness'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='interface',
|
||||||
|
name='tx_power',
|
||||||
|
field=models.SmallIntegerField(
|
||||||
|
blank=True,
|
||||||
|
null=True,
|
||||||
|
validators=[
|
||||||
|
django.core.validators.MinValueValidator(-40),
|
||||||
|
django.core.validators.MaxValueValidator(127)
|
||||||
|
]
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
@ -719,10 +719,13 @@ class Interface(ModularComponentModel, BaseInterface, CabledObjectModel, PathEnd
|
|||||||
verbose_name=('channel width (MHz)'),
|
verbose_name=('channel width (MHz)'),
|
||||||
help_text=_("Populated by selected channel (if set)")
|
help_text=_("Populated by selected channel (if set)")
|
||||||
)
|
)
|
||||||
tx_power = models.PositiveSmallIntegerField(
|
tx_power = models.SmallIntegerField(
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
validators=(MaxValueValidator(127),),
|
validators=(
|
||||||
|
MinValueValidator(-40),
|
||||||
|
MaxValueValidator(127),
|
||||||
|
),
|
||||||
verbose_name=_('transmit power (dBm)')
|
verbose_name=_('transmit power (dBm)')
|
||||||
)
|
)
|
||||||
poe_mode = models.CharField(
|
poe_mode = models.CharField(
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
|
import inspect
|
||||||
|
|
||||||
|
from django.urls import NoReverseMatch, reverse
|
||||||
|
from drf_spectacular.types import OpenApiTypes
|
||||||
|
from drf_spectacular.utils import extend_schema_field
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from core.models import ObjectType
|
from core.models import ObjectType
|
||||||
from netbox.api.serializers import BaseModelSerializer
|
from netbox.api.serializers import BaseModelSerializer
|
||||||
|
from utilities.views import get_viewname
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
'ObjectTypeSerializer',
|
'ObjectTypeSerializer',
|
||||||
@ -10,7 +16,32 @@ __all__ = (
|
|||||||
|
|
||||||
class ObjectTypeSerializer(BaseModelSerializer):
|
class ObjectTypeSerializer(BaseModelSerializer):
|
||||||
url = serializers.HyperlinkedIdentityField(view_name='extras-api:objecttype-detail')
|
url = serializers.HyperlinkedIdentityField(view_name='extras-api:objecttype-detail')
|
||||||
|
app_name = serializers.CharField(source='app_verbose_name', read_only=True)
|
||||||
|
model_name = serializers.CharField(source='model_verbose_name', read_only=True)
|
||||||
|
model_name_plural = serializers.CharField(source='model_verbose_name_plural', read_only=True)
|
||||||
|
is_plugin_model = serializers.BooleanField(read_only=True)
|
||||||
|
rest_api_endpoint = serializers.SerializerMethodField()
|
||||||
|
description = serializers.SerializerMethodField()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = ObjectType
|
model = ObjectType
|
||||||
fields = ['id', 'url', 'display', 'app_label', 'model']
|
fields = [
|
||||||
|
'id', 'url', 'display', 'app_label', 'app_name', 'model', 'model_name', 'model_name_plural',
|
||||||
|
'is_plugin_model', 'rest_api_endpoint', 'description',
|
||||||
|
]
|
||||||
|
|
||||||
|
@extend_schema_field(OpenApiTypes.STR)
|
||||||
|
def get_rest_api_endpoint(self, obj):
|
||||||
|
if not (model := obj.model_class()):
|
||||||
|
return
|
||||||
|
if viewname := get_viewname(model, action='list', rest_api=True):
|
||||||
|
try:
|
||||||
|
return reverse(viewname)
|
||||||
|
except NoReverseMatch:
|
||||||
|
return
|
||||||
|
|
||||||
|
@extend_schema_field(OpenApiTypes.STR)
|
||||||
|
def get_description(self, obj):
|
||||||
|
if not (model := obj.model_class()):
|
||||||
|
return
|
||||||
|
return inspect.getdoc(model)
|
||||||
|
@ -14,9 +14,16 @@ from utilities.proxy import resolve_proxies
|
|||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
help = "Perform nightly housekeeping tasks. (This command can be run at any time.)"
|
help = "Perform nightly housekeeping tasks [DEPRECATED]"
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
|
self.stdout.write(
|
||||||
|
"Running this command is no longer necessary: All housekeeping tasks\n"
|
||||||
|
"are addressed automatically via NetBox's built-in job scheduler. It\n"
|
||||||
|
"will be removed in a future release.",
|
||||||
|
self.style.WARNING
|
||||||
|
)
|
||||||
|
|
||||||
config = Config()
|
config = Config()
|
||||||
|
|
||||||
# Clear expired authentication sessions (essentially replicating the `clearsessions` command)
|
# Clear expired authentication sessions (essentially replicating the `clearsessions` command)
|
||||||
|
Loading…
Reference in New Issue
Block a user