diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/sqlserver/check_app_setting_data.py b/dbm-ui/backend/db_periodic_task/local_tasks/sqlserver/check_app_setting_data.py index 6d4e3bb569..17fe5b3512 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/sqlserver/check_app_setting_data.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/sqlserver/check_app_setting_data.py @@ -75,6 +75,8 @@ def fix_app_setting_data(cluster: Cluster, instance: StorageInstance, sync_mode: if status: is_fix = 1 SqlserverCheckAppSettingReport.objects.create( + bk_cloud_id=cluster.bk_cloud_id, + bk_biz_id=cluster.bk_biz_id, cluster=cluster.name, cluster_type=cluster.cluster_type, instance_host=instance.machine.ip, @@ -132,6 +134,8 @@ def add_app_setting_data(cluster: Cluster, instance: StorageInstance): msg = "fix successfully" SqlserverCheckAppSettingReport.objects.create( + bk_cloud_id=cluster.bk_cloud_id, + bk_biz_id=cluster.bk_biz_id, cluster=cluster.name, cluster_type=cluster.cluster_type, instance_host=instance.machine.ip, @@ -156,6 +160,8 @@ def check_app_setting_data(self, cluster: Cluster): if data is None: # 如果返回是空则,则大概率是访问异常,录入异常信息,跳过这次的校验 SqlserverCheckAppSettingReport.objects.create( + bk_cloud_id=cluster.bk_cloud_id, + bk_biz_id=cluster.bk_biz_id, cluster=cluster.name, cluster_type=cluster.cluster_type, instance_host=instance.machine.ip, @@ -201,6 +207,8 @@ def check_user(master_instance: StorageInstance, slave_instance: StorageInstance ) if not status: SqlserverCheckUserSyncReport.objects.create( + bk_cloud_id=cluster.bk_cloud_id, + bk_biz_id=cluster.bk_biz_id, cluster=cluster.name, cluster_type=cluster.cluster_type, instance_host=slave_instance.machine.ip, @@ -224,6 +232,8 @@ def check_job(master_instance: StorageInstance, slave_instance: StorageInstance, ) if not status: SqlserverCheckJobSyncReport.objects.create( + bk_cloud_id=cluster.bk_cloud_id, + bk_biz_id=cluster.bk_biz_id, cluster=cluster.name, cluster_type=cluster.cluster_type, instance_host=slave_instance.machine.ip, @@ -247,6 +257,8 @@ def check_link_server(master_instance: StorageInstance, slave_instance: StorageI ) if not status: SqlserverCheckLinkServerReport.objects.create( + bk_cloud_id=cluster.bk_cloud_id, + bk_biz_id=cluster.bk_biz_id, cluster=cluster.name, cluster_type=cluster.cluster_type, instance_host=slave_instance.machine.ip, @@ -265,6 +277,8 @@ def check_job_is_disabled(cluster: Cluster): if not status: # 只有异常才记录 SqlserverCheckSysJobStatuReport.objects.create( + bk_cloud_id=cluster.bk_cloud_id, + bk_biz_id=cluster.bk_biz_id, cluster=cluster.name, cluster_type=cluster.cluster_type, instance_host=instance.machine.ip, diff --git a/dbm-ui/backend/flow/utils/sqlserver/sqlserver_db_function.py b/dbm-ui/backend/flow/utils/sqlserver/sqlserver_db_function.py index a12e1720df..501a6db329 100644 --- a/dbm-ui/backend/flow/utils/sqlserver/sqlserver_db_function.py +++ b/dbm-ui/backend/flow/utils/sqlserver/sqlserver_db_function.py @@ -818,7 +818,10 @@ def check_sys_job_status(cluster: Cluster, instance: StorageInstance): """ 获取实例的系统JOB状态信息 """ - sql = "select name, enabled from msdb.dbo.sysjobs where name like 'TC_%'" + sql = ( + "select name, enabled from msdb.dbo.sysjobs where name like 'TC_%' and name " + "not in('TC_SNAPSHOT_DAY','TC_SNAPSHOT_ONE','TC_REPORT_LOAD')" + ) ret = base_sqlserver_drs(bk_cloud_id=cluster.bk_cloud_id, instances=[instance.ip_port], sqls=[sql]) msg = "" if ret[0]["error_msg"]: