|
@@ -32,6 +32,7 @@ from Model.models import Device_User, Device_Info, UidSetModel, UID_Bucket, Unus
|
|
|
Store_Meal, Lang, VodBucketModel, UnicomComboOrderInfo, UnicomDeviceInfo, AbnormalOrder, DailyReconciliation, \
|
|
|
CustomizedPush, UIDCompanySerialModel, UIDModel, LogModel, OperatingCosts, UidBucketStatistics, AppScannedSerial
|
|
|
from Object.AWS.AmazonS3Util import AmazonS3Util
|
|
|
+from Object.AWS.S3Email import S3Email
|
|
|
from Object.RedisObject import RedisObject
|
|
|
from Object.ResponseObject import ResponseObject
|
|
|
from Object.utils import LocalDateTimeUtil
|
|
@@ -796,6 +797,8 @@ class CronCollectDataView(View):
|
|
|
return self.collect_operating_costs(response)
|
|
|
elif operation == 'collectObjSize': # 定时设备s3存储量
|
|
|
return self.collect_obj_size(response)
|
|
|
+ elif operation == 'checkRequest': # 定时检查各个服的https请求
|
|
|
+ return self.check_request(response)
|
|
|
else:
|
|
|
return response.json(404)
|
|
|
|
|
@@ -1123,7 +1126,7 @@ class CronCollectDataView(View):
|
|
|
device_type=device_type_temp_dict, store_meal=store_meal_temp_dict)
|
|
|
return response.json(0)
|
|
|
except Exception as e:
|
|
|
- return response.json(500, repr(e))
|
|
|
+ return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
@staticmethod
|
|
|
def collect_operating_costs(response):
|
|
@@ -1307,6 +1310,31 @@ class CronCollectDataView(View):
|
|
|
except Exception as e:
|
|
|
LOGGER.info('统计s3信息异常:errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
+ @classmethod
|
|
|
+ def check_request(cls, response):
|
|
|
+ domain_name_list = [
|
|
|
+ 'test.zositechc.cn', 'test.push.zositechc.cn',
|
|
|
+ 'www.zositechc.cn', 'api.loocam2.cn', 'common.neutral2.cn', 'api.aiotserver.cn', 'push.zositechc.cn',
|
|
|
+ 'www.dvema.com', 'api.zositech2.com', 'api.loocam2.com', 'common.neutral2.com', '149.neutral2.com',
|
|
|
+ '365.neutral2.com', 'push.dvema.com',
|
|
|
+ 'www.zositeche.com', 'api.zositeche.com', 'api.loocam3.com', 'common.neutral3.com',
|
|
|
+ 'push.zositeche.com',
|
|
|
+ 'www.zositech.xyz', 'smart.loocam2.com'
|
|
|
+ ]
|
|
|
+ for domain_name in domain_name_list:
|
|
|
+ thread = threading.Thread(target=cls.initial_request, args=(domain_name,))
|
|
|
+ thread.start()
|
|
|
+ return response.json(0)
|
|
|
+
|
|
|
+ @staticmethod
|
|
|
+ def initial_request(domain_name):
|
|
|
+ url = 'https://{}/init/health-check'.format(domain_name)
|
|
|
+ try:
|
|
|
+ requests.post(url=url, timeout=30)
|
|
|
+ except Exception as e:
|
|
|
+ email_content = 'https请求域名{}出现异常!error_msg:{}'.format(domain_name, repr(e))
|
|
|
+ S3Email().faEmail(email_content, 'servers@ansjer.com')
|
|
|
+
|
|
|
@staticmethod
|
|
|
def collect_device_info(response):
|
|
|
try:
|