コード例 #1
0
def stopMonitorThreads(config):
    monitors = cfg.getMonitors(config)
    for key in monitors:
        monitorConfig = cfg.loadMonitorConfig(config, key)
        monitorThread = thutil.getThread(cfg.THREAD_MONITOR +
                                         monitorConfig.key)
        if monitorThread: monitorThread.stopRun()
コード例 #2
0
def startMonitorsThreads(config):
    """ 
    ===========================================================================
    Summary 
    ===========================================================================   
    
    **Args**:
        arg1
    **Returns**:
        None
    """     
    monitors = cfg.getMonitors(config)
    for key in monitors:
        monitorConfig = cfg.loadMonitorConfig(config, key)

        monitorThread = thutil.getThread(cfg.THREAD_MONITOR+monitorConfig.key)
        
        if monitorThread:
            logger.debug("Thread already running:"+monitorConfig.key)
            continue        
        
        if monitorConfig.enable:
            if monitorConfig.type == cfg.MONITOR_TYPE_HOST:
                monitorThread = monhost.MonitorHostThread(monitorConfig, th.OperationMode.NORMAL)
                monitorThread.start() 
            elif monitorConfig.type == cfg.MONITOR_TYPE_SPRINGMICROSERVICE:
                monitorThread = monmicroserv.MonitorMicroserviceThread(monitorConfig, th.OperationMode.NORMAL)
                monitorThread.start() 
            elif monitorConfig.type == cfg.MONITOR_TYPE_TOMCAT:
                monitorThread = montomcat.MonitorTomcatThread(monitorConfig, th.OperationMode.NORMAL)
                monitorThread.start()
            elif monitorConfig.type == cfg.MONITOR_TYPE_POSTGRES:
                monitorThread = monpsql.MonitorPostgresThread(monitorConfig, th.OperationMode.NORMAL)
                monitorThread.start()                
            else:
                logger.error("Invalid monitor type :"+str(monitorConfig.type))
コード例 #3
0
def startReadersThreads(config):
    """ 
    ===========================================================================
    Summary 
    ===========================================================================   
    
    **Args**:
        arg1
    **Returns**:
        None
    """     
    # Start Readers Threads    
    readers = cfg.getReaders(config)
    for key in readers:
        readerConfig = cfg.loadReaderConfig(config, key)
        readerThread = thutil.getThread(cfg.THREAD_READER+readerConfig.key)
        
        if readerThread:
            logger.debug("Thread already running:"+readerConfig.key)
            continue
        
        if readerConfig.enable:
            readerThread = reader.ReaderThread(readerConfig, th.OperationMode.NORMAL)
            readerThread.start()             
コード例 #4
0
def stopMapperThreads(config):
    readers = cfg.getReaders(config)
    for readerName in readers:
        readerConfig = cfg.loadReaderConfig(config, readerName)
        mapperThread = thutil.getThread(cfg.THREAD_MAPPER + readerConfig.key)
        if mapperThread: mapperThread.stopRun()
コード例 #5
0
def stopReaderThreads(config):
    readers = cfg.getReaders(config)
    for readerName in readers:
        readerConfig = cfg.loadReaderConfig(config, readerName)
        readerThread = thutil.getThread(cfg.THREAD_READER + readerConfig.key)
        if readerThread: readerThread.stopRun()
コード例 #6
0
def stopReader(key):
    readerThread = thutil.getThread(cfg.THREAD_READER + key)
    if readerThread: readerThread.stopRun()
コード例 #7
0
ファイル: set.py プロジェクト: abaena78/logmapper-agent
def setMonitorThreads(config, cmd, value):
    monitors = cfg.getMonitors(config)
    for key in monitors:
        monitorConfig = cfg.loadMonitorConfig(config, key)
        monitorThread = thutil.getThread(cfg.THREAD_MONITOR+monitorConfig.key)
        applyOptionInThread(monitorThread, cmd, value)
コード例 #8
0
ファイル: set.py プロジェクト: abaena78/logmapper-agent
def setReaderThreads(config, cmd, value):
    readers = cfg.getReaders(config)
    for readerName in readers:
        readerConfig = cfg.loadReaderConfig(config, readerName)
        readerThread = thutil.getThread(cfg.THREAD_READER+readerConfig.key)
        applyOptionInThread(readerThread, cmd, value)