def __init__(self,*args, **kwargs):
        super(PlatformMonitorAgent, self).__init__(*args,**kwargs)

        self.agent_id = kwargs['name']
        multinode_data = db_helper.get_multinode_data()
        self.node_name = multinode_data['this_node']
        self.mynode = db_helper.get_node_id()

        self.poll_time = 60
        self.backup_poll_time = 300

        platform_variables['agent_id'] = self.agent_id + '_' + self.node_name
        notification_variables['agent_id'] = self.agent_id

        self.variables = kwargs
        self.db_host = db_host
        self.last_seen_dead = dict()
        self.cassandra_death_time = None #Arbitrary initialization
        self.cassandra_death_date = None
        self.crash_id = dict()
        self.last_event_log_time = None
        self.retry_resurrection = False
        self.setup_complete = False
        self.runPeriodically(self.agentMonitor, self.poll_time)
        self.runPeriodically(self.agentBackupMonitor, self.backup_poll_time,start_immediately=False)
        self.runPeriodically(self.eventMonitor, self.poll_time,start_immediately=False)
        self.run()
Exemple #2
0
    def __init__(self, config_path, **kwargs):
        kwargs['identity'] = 'networkagent'
        super(NetworkAgent, self).__init__(**kwargs)
        self.config = utils.load_config(config_path)

        def get_config(name):
            try:
                kwargs.pop(name)
            except KeyError:
                return self.config.get(name, '')

        self.agent_id = get_config('agent_id')

        offline_variables['node_type'] = node_type
        offline_variables['node_name'] = node_name
        offline_variables['logged_by'] = self.agent_id

        self.building_name = building_name
        self.host_ip_address = my_ip_address
        self.db_host = db_host
        self.host_name = host_name
        self.host_type = settings.PLATFORM['node']['type']
        self.host_building_name = building_name

        self.curcon = db_helper.db_connection()
        self.my_node_id = db_helper.get_node_id()

        print "host_zone_id " + str(self.my_node_id)

        self.time_sent_notifications = {}
Exemple #3
0
    def __init__(self,config_path, **kwargs):
        kwargs['identity'] = 'platformmonitoragent2'
        super(PlatformMonitorAgent, self).__init__(**kwargs)

        # Step1: Agent Code
        config = utils.load_config(config_path)
        def get_config(name):
            try:
                kwargs.pop(name)
            except KeyError:
                return config.get(name, '')

        multinode_data = db_helper.get_multinode_data()
        self.node_name = multinode_data['this_node']
        self.mynode = db_helper.get_node_id()

        self.agent_id = get_config('agent_id')
        self.poll_time = get_config('poll_time')
        self.backup_poll_time = get_config('backup_poll_time')

        platform_variables['agent_id'] = self.agent_id + '_' + self.node_name
        notification_variables['agent_id'] = self.agent_id

        self.variables = kwargs
        self.db_host = db_host
        self.last_seen_dead = dict()
        self.cassandra_death_time = None #Arbitrary initialization
        self.cassandra_death_date = None
        self.crash_id = dict()
        self.last_event_log_time = None
        self.retry_resurrection = False
Exemple #4
0
    def __init__(self, *args, **kwargs):
        super(NetworkAgent, self).__init__(*args, **kwargs)
        self.agent_id = kwargs['name']
        self.building_name = building_name
        self.host_ip_address = my_ip_address
        self.db_host = db_host
        self.host_name = host_name
        self.host_type = settings.PLATFORM['node']['type']
        self.host_building_name = building_name

        self.my_node_id = db_helper.get_node_id()

        print "host_zone_id " + str(self.my_node_id)

        self.time_sent_notifications = {}
        self.subscribe('update_parent', self.updateParent)
        self.subscribe('status_change', self.on_match_change)
        self.run()