def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr) self.node_type = "contrail-vrouter" self.module = Module.COMPUTE_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///tmp/supervisord_vrouter.sock" self.add_current_process() os_nova_comp = VrouterProcessStat('openstack-nova-compute') popen_cmd = "openstack-status | grep openstack-nova-compute" + \ " | cut -d ':' -f2" (os_nova_comp_state, error_value) = \ Popen(popen_cmd, shell=True, stdout=PIPE).communicate() os_nova_comp.process_state = os_nova_comp_state.strip() if (os_nova_comp.process_state == 'active'): os_nova_comp.process_state = 'PROCESS_STATE_RUNNING' os_nova_comp.start_time = str(int(time.time() * 1000000)) os_nova_comp.start_count += 1 if (os_nova_comp.process_state == 'dead'): os_nova_comp.process_state = 'PROCESS_STATE_FATAL' sys.stderr.write('Openstack Nova Compute status:' + os_nova_comp.process_state + "\n") self.process_state_db['openstack-nova-compute'] = os_nova_comp self.lb_stats = LoadbalancerStats()
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): self.node_type = "contrail-config" self.module = Module.CONFIG_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///var/run/supervisord_config.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8100, ['cfgm_common.uve'], _disc) sandesh_global.set_logging_params(enable_local_log=True) ConnectionState.init(sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE, NodeStatus) self.send_system_cpu_info() self.third_party_process_list = [ ]
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): self.node_type = "contrail-control" self.uve_node_type = UVENodeTypeNames[NodeType.CONTROL] self.table = "ObjectBgpRouter" self.module = Module.CONTROL_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///var/run/supervisord_control.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) _disc = self.get_discovery_client() sandesh_global.init_generator(self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8101, ['nodemgr.common.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True) ConnectionState.init( sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE, NodeStatus, self.table) self.send_init_info() self.third_party_process_dict = {}
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) self.node_type = 'contrail-analytics' self.table = "ObjectCollectorInfo" self.module = Module.ANALYTICS_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///var/run/supervisord_analytics.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8104, ['analytics', 'nodemgr.common.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True) ConnectionState.init(sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE, NodeStatus, self.table) self.send_system_cpu_info() self.third_party_process_list = [ ]
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) self.node_type = 'contrail-analytics' self.table = "ObjectCollectorInfo" self.module = Module.ANALYTICS_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///var/run/supervisord_analytics.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8104, ['nodemgr.common.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True) ConnectionState.init(sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE, NodeStatus, self.table) self.send_system_cpu_info() self.third_party_process_dict = {}
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr, **dss_kwargs): self.module = Module.COMPUTE_NODE_MGR self.module_id = ModuleNames[self.module] node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global, **dss_kwargs) self.node_type = "contrail-vrouter" self.uve_node_type = UVENodeTypeNames[NodeType.COMPUTE] self.table = "ObjectVRouter" _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8102, ['vrouter.loadbalancer', 'nodemgr.common.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True) if os.path.exists('/tmp/supervisord_vrouter.sock'): self.supervisor_serverurl = "unix:///tmp/supervisord_vrouter.sock" else: self.supervisor_serverurl = "unix:///var/run/supervisord_vrouter.sock" self.add_current_process() ConnectionState.init(sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_conn_state_cb), NodeStatusUVE, NodeStatus, self.table, self.get_process_state_cb) self.lb_stats = LoadbalancerStatsUVE() self.send_init_info() self.third_party_process_dict = {}
def __init__(self, rule_file, unit_names, collector_addr, sandesh_config, hostip, minimum_diskgb, contrail_databases, cassandra_repair_interval, cassandra_repair_logdir): if os.path.exists('/tmp/supervisord_database.sock'): supervisor_serverurl = "unix:///tmp/supervisord_database.sock" else: supervisor_serverurl = "unix:///var/run/supervisord_database.sock" type_info = EventManagerTypeInfo( package_name='contrail-database-common', object_table="ObjectDatabaseInfo", module_type=Module.DATABASE_NODE_MGR, supervisor_serverurl=supervisor_serverurl, third_party_processes={ "cassandra": "Dcassandra-pidfile=.*cassandra\.pid", "zookeeper": "org.apache.zookeeper.server.quorum.QuorumPeerMain" }, sandesh_packages=['database.sandesh'], unit_names=unit_names) EventManager.__init__(self, type_info, rule_file, collector_addr, sandesh_global, sandesh_config) self.hostip = hostip self.minimum_diskgb = minimum_diskgb self.contrail_databases = contrail_databases self.cassandra_repair_interval = cassandra_repair_interval self.cassandra_repair_logdir = cassandra_repair_logdir self.cassandra_mgr = CassandraManager(cassandra_repair_logdir) # Initialize tpstat structures self.cassandra_status_old = CassandraStatusData() self.cassandra_status_old.cassandra_compaction_task = CassandraCompactionTask( ) self.cassandra_status_old.thread_pool_stats = []
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr, hostip, minimum_diskgb, contrail_databases, cassandra_repair_interval, cassandra_repair_logdir): self.node_type = "contrail-database" self.module = Module.DATABASE_NODE_MGR self.module_id = ModuleNames[self.module] self.hostip = hostip self.minimum_diskgb = minimum_diskgb self.contrail_databases = contrail_databases self.cassandra_repair_interval = cassandra_repair_interval self.cassandra_repair_logdir = cassandra_repair_logdir self.supervisor_serverurl = "unix:///tmp/supervisord_database.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) self.sandesh_global = sandesh_global if self.rule_file is '': self.rule_file = "/etc/contrail/" + \ "supervisord_database_files/contrail-database.rules" json_file = open(self.rule_file) self.rules_data = json.load(json_file) _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8103, ['database.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True)
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): self.module = Module.COMPUTE_NODE_MGR self.module_id = ModuleNames[self.module] node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) self.node_type = "contrail-vrouter" _disc = self.get_discovery_client() sandesh_global.init_generator(self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8102, ['vrouter.vrouter'], _disc) sandesh_global.set_logging_params(enable_local_log=True) self.supervisor_serverurl = "unix:///var/run/supervisord_vrouter.sock" self.add_current_process() ConnectionState.init( sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE, NodeStatus) self.lb_stats = LoadbalancerStatsUVE() self.send_system_cpu_info() self.third_party_process_list = []
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): self.node_type = "contrail-control" self.uve_node_type = UVENodeTypeNames[NodeType.CONTROL] self.table = "ObjectBgpRouter" self.module = Module.CONTROL_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///var/run/supervisord_control.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global; EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8101, ['nodemgr.common.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True) ConnectionState.init(sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE, NodeStatus, self.table) self.send_init_info() self.third_party_process_dict = {}
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr, hostip, minimum_diskgb, contrail_databases, cassandra_repair_interval, cassandra_repair_logdir): self.node_type = "contrail-database" self.module = Module.DATABASE_NODE_MGR self.module_id = ModuleNames[self.module] self.hostip = hostip self.minimum_diskgb = minimum_diskgb self.contrail_databases = contrail_databases self.cassandra_repair_interval = cassandra_repair_interval self.cassandra_repair_logdir = cassandra_repair_logdir self.supervisor_serverurl = "unix:///tmp/supervisord_database.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global, send_build_info=True) self.sandesh_global = sandesh_global if self.rule_file is '': self.rule_file = "/etc/contrail/" + \ "supervisord_database_files/contrail-database.rules" json_file = open(self.rule_file) self.rules_data = json.load(json_file) _disc = self.get_discovery_client() sandesh_global.init_generator(self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8103, ['database.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True)
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): self.module = Module.COMPUTE_NODE_MGR self.module_id = ModuleNames[self.module] node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) self.node_type = "contrail-vrouter" self.table = "ObjectVRouter" _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8102, ['vrouter.loadbalancer', 'nodemgr.common.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True) self.supervisor_serverurl = "unix:///var/run/supervisord_vrouter.sock" self.add_current_process() ConnectionState.init(sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE, NodeStatus, self.table) self.lb_stats = LoadbalancerStatsUVE() self.send_system_cpu_info() self.third_party_process_dict = {}
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr, cassandra_repair_interval, cassandra_repair_logdir): self.node_type = "contrail-config" self.table = "ObjectConfigNode" self.module = Module.CONFIG_NODE_MGR self.module_id = ModuleNames[self.module] self.cassandra_repair_interval = cassandra_repair_interval self.cassandra_repair_logdir = cassandra_repair_logdir self.cassandra_mgr = CassandraManager(cassandra_repair_logdir) self.supervisor_serverurl = "unix:///var/run/supervisord_config.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) _disc = self.get_discovery_client() sandesh_global.init_generator(self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8100, ['nodemgr.common.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True) ConnectionState.init( sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE, NodeStatus, self.table) self.send_system_cpu_info() self.third_party_process_dict = {}
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr) self.node_type = "contrail-config" self.module = Module.CONFIG_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///tmp/supervisord_config.sock" self.add_current_process()
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr) self.node_type = "contrail-control" self.module = Module.CONTROL_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///tmp/supervisord_control.sock" self.add_current_process()
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr) self.node_type = 'contrail-analytics' self.module = Module.ANALYTICS_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///tmp/supervisord_analytics.sock" self.add_current_process()
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr, hostip, minimum_diskgb): EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr) self.node_type = "contrail-database" self.module = Module.DATABASE_NODE_MGR self.module_id = ModuleNames[self.module] self.hostip = hostip self.minimum_diskgb = minimum_diskgb self.supervisor_serverurl = "unix:///tmp/supervisord_database.sock" self.add_current_process()
def __init__(self, rule_file, unit_names, discovery_server, discovery_port, collector_addr, sandesh_config): type_info = EventManagerTypeInfo(package_name = 'contrail-control', module_type = Module.CONTROL_NODE_MGR, object_table = 'ObjectBgpRouter', supervisor_serverurl = 'unix:///var/run/supervisord_control.sock', unit_names = unit_names) EventManager.__init__( self, type_info, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global, sandesh_config)
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr, hostip, db_port, minimum_diskgb, contrail_databases, cassandra_repair_interval, cassandra_repair_logdir, **kwargs): self.node_type = "contrail-config" self.uve_node_type = UVENodeTypeNames[NodeType.CONFIG] self.table = "ObjectConfigNode" self.module = Module.CONFIG_NODE_MGR self.module_id = ModuleNames[self.module] self.cassandra_repair_interval = cassandra_repair_interval self.cassandra_repair_logdir = cassandra_repair_logdir self.hostip = hostip self.db_port = db_port self.minimum_diskgb = minimum_diskgb self.contrail_databases = contrail_databases self.cassandra_mgr = CassandraManager(self.cassandra_repair_logdir, 'configDb', self.table, self.contrail_databases, self.hostip, self.minimum_diskgb, self.db_port) self.cassandra_mgr.use_ssl = kwargs.get('cassandra_use_ssl', False) if os.path.exists('/tmp/supervisord_config.sock'): self.supervisor_serverurl = "unix:///tmp/supervisord_config.sock" else: self.supervisor_serverurl = "unix:///var/run/supervisord_config.sock" self.db = package_installed('contrail-openstack-database') self.config_db = package_installed('contrail-database-common') self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global, **kwargs) _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8100, ['database.sandesh', 'nodemgr.common.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True) ConnectionState.init(sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_conn_state_cb), NodeStatusUVE, NodeStatus, self.table, self.get_process_state_cb) self.send_init_info() self.third_party_process_dict = {} self.third_party_process_dict["cassandra"] = "Dcassandra-pidfile=.*cassandra\.pid" self.third_party_process_dict["zookeeper"] = "org.apache.zookeeper.server.quorum.QuorumPeerMain"
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr, hostip, db_port, minimum_diskgb, contrail_databases, cassandra_repair_interval, cassandra_repair_logdir, **dss_kwargs): self.node_type = "contrail-database" self.uve_node_type = UVENodeTypeNames[NodeType.DATABASE] self.table = "ObjectDatabaseInfo" self.module = Module.DATABASE_NODE_MGR self.module_id = ModuleNames[self.module] self.hostip = hostip self.db_port = db_port self.minimum_diskgb = minimum_diskgb self.contrail_databases = contrail_databases self.cassandra_repair_interval = cassandra_repair_interval self.cassandra_repair_logdir = cassandra_repair_logdir self.cassandra_mgr = CassandraManager(self.cassandra_repair_logdir, 'analyticsDb', self.table, self.contrail_databases, self.hostip, self.minimum_diskgb, self.db_port) if os.path.exists('/tmp/supervisord_database.sock'): self.supervisor_serverurl = "unix:///tmp/supervisord_database.sock" else: self.supervisor_serverurl = "unix:///var/run/supervisord_database.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global, **dss_kwargs) self.sandesh_global = sandesh_global if self.rule_file is '': self.rule_file = "/etc/contrail/" + \ "supervisord_database_files/contrail-database.rules" json_file = open(self.rule_file) self.rules_data = json.load(json_file) _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8103, ['database.sandesh', 'nodemgr.common.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True) ConnectionState.init(sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_conn_state_cb), NodeStatusUVE, NodeStatus, self.table, self.get_process_state_cb) self.send_init_info() self.third_party_process_dict = {} self.third_party_process_dict["cassandra"] = "Dcassandra-pidfile=.*cassandra\.pid" self.third_party_process_dict["zookeeper"] = "org.apache.zookeeper.server.quorum.QuorumPeerMain"
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr, hostip, minimum_diskgb): EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr) self.node_type = "contrail-database" self.module = Module.DATABASE_NODE_MGR self.module_id = ModuleNames[self.module] self.hostip = hostip self.minimum_diskgb = minimum_diskgb self.supervisor_serverurl = "unix:///tmp/supervisord_database.sock" self.add_current_process()
def __init__(self, rule_file, unit_names, collector_addr, sandesh_config): if os.path.exists('/tmp/supervisord_control.sock'): supervisor_serverurl = "unix:///tmp/supervisord_control.sock" else: supervisor_serverurl = "unix:///var/run/supervisord_control.sock" type_info = EventManagerTypeInfo(package_name = 'contrail-control', module_type = Module.CONTROL_NODE_MGR, object_table = 'ObjectBgpRouter', supervisor_serverurl = supervisor_serverurl, unit_names = unit_names) EventManager.__init__( self, type_info, rule_file, collector_addr, sandesh_global, sandesh_config)
def __init__(self, rule_file, unit_names, discovery_server, discovery_port, collector_addr, sandesh_config, cassandra_repair_interval, cassandra_repair_logdir): type_info = EventManagerTypeInfo( package_name='contrail-config', module_type=Module.CONFIG_NODE_MGR, object_table='ObjectConfigNode', supervisor_serverurl='unix:///var/run/supervisord_config.sock', unit_names=unit_names) EventManager.__init__(self, type_info, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global, sandesh_config) self.cassandra_repair_interval = cassandra_repair_interval self.cassandra_repair_logdir = cassandra_repair_logdir self.cassandra_mgr = CassandraManager(cassandra_repair_logdir)
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) self.node_type = 'contrail-analytics' self.module = Module.ANALYTICS_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///tmp/supervisord_analytics.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8104, ['analytics'], _disc) sandesh_global.set_logging_params(enable_local_log=True)
def __init__(self, rule_file, unit_names, discovery_server, discovery_port, collector_addr, sandesh_config): type_info = EventManagerTypeInfo( package_name='contrail-vrouter-common', module_type=Module.COMPUTE_NODE_MGR, object_table='ObjectVRouter', supervisor_serverurl="unix:///var/run/supervisord_vrouter.sock", unit_names=unit_names) EventManager.__init__(self, type_info, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global, sandesh_config, update_process_list=True) self.lb_stats = LoadbalancerStatsUVE()
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr, hostip, minimum_diskgb, contrail_databases, cassandra_repair_interval, cassandra_repair_logdir): self.node_type = "contrail-database" self.uve_node_type = UVENodeTypeNames[NodeType.DATABASE] self.table = "ObjectDatabaseInfo" self.module = Module.DATABASE_NODE_MGR self.module_id = ModuleNames[self.module] self.hostip = hostip self.minimum_diskgb = minimum_diskgb self.contrail_databases = contrail_databases self.cassandra_repair_interval = cassandra_repair_interval self.cassandra_repair_logdir = cassandra_repair_logdir self.cassandra_mgr = CassandraManager(cassandra_repair_logdir) self.supervisor_serverurl = "unix:///var/run/supervisord_database.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) self.sandesh_global = sandesh_global if self.rule_file is '': self.rule_file = "/etc/contrail/" + \ "supervisord_database_files/contrail-database.rules" json_file = open(self.rule_file) self.rules_data = json.load(json_file) _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8103, ['database.sandesh', 'nodemgr.common.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True) ConnectionState.init(sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE, NodeStatus, self.table) self.send_init_info() self.third_party_process_dict = {} self.third_party_process_dict["cassandra"] = "Dcassandra-pidfile=.*cassandra\.pid" self.third_party_process_dict["zookeeper"] = "org.apache.zookeeper.server.quorum.QuorumPeerMain"
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): self.node_type = "contrail-config" self.module = Module.CONFIG_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///tmp/supervisord_config.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8100, ['cfgm_common.uve'], _disc) sandesh_global.set_logging_params(enable_local_log=True)
def __init__(self, rule_file, unit_names, collector_addr, sandesh_config, cassandra_repair_interval, cassandra_repair_logdir): if os.path.exists('/tmp/supervisord_config.sock'): supervisor_serverurl = "unix:///tmp/supervisord_config.sock" else: supervisor_serverurl = "unix:///var/run/supervisord_config.sock" type_info = EventManagerTypeInfo(package_name = 'contrail-config', module_type = Module.CONFIG_NODE_MGR, object_table = 'ObjectConfigNode', supervisor_serverurl = supervisor_serverurl, unit_names = unit_names) EventManager.__init__( self, type_info, rule_file, collector_addr, sandesh_global, sandesh_config) self.cassandra_repair_interval = cassandra_repair_interval self.cassandra_repair_logdir = cassandra_repair_logdir self.cassandra_mgr = CassandraManager(cassandra_repair_logdir)
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): self.module = Module.COMPUTE_NODE_MGR self.module_id = ModuleNames[self.module] node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) self.node_type = "contrail-vrouter" _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8102, ['vrouter.vrouter'], _disc) sandesh_global.set_logging_params(enable_local_log=True) self.supervisor_serverurl = "unix:///tmp/supervisord_vrouter.sock" self.add_current_process() self.lb_stats = LoadbalancerStats()
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr, hostip, minimum_diskgb, contrail_databases, cassandra_repair_interval, cassandra_repair_logdir): self.node_type = "contrail-database" self.module = Module.DATABASE_NODE_MGR self.module_id = ModuleNames[self.module] self.hostip = hostip self.minimum_diskgb = minimum_diskgb self.contrail_databases = contrail_databases self.cassandra_repair_interval = cassandra_repair_interval self.cassandra_repair_logdir = cassandra_repair_logdir self.supervisor_serverurl = "unix:///var/run/supervisord_database.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__( self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global, send_build_info = True) self.sandesh_global = sandesh_global if self.rule_file is '': self.rule_file = "/etc/contrail/" + \ "supervisord_database_files/contrail-database.rules" json_file = open(self.rule_file) self.rules_data = json.load(json_file) _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8103, ['database.sandesh'], _disc) sandesh_global.set_logging_params(enable_local_log=True) ConnectionState.init(sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE, NodeStatus) self.send_system_cpu_info() self.third_party_process_list = [ "cassandra", "zookeeper" ]
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): self.node_type = "contrail-config" self.module = Module.CONFIG_NODE_MGR self.module_id = ModuleNames[self.module] self.supervisor_serverurl = "unix:///tmp/supervisord_config.sock" self.add_current_process() node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) _disc = self.get_discovery_client() sandesh_global.init_generator(self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8100, ['cfgm_common.uve'], _disc) sandesh_global.set_logging_params(enable_local_log=True) ConnectionState.init( sandesh_global, socket.gethostname(), self.module_id, self.instance_id, staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE, NodeStatus)
def __init__(self, rule_file, discovery_server, discovery_port, collector_addr): self.module = Module.COMPUTE_NODE_MGR self.module_id = ModuleNames[self.module] node_type = Module2NodeType[self.module] node_type_name = NodeTypeNames[node_type] self.sandesh_global = sandesh_global EventManager.__init__(self, rule_file, discovery_server, discovery_port, collector_addr, sandesh_global) self.node_type = "contrail-vrouter" _disc = self.get_discovery_client() sandesh_global.init_generator( self.module_id, socket.gethostname(), node_type_name, self.instance_id, self.collector_addr, self.module_id, 8102, ['vrouter.vrouter'], _disc) sandesh_global.set_logging_params(enable_local_log=True) self.supervisor_serverurl = "unix:///tmp/supervisord_vrouter.sock" self.add_current_process() os_nova_comp = VrouterProcessStat('openstack-nova-compute') popen_cmd = "openstack-status | grep openstack-nova-compute" + \ " | cut -d ':' -f2" (os_nova_comp_state, error_value) = \ Popen(popen_cmd, shell=True, stdout=PIPE).communicate() os_nova_comp.process_state = os_nova_comp_state.strip() if (os_nova_comp.process_state == 'active'): os_nova_comp.process_state = 'PROCESS_STATE_RUNNING' os_nova_comp.start_time = str(int(time.time() * 1000000)) os_nova_comp.start_count += 1 if (os_nova_comp.process_state == 'dead'): os_nova_comp.process_state = 'PROCESS_STATE_FATAL' sys.stderr.write('Openstack Nova Compute status:' + os_nova_comp.process_state + "\n") self.process_state_db['openstack-nova-compute'] = os_nova_comp self.lb_stats = LoadbalancerStats()