Beispiel #1
0
def start_engines():
	global engines
	# Init Engines
	## TODO: Use routing table for dynamic routing
	### Route:
	
	# Events:
	### Nagios/Icinga/Shinken... ----------------------------> canopsis.events -> tag -> perfstore -> eventstore
	### collectd ------------------> amq.topic -> collectdgw |
	
	# Alerts:
	### canopsis.alerts -> selector -> eventstore
	
	import perfstore2
	import eventstore
	import collectdgw
	import tag
	import selector
	import sla
	import alertcounter
	import derogation
	

	engine_selector		= selector.engine(logging_level=logging.INFO)
	engines.append(engine_selector)

	engine_alertcounter	= alertcounter.engine(next_engines=[engine_selector], logging_level=logging.INFO)
	engines.append(engine_alertcounter)
	
	engine_collectdgw	= collectdgw.engine()
	engines.append(engine_collectdgw)
	
	
	engine_eventstore	= eventstore.engine( logging_level=logging.INFO)
	engines.append(engine_eventstore)

	engine_perfstore	= perfstore2.engine(next_engines=[engine_eventstore])
	engines.append(engine_perfstore)
	
	engine_tag			= tag.engine(		next_engines=[engine_perfstore])
	engines.append(engine_tag)
	
	
	engine_derogation 	= derogation.engine( next_engines=[engine_tag], logging_level=logging.INFO)
	engines.append(engine_derogation)

	engine_sla			= sla.engine(logging_level=logging.INFO)
	engines.append(engine_sla)

	# Set Next queue
	## Events
	next_event_engines.append(engine_derogation)
	#next_event_engines.append(engine_tag)
	## Alerts
	next_alert_engines.append(engine_alertcounter)
	
	logger.info("Start engines")
	for engine in engines:
		engine.start()
Beispiel #2
0
def start_engines():
    global engines

    ##################
    # Events
    ##################

    # Engine_cleaner
    import cleaner
    engines.append(
        cleaner.engine(next_amqp_queues=['Engine_derogation'],
                       routing_keys=["#"],
                       exchange_name="canopsis.events",
                       name='cleaner_events'))

    # Engine_derogation
    import derogation
    engines.append(derogation.engine(next_amqp_queues=['Engine_tag']))

    # Engine_tag
    import tag
    engines.append(tag.engine(next_amqp_queues=['Engine_perfstore2']))

    # Engine_perfstore2
    import perfstore2
    engines.append(perfstore2.engine(next_amqp_queues=['Engine_eventstore']))

    # Engine_eventstore
    import eventstore
    engines.append(eventstore.engine())

    ##################
    # Alerts
    ##################

    # Engine_cleaner
    import cleaner
    engines.append(
        cleaner.engine(next_amqp_queues=['Engine_alertcounter'],
                       routing_keys=["#"],
                       exchange_name="canopsis.alerts",
                       name='cleaner_alerts'))

    # Engine_alertcounter
    import alertcounter
    engines.append(alertcounter.engine(next_amqp_queues=['Engine_topology']), )

    # Engine_topology
    import topology
    engines.append(topology.engine(next_amqp_queues=['Engine_selector']))

    # Engine_selector
    import selector
    engines.append(selector.engine())

    ##################
    # Autres
    ##################

    # Engine_collectdgw
    import collectdgw
    engines.append(collectdgw.engine())

    # Engine_sla (no queue)
    import sla
    engines.append(sla.engine())

    # Engine_consolidation
    import consolidation
    engines.append(consolidation.engine())

    # Engine_perfstore2_rotate
    import perfstore2_rotate
    engines.append(perfstore2_rotate.engine())

    ##################
    # Start engines
    ##################

    logger.info("Start engines")
    for engine in engines:
        engine.start()
Beispiel #3
0
def start_engines():
    global engines
    # Init Engines
    ## TODO: Use routing table for dynamic routing
    ### Route:

    # Events:
    ### Nagios/Icinga/Shinken... ----------------------------> canopsis.events -> tag -> perfstore -> eventstore
    ### collectd ------------------> amq.topic -> collectdgw |

    # Alerts:
    ### canopsis.alerts -> selector -> eventstore

    import perfstore2
    import eventstore
    import collectdgw
    import tag
    import selector
    import sla
    import alertcounter
    import derogation
    import topology
    import consolidation

    engine_selector = selector.engine(logging_level=logging.INFO)
    engines.append(engine_selector)

    engine_topology = topology.engine(next_engines=[engine_selector],
                                      logging_level=logging.INFO)
    engines.append(engine_topology)

    engine_alertcounter = alertcounter.engine(next_engines=[engine_topology],
                                              logging_level=logging.INFO)
    #engine_alertcounter	= alertcounter.engine(next_engines=[engine_selector], logging_level=logging.INFO)
    engines.append(engine_alertcounter)

    engine_collectdgw = collectdgw.engine()
    engines.append(engine_collectdgw)

    engine_eventstore = eventstore.engine(logging_level=logging.INFO)
    engines.append(engine_eventstore)
    #engine_eventstore2	= eventstore.engine( logging_level=logging.INFO)
    #engines.append(engine_eventstore2)
    #engine_eventstore3	= eventstore.engine( logging_level=logging.INFO)
    #engines.append(engine_eventstore3)

    #engine_perfstore	= perfstore2.engine(next_engines=[engine_eventstore, engine_eventstore2, engine_eventstore3])
    engine_perfstore = perfstore2.engine(next_engines=[engine_eventstore])
    engines.append(engine_perfstore)

    engine_tag = tag.engine(next_engines=[engine_perfstore])
    engines.append(engine_tag)

    engine_derogation = derogation.engine(next_engines=[engine_tag],
                                          logging_level=logging.INFO)
    engines.append(engine_derogation)

    engine_sla = sla.engine(logging_level=logging.INFO)
    engines.append(engine_sla)

    engine_consolidation = consolidation.engine(logging_level=logging.INFO)
    engines.append(engine_consolidation)

    # Set Next queue
    ## Events
    next_event_engines.append(engine_derogation)
    #next_event_engines.append(engine_tag)
    ## Alerts
    next_alert_engines.append(engine_alertcounter)

    logger.info("Start engines")
    for engine in engines:
        engine.start()