From e1bc0f3eb2e0aaeaac4f3db9e86450ac661359f8 Mon Sep 17 00:00:00 2001 From: Senthil Kumar Guruswamy <75792349+sg893052@users.noreply.github.com> Date: Thu, 16 May 2024 10:55:26 +0530 Subject: [PATCH] Remove services mentioned in exclude service list for system monitoring (#18911) - Why I did it To address #18814 - How I did it Introduce exclude service list in the code to be parsed and remove the services from the system ready tracking. In this case, it is ztp.service - How to verify it show system-health sysready-status output --- src/system-health/health_checker/sysmonitor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/system-health/health_checker/sysmonitor.py b/src/system-health/health_checker/sysmonitor.py index 5312603d7365..115dbfbe9ea0 100755 --- a/src/system-health/health_checker/sysmonitor.py +++ b/src/system-health/health_checker/sysmonitor.py @@ -23,7 +23,7 @@ QUEUE_TIMEOUT = 15 TASK_STOP_TIMEOUT = 10 logger = Logger(log_identifier=SYSLOG_IDENTIFIER) - +exclude_srv_list = ['ztp.service'] #Subprocess which subscribes to STATE_DB FEATURE table for any update #and push service events to main process via queue @@ -158,6 +158,11 @@ def get_all_service_list(self): if srv in dir_list: dir_list.remove(srv) + #Remove services from exclude list Eg.ztp.service + for srv in exclude_srv_list: + if srv in dir_list: + dir_list.remove(srv) + dir_list.sort() return dir_list