def __init__(self): self.db = Database() entity_prefix = 'controller' conn = Connection(entity_prefix, static=True) self.entity_name, self.entity_suffix = conn.get_entity_name() # List of nodes known to the controller self.poller_map = {} self.poller_pool = {} self.job_map = {} self.job_pool = [] # Message scheduler self.sched = MessageScheduler(self.message_handler) self.log = Logging(conn) conn.join_muc('pollers') conn.join_muc('aggregators') self.parser = Parser() self.establish_jobs() self.conn = conn.get_conn() self.conn.RegisterHandler('iq',self.result_handler,'result') self.conn.RegisterHandler('iq',self.set_handler,'set') self.conn.RegisterHandler('presence',self.presence_handler) self.go_on()
def __init__(self, segment='skynet'): config = Configuration() self.jobs = {} self.sched = MessageScheduler(self.message_handler) self.parser = Parser() self.aggregator = None self.failed_aggregator = False self.query_queue = [] conn = Connection('poller', 'roflcake') self.entity_prefix, entity_suffix = conn.get_entity_name() # self.entity_name = entity_prefix + entity_suffix conn.join_muc('pollers') self.segment = segment self.conn = conn.get_conn() self.log = Logging(conn) self.roster = self.conn.getRoster() self.conn.RegisterHandler('presence',self.presence_handler) self.conn.RegisterHandler('iq', self.result_handler, 'result') self.conn.RegisterHandler('iq', self.error_handler, 'error') self.conn.RegisterHandler('iq', self.get_handler, 'get') self.conn.RegisterHandler('iq', self.set_handler, 'set') self.go_on()
def __init__(self): config = Configuration() self.db = Database() self.results = self.db.get_table('results') self.job_map = {} self.job_pool = [] self.failed_jobs = [] self.evals = {} self.notifier = Notifier() self.sched = MessageScheduler(self.message_handler) conn = Connection('aggregator', 'roflcake') entity_prefix, entity_suffix = conn.get_entity_name() self.entity_name = entity_prefix + entity_suffix self.log = Logging(conn) conn.join_muc('aggregators') self.conn = conn.get_conn() self.roster = self.conn.getRoster() self.conn.RegisterHandler('iq',self.set_handler,'set') self.conn.RegisterHandler('iq',self.get_handler,'get') self.conn.RegisterHandler('iq',self.result_handler,'result') self.conn.RegisterHandler('presence',self.presence_handler) self.temp_messages = [] self.parser = Parser() self.go_on()