monitorconfig
This commit is contained in:
@@ -62,12 +62,12 @@ def create_device_service(data):
|
||||
if existing_ip:
|
||||
raise DeviceIPAlreadyExistsException(data["ip_address"])
|
||||
|
||||
# 4. Insert DB
|
||||
new_device = insert_device(data)
|
||||
# 4. Insert DB (trả về thiết bị và cấu hình giám sát mặc định vừa tạo)
|
||||
new_device, monitor_config = insert_device(data)
|
||||
|
||||
# 5. Kích hoạt Job giám sát trên Background Scheduler
|
||||
# Truyền kèm thông tin cấu hình mặc định (enable_ping=True, v.v...)
|
||||
add_device_monitoring_job(new_device["id"], None)
|
||||
# Truyền kèm cấu hình giám sát mặc định thay vì None để Scheduler lập lịch
|
||||
add_device_monitoring_job(new_device["id"], monitor_config)
|
||||
|
||||
return new_device
|
||||
|
||||
|
||||
Reference in New Issue
Block a user