worlddump: request Guru Mediation reports for neutron agents
Those reports may be helpful when debugging neutron gate issues. pgrep is backwards compatible with old Solaris tools, which means it does not match with commands that are longer than 15 characters. To avoid that for neutron agent names which are longer than that, we need to pass -f argument to match against the full cmdline. Also killall instead of kill + pgrep in a subshell. Change-Id: I9b3801e927c0e80443ed76e38cd8e3618e888e49
This commit is contained in:
parent
406b45b81a
commit
ef219bfcaf
@ -27,6 +27,16 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
GMR_PROCESSES = (
|
||||||
|
'nova-compute',
|
||||||
|
'neutron-dhcp-agent',
|
||||||
|
'neutron-l3-agent',
|
||||||
|
'neutron-linuxbridge-agent',
|
||||||
|
'neutron-metadata-agent',
|
||||||
|
'neutron-openvswitch-agent',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_options():
|
def get_options():
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description='Dump world state for debugging')
|
description='Dump world state for debugging')
|
||||||
@ -191,17 +201,18 @@ def compute_consoles():
|
|||||||
_dump_cmd("sudo cat %s" % fullpath)
|
_dump_cmd("sudo cat %s" % fullpath)
|
||||||
|
|
||||||
|
|
||||||
def guru_meditation_report():
|
def guru_meditation_reports():
|
||||||
_header("nova-compute Guru Meditation Report")
|
for service in GMR_PROCESSES:
|
||||||
|
_header("%s Guru Meditation Report" % service)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.check_call(["pgrep","nova-compute"])
|
subprocess.check_call(['pgrep', '-f', service])
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
print("Skipping as nova-compute does not appear to be running")
|
print("Skipping as %s does not appear to be running" % service)
|
||||||
return
|
continue
|
||||||
|
|
||||||
_dump_cmd("kill -s USR2 `pgrep nova-compute`")
|
_dump_cmd("killall -e -USR2 %s" % service)
|
||||||
print("guru meditation report in nova-compute log")
|
print("guru meditation report in %s log" % service)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@ -218,7 +229,7 @@ def main():
|
|||||||
iptables_dump()
|
iptables_dump()
|
||||||
ebtables_dump()
|
ebtables_dump()
|
||||||
compute_consoles()
|
compute_consoles()
|
||||||
guru_meditation_report()
|
guru_meditation_reports()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user