def __init__(self): # implement the singleton class self.__monitor_dao = HANAMonitorDAO(Mc.get_hana_server(), Mc.get_hana_port(), Mc.get_hana_user(), Mc.get_hana_password()) self.__logger = Mu.get_logger(Mc.LOGGER_MONITOR_OPERATOR_ALARM)
def __init__(self): self.__os_operator = LinuxOperator() operator = HANAMonitorDAO(Mc.get_hana_server(), Mc.get_hana_port(), Mc.get_hana_user(), Mc.get_hana_password()) self.servers = self.__get_servers(operator) # self.servers = [] # move belows to config? self.path = Mc.get_agent_path()[:-len('agent.py')] self.files = [ 'agent.py', 'util.py', 'errors.py', 'config/configuration.ini', 'config/logging.ini' ]
def __init__(self): # implement the singleton class if HANAOperatorService.__instance is not None: raise MonitorDBOpError( "This class is a singleton, use HANAServerDBOperatorService.instance() instead" ) else: HANAOperatorService.__instance = self self.__monitor_dao = HANAMonitorDAO(Mc.get_hana_server(), Mc.get_hana_port(), Mc.get_hana_user(), Mc.get_hana_password()) self.__logger = Mu.get_logger(Mc.LOGGER_MONITOR_OPERATOR_DB)
def run(self): """run the thread""" operator = HANAMonitorDAO(Mc.get_hana_server(), Mc.get_hana_port(), Mc.get_hana_user(), Mc.get_hana_password()) while True: try: self.__monitoring_configurations(operator) except Exception as ex: Mu.log_warning_exc( self.__logger, "Error occurred when monitoring configuration, Error: {0}". format(ex)) time.sleep(self.__configs.get("CHECK_INTERVAL_CONFIG_INT", 300))