From 2abc2dd470e9533fd8e32e9fb3c44b41fefd3cfe Mon Sep 17 00:00:00 2001 From: axiaxixixixi <306232627@qq.com> Date: Thu, 26 Sep 2024 10:08:14 +0800 Subject: [PATCH] =?UTF-8?q?gs=5Fcheckos=E6=97=B6=E9=97=B4=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E6=80=A7=E6=A3=80=E6=9F=A5=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/gs_checkos | 4 ++-- script/local/LocalCheckOS.py | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/script/gs_checkos b/script/gs_checkos index 47db86b..3297474 100644 --- a/script/gs_checkos +++ b/script/gs_checkos @@ -1002,7 +1002,7 @@ def checkTimeConsistency(): and (outputMap[node].strip().split(',')[0].strip() == str(False))): g_OSCheckOpts['A12'][2] = 'Warning' - parRes += " [%s]\n The NTPD not detected" \ + parRes += " [%s]\n Neither nptd nor chrony was detected" \ " on machine and local time is \"%s\".\n"\ % (node, outputMap[node].strip().split(',')[1].strip()) @@ -1044,7 +1044,7 @@ def checkTimeConsistency(): else: nodeValue = list(status.keys())[0].strip() keystr = outputMap[nodeValue].strip().split(',')[1].strip() - g_OSCheckOpts['A12'][3] = "\n The ntpd service is " \ + g_OSCheckOpts['A12'][3] = "\n The ntpd or chronyd service is " \ "started, local time is \"%s\"." % keystr g_OSCheckOpts['A12'][4] = "\n%s" % detail_msg diff --git a/script/local/LocalCheckOS.py b/script/local/LocalCheckOS.py index 70a2f5d..c6b0850 100644 --- a/script/local/LocalCheckOS.py +++ b/script/local/LocalCheckOS.py @@ -1507,15 +1507,10 @@ def collectNtpd(): result = p.communicate() if p.returncode != 0: # No ntpd process found - g_logger.warn("No ntpd process found, " - "try to execute chrony.") p = subprocess.Popen(["pgrep", "chronyd"], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) result = p.communicate() - if p.returncode != 0: # No chrony process found - g_logger.error("The system time synchronization process is not found. " - "Please check whether ntpd or chrony is installed in the system") if data.errormsg: data.errormsg = "%s\n%s" % (data.errormsg, result[1].strip())