def __init__(self): """Initialize the class.""" self.cortx_build_info_file_path = "%s://%s" % ( CONFIG_SPEC_TYPE, CORTX_RELEASE_FACTORY_INFO) if not BuildInfo._conf_loaded: if os.path.exists(CORTX_RELEASE_FACTORY_INFO): Conf.load("cortx_build_info", self.cortx_build_info_file_path) BuildInfo._conf_loaded = True else: raise Exception("Build information file is unavailable")
def __init__(self): """Initialize the relavent datastructures.""" super(ServiceMonitor, self).__init__(self.SENSOR_NAME, self.PRIORITY) Conf.load(self.SSPL_CONFIG, "yaml:///etc/sspl.conf") self.services_to_monitor = \ Conf.get(self.SSPL_CONFIG, f"{self.SERVICEMONITOR}>{self.MONITORED_SERVICES}", []) self.not_active_services = {} self.failed_services = [] self.service_status = {} self.thread_sleep = \ int(Conf.get(self.SSPL_CONFIG, f"{self.SERVICEMONITOR}>{self.THREAD_SLEEP}", 1)) self.polling_frequency = \ int(Conf.get(self.SSPL_CONFIG, f"{self.SERVICEMONITOR}>{self.POLLING_FREQUENCY}", 30)) self.max_wait_time = \ int(Conf.get(self.SSPL_CONFIG, f"{self.SERVICEMONITOR}>{self.MAX_WAIT_TIME}", 60))