コード例 #1
0
    def __init__(self, name, inEventQueue, outQueue, config_dict=None, number=0, checkpoint=None):
        '''The constructor.
        '''
        EventAnalyzer.__init__(self, name, inEventQueue, outQueue, config_dict, number, checkpoint)

        self.severity = "W"
        self.recommendation = "Diagnose the problem that caused the threshold to be reached or exceeded. "
        self.alert_id = 'THRESH01'

        # Get the list of ras events that have threshold counts
        self.msgIDs, self.msgidService, self.msgidCount, self.msgidPeriod = get_eventList()

        for msgID in self.msgIDs:
            registry.get_logger().debug('msgId = ' + msgID)

        # define query for count with no period specified
        eventTable = self.appendSchema('tbgqeventlog')
        self.count_query = "select count(*) from " + eventTable + " where msg_id = ? and location LOC and serialnumber SN and event_time <= ?"
        self.count_query2 = "select sum(bigint(count)) from " + eventTable + " where msg_id = ? and location LOC and serialnumber SN and event_time <= ?"

        # define query for count exceeded with period specified
        self.period_query = "select count(*) from " + eventTable + " where msg_id = ? and location LOC and serialnumber SN and event_time <= ? and event_time > (timestamp('MYTIME') - PERIOD)"
        self.period_query2 = "select sum(bigint(count)) from " + eventTable + " where msg_id = ? and location LOC and serialnumber SN and event_time <= ? and event_time > (timestamp('MYTIME') - PERIOD)"

        # the number of consecutive periods that the threshold has to exceed
        self.msgidConsecutivePeriods = dict()
        self.msgidConsecutivePeriods['0008002F'] = 7
        self.msgidConsecutivePeriods['00080030'] = 3
        
        return
コード例 #2
0
ファイル: event_analyzer.py プロジェクト: ppjsand/pyteal
 def __init__(self, name, inQueue, outQueue, config_dict=None, number=0):
     '''The constructor.'''
     get_logger().debug('Creating GEAR event analyzer named {0}'.format(name))
     
     self.engine = engine_factory(name, config_dict, event_input=True, number=number, send_alert=self.send_alert)
     EventAnalyzer.__init__(self, name, inQueue, outQueue, config_dict, number, checkpoint=self.engine.checkpoint)
     return
コード例 #3
0
ファイル: event_analyzer_test.py プロジェクト: ppjsand/pyteal
 def __init__(self, name, inQueues, outQueue, config_dict=None, number=0):
     '''The constructor.'''
     get_logger().debug('metadata = %s', config_dict['events_metadata'])
     # TODO: Should really parse by comma into list 
     #self.event_meta = EventsMetadata([config_dict['events_metadata']])
     # Dummy Analysis info
     self.ai1 = AnalysisInfo('location_test')
     self.ai1.add_event_info('Example0', 1, 2, 3)
     self.ai1.add_event_info('Example1', 3, 3, 5)
     self.ai1.add_event_info('Example2', 3, None, None)        
     self.ai1.add_event_info('Example3', 3, None, None) 
     self.ai1.add_event_info('Example4', 3, None, None) 
     self.ai1.add_event_info('Example5', 3, None, None) 
     # TODO: Handle alert metadata 
     if 'mode' in config_dict:
         self.mode = config_dict['mode']
     else:
         self.mode = POOL_MODE_OCCURRED
     if 'initial_pool_duration' in config_dict:
         self.duration = int(config_dict['initial_pool_duration'])
         get_logger().debug('Duration override %s', str(self.duration))
     else:
         self.duration = 20
     self.pool = IncidentPool.new_pool(self.mode, self.duration, None, self.close_callback)
     # TODO: creation of alerts
     self.count = 0  # start with 1
     get_logger().debug('Creating SimpleEventAnalyzerAllAlert')
     EventAnalyzer.__init__(self, name, inQueues, outQueue, config_dict=config_dict, number=number)
     return
コード例 #4
0
    def __init__(self,
                 name,
                 inEventQueue,
                 outQueue,
                 config_dict=None,
                 number=0,
                 checkpoint=None):
        '''The constructor.
        '''
        EventAnalyzer.__init__(self, name, inEventQueue, outQueue, config_dict,
                               number, checkpoint)

        self.severity = "F"
        self.recommendation = "Diagnose the fatal RAS event that ended the job. "

        # ring buffer to remember jobs ending due to fatal errors
        size = 1024
        self.ring = [None for i in xrange(size)]

        # Get the list of ras events with END_JOB control action
        self.msgIDs, self.msgidService = get_eventList()

        for msgID in self.msgIDs:
            registry.get_logger().debug('msgId = ' + msgID)

        return
コード例 #5
0
    def __init__(self, name, inEventQueue, outQueue, config_dict=None, number=0, checkpoint=None):
        '''The constructor.
        '''
        EventAnalyzer.__init__(self, name, inEventQueue, outQueue, config_dict, number, checkpoint)

        # Register to receive all ras events (note that a typical analyzer
        # would be interested in a small subset of the events). 
        msgtypesTable = self.appendSchema('tbgqmsgtypes')
        sample_query = "select msg_id from " + msgtypesTable
        rows = self.executeQuery(sample_query)
        self.msgIDs = list() 
        for r in rows:
            #registry.get_logger().debug('msgId = ' + r[0])
            self.msgIDs.append(r[0])
コード例 #6
0
    def __init__(self, name, inEventQueue, outQueue, config_dict=None, number=0, checkpoint=None):
        '''The constructor.
        '''
        EventAnalyzer.__init__(self, name, inEventQueue, outQueue, config_dict, number, checkpoint)

        self.severity = "F"
        self.recommendation = "Diagnose hardware that has been placed in an error state. "

        # Get the list of ras events with 'hardware in error' control actions
        self.msgIDs, self.msgidService = get_eventList()

        for msgID in self.msgIDs:
            registry.get_logger().debug('msgId = ' + msgID)

        return
コード例 #7
0
    def __init__(self, name, inEventQueue, outQueue, config_dict=None, number=0, checkpoint=None):
        '''The constructor.
        '''
        EventAnalyzer.__init__(self, name, inEventQueue, outQueue, config_dict, number, checkpoint)

        self.severity = "W"
        self.recommendation = '''Schedule service to isolate the BQL issue.  Possible causes are environmental, cable, or a board.  Multiple BQLs reporting issues on multiple boards in the same midplane may be a side effect of an environmental issue like neighboring boards being powered off unexpectedly.  Issues with a single cable may be due to poor seating of the cable into the connector or debris on the cable.   The cable and board can be cleaned with an optics cleaning tool.  Low voltage on all or most lanes on a single optical module may be an issue with the board at this location (the receiver) or its neighboring board (the transmitter) at the other end of the cable.'''
        self.alert_id = 'BQL01'

        # Get the exclude list of message IDs
        cfg = registry.get_service(registry.SERVICE_CONFIGURATION)
        excludeList = ''
        try: 
            excludeList = cfg.get(BGQ_TEAL_BQL_ANALYZER, excludeMsgIDs)
            registry.get_logger().debug('Exclude List = ' + excludeList)
        except Exception, e:
            registry.get_logger().debug(e)
コード例 #8
0
    def __init__(self, name, inEventQueue, outQueue, config_dict=None, number=0, checkpoint=None):
        '''The constructor.
        '''
        EventAnalyzer.__init__(self, name, inEventQueue, outQueue, config_dict, number, checkpoint)

        self.severity = "F"
        self.recommendation = "Diagnose the fatal RAS event that ended the job. "

        # ring buffer to remember jobs ending due to fatal errors
        size = 1024
        self.ring = [None for i in xrange(size)]

        # Get the list of ras events with END_JOB control action
        self.msgIDs, self.msgidService = get_eventList()

        for msgID in self.msgIDs:
            registry.get_logger().debug('msgId = ' + msgID)

        return
コード例 #9
0
    def __init__(self,
                 name,
                 inEventQueue,
                 outQueue,
                 config_dict=None,
                 number=0,
                 checkpoint=None):
        '''The constructor.
        '''
        EventAnalyzer.__init__(self, name, inEventQueue, outQueue, config_dict,
                               number, checkpoint)

        self.severity = "W"
        self.recommendation = "Diagnose the problem that caused the threshold to be reached or exceeded. "
        self.alert_id = 'THRESH01'

        # Get the list of ras events that have threshold counts
        self.msgIDs, self.msgidService, self.msgidCount, self.msgidPeriod = get_eventList(
        )

        for msgID in self.msgIDs:
            registry.get_logger().debug('msgId = ' + msgID)

        # define query for count with no period specified
        eventTable = self.appendSchema('tbgqeventlog')
        self.count_query = "select count(*) from " + eventTable + " where msg_id = ? and location LOC and serialnumber SN and event_time <= ?"
        self.count_query2 = "select sum(bigint(count)) from " + eventTable + " where msg_id = ? and location LOC and serialnumber SN and event_time <= ?"

        # define query for count exceeded with period specified
        self.period_query = "select count(*) from " + eventTable + " where msg_id = ? and location LOC and serialnumber SN and event_time <= ? and event_time > (timestamp('MYTIME') - PERIOD)"
        self.period_query2 = "select sum(bigint(count)) from " + eventTable + " where msg_id = ? and location LOC and serialnumber SN and event_time <= ? and event_time > (timestamp('MYTIME') - PERIOD)"

        # the number of consecutive periods that the threshold has to exceed
        self.msgidConsecutivePeriods = dict()
        self.msgidConsecutivePeriods['0008002F'] = 7
        self.msgidConsecutivePeriods['00080030'] = 3

        return
コード例 #10
0
ファイル: event_analyzer.py プロジェクト: ppjsand/pyteal
 def is_not_processing(self):
     ''' Return true if the analyzer is processing an event or events '''
     return EventAnalyzer.is_not_processing(self) and self.engine.is_not_processing_addition()
コード例 #11
0
ファイル: event_analyzer_test.py プロジェクト: ppjsand/pyteal
 def __init__(self, name, inQueue, outQueue, config_dict=None, number=0):
     '''The constructor.'''
     self.count = 0  # start with 1
     get_logger().debug('Creating SimpleEventAnalyzerAllAlert')
     EventAnalyzer.__init__(self, name, inQueue, outQueue, config_dict=config_dict, number=number)
     return
コード例 #12
0
ファイル: restart_test.py プロジェクト: ppjsand/pyteal
 def __init__(self, name, inQueue, outQueue, config_dict=None, number=0):        
     self.journal = Journal(name)
     EventAnalyzer.__init__(self, name, inQueue, outQueue, config_dict, number)