mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 13:39:27 -02:30
Combine sosreport plugins into a single plugin
This commit is contained in:
5
setup.py
5
setup.py
@@ -23,17 +23,14 @@ if os.path.exists("/etc/debian_version"):
|
|||||||
sysinit = "/etc/init.d"
|
sysinit = "/etc/init.d"
|
||||||
webconfig = "/etc/apache2/conf.d"
|
webconfig = "/etc/apache2/conf.d"
|
||||||
sosconfig = "/usr/share/sosreport/sos/plugins"
|
sosconfig = "/usr/share/sosreport/sos/plugins"
|
||||||
sosfile = "tower-sos3.py"
|
|
||||||
shutil.copy("config/awx-munin-ubuntu.conf", "config/awx-munin.conf")
|
shutil.copy("config/awx-munin-ubuntu.conf", "config/awx-munin.conf")
|
||||||
else:
|
else:
|
||||||
sysinit = "/etc/rc.d/init.d"
|
sysinit = "/etc/rc.d/init.d"
|
||||||
webconfig = "/etc/httpd/conf.d"
|
webconfig = "/etc/httpd/conf.d"
|
||||||
if os.path.exists("/usr/lib/python2.7/site-packages"):
|
if os.path.exists("/usr/lib/python2.7/site-packages"):
|
||||||
sosconfig = "/usr/lib/python2.7/site-packages/sos/plugins"
|
sosconfig = "/usr/lib/python2.7/site-packages/sos/plugins"
|
||||||
sosfile = "tower-sos3.py"
|
|
||||||
else:
|
else:
|
||||||
sosconfig = "/usr/lib/python2.6/site-packages/sos/plugins"
|
sosconfig = "/usr/lib/python2.6/site-packages/sos/plugins"
|
||||||
sosfile = "tower-sos2.py"
|
|
||||||
shutil.copy("config/awx-munin-el.conf", "config/awx-munin.conf")
|
shutil.copy("config/awx-munin-el.conf", "config/awx-munin.conf")
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
@@ -222,7 +219,7 @@ setup(
|
|||||||
"tools/munin_monitors/taskmanager_alive"]),
|
"tools/munin_monitors/taskmanager_alive"]),
|
||||||
("%s" % munin_plugin_conf_path, ["config/awx_munin_tower_jobs"]),
|
("%s" % munin_plugin_conf_path, ["config/awx_munin_tower_jobs"]),
|
||||||
("%s" % sysinit, ["tools/scripts/ansible-tower"]),
|
("%s" % sysinit, ["tools/scripts/ansible-tower"]),
|
||||||
("%s" % sosconfig, ["tools/sosreport/%s" % sosfile]),
|
("%s" % sosconfig, ["tools/sosreport/tower.py"]),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
options = {
|
options = {
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
# Copyright (c) 2014 Ansible, Inc.
|
|
||||||
# All Rights Reserved.
|
|
||||||
|
|
||||||
import sos.plugintools
|
|
||||||
|
|
||||||
class tower(sos.plugintools.PluginBase):
|
|
||||||
'''Tower SOS plugin'''
|
|
||||||
|
|
||||||
def setup(self):
|
|
||||||
|
|
||||||
commands = [
|
|
||||||
"ansible --version", # ansible core version
|
|
||||||
"awx-manage --version", # tower version
|
|
||||||
"supervisorctl status", # tower process status
|
|
||||||
"tree -d /var/lib/awx", # show me the dirs
|
|
||||||
"ls -ll /var/lib/awx", # check permissions
|
|
||||||
"ls -ll /etc/awx"
|
|
||||||
]
|
|
||||||
|
|
||||||
dirs = [
|
|
||||||
"/etc/awx/",
|
|
||||||
"/var/log/supervisor/",
|
|
||||||
"/var/log/syslog",
|
|
||||||
"/var/log/udev",
|
|
||||||
"/var/log/kern*",
|
|
||||||
"/var/log/dist-upgrade",
|
|
||||||
"/var/log/installer",
|
|
||||||
"/var/log/unattended-upgrades",
|
|
||||||
"/var/log/apport.log"
|
|
||||||
]
|
|
||||||
|
|
||||||
for path in dirs:
|
|
||||||
self.addCopySpec(path)
|
|
||||||
|
|
||||||
for command in commands:
|
|
||||||
self.collectExtOutput(command)
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
# Copyright (c) 2014 Ansible, Inc.
|
|
||||||
# All Rights Reserved.
|
|
||||||
|
|
||||||
from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
|
|
||||||
|
|
||||||
class tower(Plugin, RedHatPlugin, UbuntuPlugin):
|
|
||||||
'''Tower SOS plugin'''
|
|
||||||
plugin_name = "tower"
|
|
||||||
|
|
||||||
def setup(self):
|
|
||||||
|
|
||||||
commands = [
|
|
||||||
"ansible --version", # ansible core version
|
|
||||||
"awx-manage --version", # tower version
|
|
||||||
"supervisorctl status", # tower process status
|
|
||||||
"tree -d /var/lib/awx", # show me the dirs
|
|
||||||
"ls -ll /var/lib/awx", # check permissions
|
|
||||||
"ls -ll /etc/awx"
|
|
||||||
]
|
|
||||||
|
|
||||||
dirs = [
|
|
||||||
"/etc/awx/",
|
|
||||||
"/var/log/supervisor/",
|
|
||||||
"/var/log/syslog",
|
|
||||||
"/var/log/udev",
|
|
||||||
"/var/log/kern*",
|
|
||||||
"/var/log/dist-upgrade",
|
|
||||||
"/var/log/installer",
|
|
||||||
"/var/log/unattended-upgrades",
|
|
||||||
"/var/log/apport.log"
|
|
||||||
]
|
|
||||||
|
|
||||||
for path in dirs:
|
|
||||||
self.add_copy_spec(path)
|
|
||||||
|
|
||||||
for command in commands:
|
|
||||||
self.collect_ext_output(command)
|
|
||||||
77
tools/sosreport/tower.py
Normal file
77
tools/sosreport/tower.py
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# Copyright (c) 2014 Ansible, Inc.
|
||||||
|
# All Rights Reserved.
|
||||||
|
|
||||||
|
import sos
|
||||||
|
from pkg_resources import parse_version
|
||||||
|
|
||||||
|
if parse_version(sos.__version__) >= parse_version('3.0'):
|
||||||
|
from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
|
||||||
|
|
||||||
|
class tower(Plugin, RedHatPlugin, UbuntuPlugin):
|
||||||
|
'''Collect Ansible Tower related information'''
|
||||||
|
plugin_name = "tower"
|
||||||
|
|
||||||
|
def setup(self):
|
||||||
|
|
||||||
|
commands = [
|
||||||
|
"ansible --version", # ansible core version
|
||||||
|
"awx-manage --version", # tower version
|
||||||
|
"supervisorctl status", # tower process status
|
||||||
|
"tree -d /var/lib/awx", # show me the dirs
|
||||||
|
"ls -ll /var/lib/awx", # check permissions
|
||||||
|
"ls -ll /etc/awx"
|
||||||
|
]
|
||||||
|
|
||||||
|
dirs = [
|
||||||
|
"/etc/awx/",
|
||||||
|
"/var/log/supervisor/",
|
||||||
|
"/var/log/syslog",
|
||||||
|
"/var/log/udev",
|
||||||
|
"/var/log/kern*",
|
||||||
|
"/var/log/dist-upgrade",
|
||||||
|
"/var/log/installer",
|
||||||
|
"/var/log/unattended-upgrades",
|
||||||
|
"/var/log/apport.log"
|
||||||
|
]
|
||||||
|
|
||||||
|
for path in dirs:
|
||||||
|
self.add_copy_spec(path)
|
||||||
|
|
||||||
|
for command in commands:
|
||||||
|
self.collect_ext_output(command)
|
||||||
|
|
||||||
|
else:
|
||||||
|
import sos.plugintools
|
||||||
|
|
||||||
|
class tower(sos.plugintools.PluginBase):
|
||||||
|
'''Collect Ansible Tower related information'''
|
||||||
|
|
||||||
|
def setup(self):
|
||||||
|
|
||||||
|
commands = [
|
||||||
|
"ansible --version", # ansible core version
|
||||||
|
"awx-manage --version", # tower version
|
||||||
|
"supervisorctl status", # tower process status
|
||||||
|
"tree -d /var/lib/awx", # show me the dirs
|
||||||
|
"ls -ll /var/lib/awx", # check permissions
|
||||||
|
"ls -ll /etc/awx"
|
||||||
|
]
|
||||||
|
|
||||||
|
dirs = [
|
||||||
|
"/etc/awx/",
|
||||||
|
"/var/log/supervisor/",
|
||||||
|
"/var/log/syslog",
|
||||||
|
"/var/log/udev",
|
||||||
|
"/var/log/kern*",
|
||||||
|
"/var/log/dist-upgrade",
|
||||||
|
"/var/log/installer",
|
||||||
|
"/var/log/unattended-upgrades",
|
||||||
|
"/var/log/apport.log"
|
||||||
|
]
|
||||||
|
|
||||||
|
for path in dirs:
|
||||||
|
self.addCopySpec(path)
|
||||||
|
|
||||||
|
for command in commands:
|
||||||
|
self.collectExtOutput(command)
|
||||||
|
|
||||||
Reference in New Issue
Block a user