def __init__(self, **kwargs): """Class constructor. Parameters ---------- kwargs Arguments for the parent class constructor. """ super().__init__(**kwargs, tag="Master") self.integrity_control = {} self.handler_class = MasterHandler try: self.task_pool = ProcessPoolExecutor(max_workers=min( os.cpu_count(), self.cluster_items['intervals']['master'] ['process_pool_size'])) # Handle exception when the user running Wazuh cannot access /dev/shm except (FileNotFoundError, PermissionError): self.logger.warning( "In order to take advantage of Wazuh 4.3.0 cluster improvements, the directory '/dev/shm' must be " "accessible by the 'wazuh' user. Check that this file has permissions to be accessed by all users. " "Changing the file permissions to 777 will solve this issue.") self.logger.warning( "The Wazuh cluster will be run without the improvements added in Wazuh 4.3.0 and higher versions." ) self.task_pool = None self.integrity_already_executed = [] self.dapi = dapi.APIRequestQueue(server=self) self.sendsync = dapi.SendSyncRequestQueue(server=self) self.tasks.extend( [self.dapi.run, self.sendsync.run, self.file_status_update]) # pending API requests waiting for a response self.pending_api_requests = {}
def __init__(self, **kwargs): super().__init__(**kwargs, tag="Master") self.integrity_control = {} self.tasks.append(self.file_status_update) self.handler_class = MasterHandler self.dapi = dapi.APIRequestQueue(server=self) self.sendsync = dapi.SendSyncRequestQueue(server=self) self.tasks.extend([self.dapi.run, self.sendsync.run]) # pending API requests waiting for a response self.pending_api_requests = {}
def __init__(self, node: server.AbstractServer, **kwargs): """Class constructor. Parameters ---------- node : AbstractServer, AbstractClientManager object The server/worker object running in the cluster. kwargs Arguments for the parent class constructor. """ super().__init__(node=node, **kwargs) self.handler_class = LocalServerHandlerMaster self.dapi = dapi.APIRequestQueue(server=self) self.sendsync = dapi.SendSyncRequestQueue(server=self) self.tasks.extend([self.dapi.run, self.sendsync.run])
def __init__(self, node: server.AbstractServer, **kwargs): super().__init__(node=node, **kwargs) self.handler_class = LocalServerHandlerMaster self.dapi = dapi.APIRequestQueue(server=self) self.sendsync = dapi.SendSyncRequestQueue(server=self) self.tasks.extend([self.dapi.run, self.sendsync.run])