Add check_local_agents()
This commit is contained in:
parent
bc1e411872
commit
fc2b17505a
@ -332,10 +332,24 @@ class MonitorNeutronAgentsDaemon(Daemon):
|
|||||||
if len(dhcp_agents) != 0:
|
if len(dhcp_agents) != 0:
|
||||||
self.dhcp_agents_reschedule(dhcp_agents, networks, quantum)
|
self.dhcp_agents_reschedule(dhcp_agents, networks, quantum)
|
||||||
|
|
||||||
|
def check_local_agents(self):
|
||||||
|
services = ['neutron-metadata-agent', 'neutron-vpn-agent']
|
||||||
|
stop = 'neutron-vpn-agent stop/waiting'
|
||||||
|
for s in services:
|
||||||
|
status = ['sudo', 'service', s, 'status']
|
||||||
|
start = ['sudo', 'service', s, 'start']
|
||||||
|
try:
|
||||||
|
output = subprocess.check_output(status)
|
||||||
|
if output.strip() == stop:
|
||||||
|
subprocess.check_output(start)
|
||||||
|
except:
|
||||||
|
LOG.error("Unable to check neutron services status")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
while True:
|
while True:
|
||||||
LOG.info('Monitor Neutron HA Agent Loop Start')
|
LOG.info('Monitor Neutron HA Agent Loop Start')
|
||||||
self.reassign_agent_resources()
|
self.reassign_agent_resources()
|
||||||
|
self.check_local_agents()
|
||||||
LOG.info('sleep %s' % cfg.CONF.check_interval)
|
LOG.info('sleep %s' % cfg.CONF.check_interval)
|
||||||
time.sleep(float(cfg.CONF.check_interval))
|
time.sleep(float(cfg.CONF.check_interval))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user