mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 20:00:43 -03:30
Merge pull request #3815 from pmoravec/awx-pmoravec-tower-sos-plugin-improvements
sosreport plugin improvements Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
commit
e5cf5be18d
@ -1,11 +1,9 @@
|
||||
# Copyright (c) 2016 Ansible, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
import sos
|
||||
from distutils.version import LooseVersion
|
||||
from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
|
||||
|
||||
SOSREPORT_TOWER_COMMANDS = [
|
||||
"ansible --version", # ansible core version
|
||||
"awx-manage --version", # tower version
|
||||
"awx-manage list_instances", # tower cluster configuration
|
||||
"awx-manage run_dispatcher --status", # tower dispatch worker status
|
||||
@ -23,15 +21,11 @@ SOSREPORT_TOWER_COMMANDS = [
|
||||
|
||||
SOSREPORT_TOWER_DIRS = [
|
||||
"/etc/tower/",
|
||||
"/etc/ansible/",
|
||||
"/etc/supervisord.d/",
|
||||
"/etc/nginx/",
|
||||
"/var/log/tower",
|
||||
"/var/log/nginx",
|
||||
"/var/log/supervisor",
|
||||
"/var/log/syslog",
|
||||
"/var/log/udev",
|
||||
"/var/log/kern*",
|
||||
"/var/log/dist-upgrade",
|
||||
"/var/log/installer",
|
||||
"/var/log/unattended-upgrades",
|
||||
@ -47,38 +41,17 @@ SOSREPORT_FORBIDDEN_PATHS = [
|
||||
"/var/log/tower/profile"
|
||||
]
|
||||
|
||||
if LooseVersion(sos.__version__) >= LooseVersion('3.0'):
|
||||
from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
|
||||
|
||||
class tower(Plugin, RedHatPlugin, UbuntuPlugin):
|
||||
'''Collect Ansible Tower related information'''
|
||||
plugin_name = "tower"
|
||||
class Tower(Plugin, RedHatPlugin, UbuntuPlugin):
|
||||
'''Collect Ansible Tower related information'''
|
||||
plugin_name = "tower"
|
||||
|
||||
def setup(self):
|
||||
def setup(self):
|
||||
|
||||
for path in SOSREPORT_TOWER_DIRS:
|
||||
self.add_copy_spec(path)
|
||||
for path in SOSREPORT_TOWER_DIRS:
|
||||
self.add_copy_spec(path)
|
||||
|
||||
for path in SOSREPORT_FORBIDDEN_PATHS:
|
||||
self.add_forbidden_path(path)
|
||||
self.add_forbidden_path(SOSREPORT_FORBIDDEN_PATHS)
|
||||
|
||||
for command in SOSREPORT_TOWER_COMMANDS:
|
||||
self.add_cmd_output(command)
|
||||
|
||||
else:
|
||||
import sos.plugintools
|
||||
|
||||
class tower(sos.plugintools.PluginBase):
|
||||
'''Collect Ansible Tower related information'''
|
||||
|
||||
def setup(self):
|
||||
|
||||
for path in SOSREPORT_TOWER_DIRS:
|
||||
self.addCopySpec(path)
|
||||
|
||||
for path in SOSREPORT_FORBIDDEN_PATHS:
|
||||
self.addForbiddenPath(path)
|
||||
|
||||
for command in SOSREPORT_TOWER_COMMANDS:
|
||||
self.collectExtOutput(command)
|
||||
self.add_cmd_output(SOSREPORT_TOWER_COMMANDS)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user