def __init__(self, loggerObj, agentDir, existingSessionKey):
     """ Construct the object """
     self.logger = loggerObj
     self.agentDir = agentDir
     self.mmsAgent = MmsAgent(_settings, _agentVersion,
                              platform.python_version(), _pymongoVersion,
                              _pymongoHasC,
                              platform.uname()[1], self.logger,
                              existingSessionKey)
     threading.Thread.__init__(self)
Пример #2
0
class AgentProcess(threading.Thread):
    """ The parent process - monitors agent process and checks for updates etc """
    def __init__(self, loggerObj, agentDir, existingSessionKey):
        """ Construct the object """
        self.logger = loggerObj
        self.agentDir = agentDir
        self.mmsAgent = MmsAgent(_settings, _agentVersion,
                                 platform.python_version(), _pymongoVersion,
                                 _pymongoHasC,
                                 platform.uname()[1], self.logger,
                                 existingSessionKey)
        threading.Thread.__init__(self)

    def stop(self):
        """ Stop the agent process """
        try:
            self.mmsAgent.done = True
            self.mmsAgent.stopAll()

        except Exception as fe:
            self.logger.error(traceback.format_exc(fe))

    def run(self):
        """ The agent process """
        try:
            # Start the configuration request
            confThread = ConfPullThread(_settings, self.mmsAgent)
            confThread.setName('ConfPullThread')
            confThread.start()

            hostStateMonitorThread = MonitorHostState(self.logger,
                                                      self.mmsAgent)
            hostStateMonitorThread.setName('MonitorHostState')
            hostStateMonitorThread.start()

            # Loop through and send data back to the MMS servers.
            while not self.mmsAgent.done:
                try:
                    try:
                        self.mmsAgent.sendDataToMms()

                    except Exception as e:
                        self.logger.error(traceback.format_exc(e))
                finally:
                    try:
                        time.sleep(self.mmsAgent.collectionInterval)
                    except:
                        pass

        except Exception as e:
            self.logger.error(traceback.format_exc(e))
Пример #3
0
class AgentProcess( threading.Thread ):
    """ The parent process - monitors agent process and checks for updates etc """

    def __init__( self, loggerObj, agentDir, existingSessionKey ):
        """ Construct the object """
        self.logger = loggerObj
        self.agentDir = agentDir
        self.mmsAgent = MmsAgent( _settings, _agentVersion, platform.python_version(), _pymongoVersion, _pymongoHasC, platform.uname()[1], self.logger, existingSessionKey )
        threading.Thread.__init__( self )

    def stop( self ):
        """ Stop the agent process """
        try:
            self.mmsAgent.done = True
            self.mmsAgent.stopAll()

        except Exception, fe:
            self.logger.exception( "Error stopping process" )
class AgentProcess(threading.Thread):
    """ The parent process - monitors agent process and checks for updates etc """
    def __init__(self, loggerObj, agentDir, existingSessionKey):
        """ Construct the object """
        self.logger = loggerObj
        self.agentDir = agentDir
        self.mmsAgent = MmsAgent(_settings, _agentVersion,
                                 platform.python_version(), _pymongoVersion,
                                 _pymongoHasC,
                                 platform.uname()[1], self.logger,
                                 existingSessionKey)
        threading.Thread.__init__(self)

    def stop(self):
        """ Stop the agent process """
        try:
            self.mmsAgent.done = True
            self.mmsAgent.stopAll()

        except Exception, fe:
            self.logger.error(traceback.format_exc(fe))
Пример #5
0
 def __init__( self, loggerObj, agentDir, existingSessionKey ):
     """ Construct the object """
     self.logger = loggerObj
     self.agentDir = agentDir
     self.mmsAgent = MmsAgent( _settings, _agentVersion, platform.python_version(), _pymongoVersion, _pymongoHasC, platform.uname()[1], self.logger, existingSessionKey )
     threading.Thread.__init__( self )