def __init__(self): self.core_agent_bin_path = None self.core_agent_bin_version = None self.core_agent_dir = '{}/{}'.format( AgentContext.instance().config.value('core_agent_dir'), AgentContext.instance().config.core_agent_full_name()) self.downloader = CoreAgentDownloader( self.core_agent_dir, AgentContext.instance().config.core_agent_full_name())
def install(): if not AgentContext.instance().config.value('monitor'): logger.info( "APM Not Launching on PID: %s - Configuration 'monitor' is not true", getpid()) return False logger.debug('APM Launching on PID: %s', getpid()) CoreAgentManager().launch() AppMetadata.report() AgentContext.socket().stop()
def launch(self): if AgentContext.instance().config.value( 'core_agent_launch') is not True: logger.debug("Not attempting to launch Core Agent " "due to 'core_agent_launch' setting.") return if self.verify() is not True: if AgentContext.instance().config.value( 'core_agent_download') is True: self.download() else: logger.debug("Not attempting to download Core Agent due " "to 'core_agent_download' setting.") if self.verify() is not True: logger.debug("Failed to verify Core Agent. " "Not launching Core Agent.") return False return self.run()
def config_file(self): path = AgentContext.instance().config.value('config_file') if path is not None: return ['--config-file', path] else: return []
def log_level(self): level = AgentContext.instance().config.value('log_level') return ['--log-level', level]
def socket_path(self): socket_path = AgentContext.instance().config.value('socket_path') return ['--socket', socket_path]
def root_url(self): return AgentContext.instance().config.value('download_url')