update the status of agent status online
This commit is contained in:
parent
9a448d0049
commit
64341a18bb
42
0022-udpate-agent-host-status-online.patch
Normal file
42
0022-udpate-agent-host-status-online.patch
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
From 3a4f5ea15df617babd1f7c39143d01b937bbb417 Mon Sep 17 00:00:00 2001
|
||||||
|
From: xuezhixin <xuezhixin@uniontech.com>
|
||||||
|
Date: Fri, 10 Nov 2023 10:35:43 +0800
|
||||||
|
Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E6=9C=BA=E5=9C=A8=E7=BA=BF=E7=8A=B6?=
|
||||||
|
=?UTF-8?q?=E6=80=81=E6=9B=B4=E6=96=B0?=
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
---
|
||||||
|
sysmig_agent/share.py | 15 +++++++++++++++
|
||||||
|
1 file changed, 15 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/sysmig_agent/share.py b/sysmig_agent/share.py
|
||||||
|
index 0c989a8..abbe452 100644
|
||||||
|
--- a/sysmig_agent/share.py
|
||||||
|
+++ b/sysmig_agent/share.py
|
||||||
|
@@ -30,6 +30,21 @@ def sql_abi_progress(data):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
+def sql_online_statue(statue, task_id):
|
||||||
|
+ """
|
||||||
|
+ sql:agent主机的在线状态更新
|
||||||
|
+ :param statue: 0:在线; 1:离线
|
||||||
|
+ :param task_id:agent的json内的task_id
|
||||||
|
+ :return:
|
||||||
|
+ """
|
||||||
|
+ # sql = "UPDATE agent_info SET agent_online_status = {} WHERE agent_ip = {};".format(statue, get_local_ip())
|
||||||
|
+ sql = "UPDATE agent_info SET agent_online_status = {} WHERE agent_ip = (SELECT agent_ip FROM agent_task WHERE task_id = '{}');".format(
|
||||||
|
+ statue, task_id)
|
||||||
|
+ try:
|
||||||
|
+ ret = DBHelper().execute(sql)
|
||||||
|
+ except:
|
||||||
|
+ pass
|
||||||
|
+
|
||||||
|
def sql_show_tables():
|
||||||
|
sql = "SELECT task_progress,task_data FROM agent_task WHERE agent_ip = '{}';".format(get_local_ip())
|
||||||
|
ret_sql_msg_info = DBHelper().execute(sql)
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: migration-tools
|
Name: migration-tools
|
||||||
Version: 1.0.2
|
Version: 1.0.2
|
||||||
Release: 21
|
Release: 22
|
||||||
License: MulanPSL-2.0
|
License: MulanPSL-2.0
|
||||||
Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system
|
Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
@ -28,6 +28,9 @@ Patch18: 0018-detection-of-imported-host-information-interface.patch
|
|||||||
Patch19: 0019-update-abi-result-to-database.patch
|
Patch19: 0019-update-abi-result-to-database.patch
|
||||||
Patch20: 0020-get-task-process-and-migration-stage-information.patch
|
Patch20: 0020-get-task-process-and-migration-stage-information.patch
|
||||||
Patch21: 0021-get-agent-ip-interface.patch
|
Patch21: 0021-get-agent-ip-interface.patch
|
||||||
|
Patch22: 0022-udpate-agent-host-status-online.patch
|
||||||
|
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd
|
||||||
%description
|
%description
|
||||||
@ -125,6 +128,9 @@ rm -rf /usr/bin/migration-tools
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Nov 4 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.2-22
|
||||||
|
- 0022-udpate-agent-host-status-online.patch
|
||||||
|
|
||||||
* Mon Nov 4 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.2-21
|
* Mon Nov 4 2024 xuezhixin <xuezhixin@uniontech.com> - 1.0.2-21
|
||||||
- 0021-get-agent-ip-interface.patch
|
- 0021-get-agent-ip-interface.patch
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user