diff --git a/apps/jumpserver/conf.py b/apps/jumpserver/conf.py index edfbae2c1..022ca84b0 100644 --- a/apps/jumpserver/conf.py +++ b/apps/jumpserver/conf.py @@ -282,6 +282,7 @@ class Config(dict): 'REFERER_CHECK_ENABLED': False, 'SERVER_REPLAY_STORAGE': {}, 'CONNECTION_TOKEN_ENABLED': False, + 'DISK_CHECK_ENABLED': True, } def compatible_auth_openid_of_key(self): diff --git a/apps/jumpserver/settings/custom.py b/apps/jumpserver/settings/custom.py index 9b4417ced..e6c121f94 100644 --- a/apps/jumpserver/settings/custom.py +++ b/apps/jumpserver/settings/custom.py @@ -116,4 +116,6 @@ DATETIME_DISPLAY_FORMAT = '%Y-%m-%d %H:%M:%S' TICKETS_ENABLED = CONFIG.TICKETS_ENABLED REFERER_CHECK_ENABLED = CONFIG.REFERER_CHECK_ENABLED -CONNECTION_TOKEN_ENABLED = CONFIG.CONNECTION_TOKEN_ENABLED \ No newline at end of file +CONNECTION_TOKEN_ENABLED = CONFIG.CONNECTION_TOKEN_ENABLED +DISK_CHECK_ENABLED = CONFIG.DISK_CHECK_ENABLED + diff --git a/apps/ops/tasks.py b/apps/ops/tasks.py index 8a5512f30..02cc9290e 100644 --- a/apps/ops/tasks.py +++ b/apps/ops/tasks.py @@ -132,6 +132,8 @@ def create_or_update_registered_periodic_tasks(): @shared_task @register_as_period_task(interval=3600) def check_server_performance_period(): + if not settings.DISK_CHECK_ENABLED: + return usages = get_disk_usage() uncheck_paths = ['/etc', '/boot']