From 697ff365be872fb594a1eb3e695d45f717116d6b Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Sun, 16 Jul 2017 16:39:48 -0400 Subject: [ovirt] Capture domain information for v4 and resolve #947 In ovirt 4.x, the engine-manage-domains tool is no longer used, being replaced by ovirt-aaa-jdbc-tool. This patch uses the correct utility based on which is available on the ovirt manager. Additionally, the jbosstrace option will now only work where ovirt-engine is installed (instead of just dwh), resolving #947. Resolves: #947 Closes: #1063 Signed-off-by: Jake Hunsaker Signed-off-by: Bryn M. Reeves --- sos/plugins/ovirt.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/sos/plugins/ovirt.py b/sos/plugins/ovirt.py index c85ce7d8..630bc6e1 100644 --- a/sos/plugins/ovirt.py +++ b/sos/plugins/ovirt.py @@ -22,6 +22,7 @@ import signal from sos.plugins import Plugin, RedHatPlugin +from sos.utilities import is_executable # Class name must be the same as file name and method names must not change @@ -66,7 +67,7 @@ class Ovirt(Plugin, RedHatPlugin): ] def setup(self): - if self.get_option('jbosstrace'): + if self.get_option('jbosstrace') and self.is_installed('ovirt-engine'): engine_pattern = "^ovirt-engine\ -server.*jboss-modules.jar" pgrep = "pgrep -f '%s'" % engine_pattern lines = self.call_ext_prog(pgrep)['output'].splitlines() @@ -85,7 +86,26 @@ class Ovirt(Plugin, RedHatPlugin): self.add_forbidden_path('/etc/rhevm/.pgpass') # Copy all engine tunables and domain information self.add_cmd_output("engine-config --all") - self.add_cmd_output("engine-manage-domains list") + + # 3.x line uses engine-manage-domains, 4.x uses ovirt-aaa-jdbc-tool + if is_executable('engine-manage-domains'): + self.add_cmd_output('engine-manage-domains list') + if is_executable('ovirt-engine-extensions-tool'): + self.add_cmd_output( + 'ovirt-engine-extensions-tool info list-extensions' + ) + if is_executable('ovirt-aaa-jdbc-tool'): + cmd = 'ovirt-aaa-jdbc-tool' + subcmds = [ + 'query --what=user', + 'query --what=group', + 'settings show' + ] + + self.add_cmd_output([ + '%s %s' % (cmd, sub) for sub in subcmds + ]) + # Copy engine config files. self.add_copy_spec([ "/etc/ovirt-engine", -- cgit