def stop(self, wait_on_join=True, join_timeout=5):
        #stop the main server
        ScalyrMonitor.stop(self,
                           wait_on_join=wait_on_join,
                           join_timeout=join_timeout)

        self.__container_checker.stop(wait_on_join, join_timeout)
 def stop(self, wait_on_join=True, join_timeout=5):
     # The order here is important.  Since our servers use self._run_state to know when to stop, we need to
     # invoke the inherited method first since that is what actually stops self._run_state.  Then we can join
     # on the threads.
     ScalyrMonitor.stop(self, wait_on_join=wait_on_join, join_timeout=join_timeout)
     if self.__extra_thread is not None:
         self.__extra_thread.stop(wait_on_join=wait_on_join, join_timeout=join_timeout)
    def run(self):
        self.__load_checkpoints()
        if isinstance(self.__api, NewApi):
            self._logger.info("Using new Evt API")
        if isinstance(self.__api, OldApi):
            self._logger.info("Evt API not detected.  Using older EventLog API")

        ScalyrMonitor.run(self)
    def run( self ):
        self.__load_checkpoints()
        if isinstance( self.__api, NewApi ):
            self._logger.info( "Using new Evt API" )
        if isinstance( self.__api, OldApi ):
            self._logger.info( "Evt API not detected.  Using older EventLog API" )

        ScalyrMonitor.run( self )
    def stop(self, wait_on_join=True, join_timeout=5):
        # stop the monitor
        ScalyrMonitor.stop(self, wait_on_join=wait_on_join, join_timeout=join_timeout)

        # stop any event monitoring
        self.__api.stop()

        # update checkpoints
        self.__update_checkpoints()
    def run(self):
        # workaround a multithread initialization problem with time.strptime
        # see: http://code-trick.com/python-bug-attribute-error-_strptime/
        # we can ignore the result
        tm = time.strptime("2016-08-29", "%Y-%m-%d")

        self.__container_checker.start()

        ScalyrMonitor.run(self)
    def stop(self, wait_on_join=True, join_timeout=5):
        #stop the monitor
        ScalyrMonitor.stop( self, wait_on_join=wait_on_join, join_timeout=join_timeout )

        # stop any event monitoring
        self.__api.stop()

        #update checkpoints
        self.__update_checkpoints()
 def stop(self, wait_on_join=True, join_timeout=5):
     # The order here is important.  Since our servers use self._run_state to know when to stop, we need to
     # invoke the inherited method first since that is what actually stops self._run_state.  Then we can join
     # on the threads.
     ScalyrMonitor.stop(self,
                        wait_on_join=wait_on_join,
                        join_timeout=join_timeout)
     if self.__extra_thread is not None:
         self.__extra_thread.stop(wait_on_join=wait_on_join,
                                  join_timeout=join_timeout)
Example #9
0
    def stop(self, wait_on_join=True, join_timeout=5):

        # output some info so we can tell from the logs when the monitor is being shut down
        self._logger.info("Garbage Monitor shutting down")

        # restore the original debug flags
        if self._monitor_all_unreachable and self._old_debug_flags is not None:
            gc.set_debug(self._old_debug_flags)

        # stop the main server
        ScalyrMonitor.stop(self, wait_on_join=wait_on_join, join_timeout=join_timeout)
Example #10
0
    def stop(self, wait_on_join=True, join_timeout=5):

        # output some info so we can tell from the logs when the monitor is being shut down
        self._logger.info( "Garbage Monitor shutting down" )

        #restore the original debug flags
        if self._monitor_all_unreachable and self._old_debug_flags is not None:
            gc.set_debug( self._old_debug_flags )

        #stop the main server
        ScalyrMonitor.stop( self, wait_on_join=wait_on_join, join_timeout=join_timeout )
    def stop(self, wait_on_join=True, join_timeout=5):
        #stop the main server
        ScalyrMonitor.stop( self, wait_on_join=wait_on_join, join_timeout=join_timeout )

        #stop the DockerLoggers
        for logger in self.docker_loggers:
            if self.__log_watcher:
                self.__log_watcher.remove_log_path( self, logger.log_path )
            logger.stop( wait_on_join, join_timeout )
            self._logger.info( "Stopping %s - %s" % (logger.name, logger.stream) )

        self.__update_checkpoints()
    def run( self ):
        self.__load_checkpoints()
        self.containers = self.__get_running_containers( self.__socket_file )
        self.docker_logs = self.__get_docker_logs( self.containers )
        self.docker_loggers = []

        #create and start the DockerLoggers
        for log in self.docker_logs:
            if self.__log_watcher:
                log['log_config'] = self.__log_watcher.add_log_config( self, log['log_config'] )
            self.docker_loggers.append( self.__create_docker_logger( log ) )

        self._logger.info( "Initialization complete.  Starting docker monitor for Scalyr" )
        ScalyrMonitor.run( self )
Example #13
0
    def stop(self, wait_on_join=True, join_timeout=5):
        #stop the main server
        ScalyrMonitor.stop(self,
                           wait_on_join=wait_on_join,
                           join_timeout=join_timeout)

        #stop the DockerLoggers
        for logger in self.docker_loggers:
            if self.__log_watcher:
                self.__log_watcher.remove_log_path(self, logger.log_path)
            logger.stop(wait_on_join, join_timeout)
            self._logger.info("Stopping %s - %s" %
                              (logger.name, logger.stream))

        self.__update_checkpoints()
Example #14
0
    def run( self ):
        # get the current debug flags
        self._old_debug_flags = gc.get_debug()

        if self._monitor_all_unreachable:
            # and set the new ones we are interested in
            gc.set_debug( gc.DEBUG_SAVEALL )

        # Output some log information here so we can tell from the logs when the garbage monitor has been reloaded
        self._logger.info( "Starting garbage monitor. Outputting max %d types" % self._max_type_dump )
        if len( self._object_dump_types ):
            self._logger.info( "\tDumping %d objects of type(s) %s" % (self._max_object_dump, str( self._object_dump_types ) ) )
        else:
            self._logger.info( "\tNot dumping individual objects." )
            
        ScalyrMonitor.run( self )
Example #15
0
    def run(self):
        self.__load_checkpoints()
        self.containers = self.__get_running_containers(self.__socket_file)
        self.docker_logs = self.__get_docker_logs(self.containers)
        self.docker_loggers = []

        #create and start the DockerLoggers
        for log in self.docker_logs:
            if self.__log_watcher:
                log['log_config'] = self.__log_watcher.add_log_config(
                    self, log['log_config'])
            self.docker_loggers.append(self.__create_docker_logger(log))

        self._logger.info(
            "Initialization complete.  Starting docker monitor for Scalyr")
        ScalyrMonitor.run(self)
Example #16
0
    def run(self):
        # get the current debug flags
        self._old_debug_flags = gc.get_debug()

        if self._monitor_all_unreachable:
            # and set the new ones we are interested in
            gc.set_debug(gc.DEBUG_SAVEALL)

        # Output some log information here so we can tell from the logs when the garbage monitor has been reloaded
        self._logger.info("Starting garbage monitor. Outputting max %d types" %
                          self._max_type_dump)
        if len(self._object_dump_types):
            self._logger.info("\tDumping %d objects of type(s) %s" %
                              (self._max_object_dump,
                               six.text_type(self._object_dump_types)))
        else:
            self._logger.info("\tNot dumping individual objects.")

        ScalyrMonitor.run(self)
Example #17
0
 def stop(self, wait_on_join=True, join_timeout=5):
     ScalyrMonitor.stop(self,
                        wait_on_join=wait_on_join,
                        join_timeout=join_timeout)
     self.log_manager.close()
     self._logger.info("Stop was called on the journald monitor")
Example #18
0
 def run(self):
     self.log_manager.set_log_watcher(self._log_watcher)
     self._checkpoint = load_checkpoints(self._checkpoint_file)
     self._reset_journal()
     ScalyrMonitor.run(self)
Example #19
0
 def stop(self, wait_on_join=True, join_timeout=5):
     # stop the main server
     ScalyrMonitor.stop(self, wait_on_join=wait_on_join, join_timeout=join_timeout)
Example #20
0
 def run(self):
     self._checkpoint = load_checkpoints(self._checkpoint_file)
     self._reset_journal()
     ScalyrMonitor.run(self)
Example #21
0
 def run(self):
     # create the SnmpEngine
     self.__snmpEngine = SnmpEngine()
     ScalyrMonitor.run(self)
    def run( self ):
        self.__load_checkpoints()

        ScalyrMonitor.run( self )