[sos-devel] [PATCH 2/2] [ovirt_hosted_engine] new plugin for oVirt
Sandro Bonazzola
sbonazzo at redhat.com
Tue Aug 19 09:05:37 UTC 2014
The oVirt Hosted Engine packages allow to run
ovirt-engine inside a VM. This plugin provides
info about the setup and the high availability daemons
running such VM.
Change-Id: I4380bbed5bab4dd7fd3472bf5d5d1265f1eed3e7
Signed-off-by: Sandro Bonazzola <sbonazzo at redhat.com>
---
sos/plugins/ovirt_hosted_engine.py | 61 ++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
create mode 100644 sos/plugins/ovirt_hosted_engine.py
diff --git a/sos/plugins/ovirt_hosted_engine.py b/sos/plugins/ovirt_hosted_engine.py
new file mode 100644
index 0000000..41d87bf
--- /dev/null
+++ b/sos/plugins/ovirt_hosted_engine.py
@@ -0,0 +1,61 @@
+# Copyright (C) 2014 Red Hat, Inc., Sandro Bonazzola <sbonazzo at redhat.com>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+
+from sos.plugins import Plugin, RedHatPlugin
+
+
+# Class name must be the same as file name and method names must not change
+class OvirtHostedEngine(Plugin, RedHatPlugin):
+ """oVirt Hosted Engine related information"""
+
+ packages = (
+ 'ovirt-hosted-engine-setup',
+ 'ovirt-hosted-engine-ha',
+ )
+
+ plugin_name = 'ovirt_hosted_engine'
+
+ def setup(self):
+ self.limit = self.get_option("log_size")
+
+ # Add configuration files
+ self.add_copy_specs([
+ '/etc/ovirt-hosted-engine/',
+ '/etc/ovirt-hosted-engine-ha/',
+ '/etc/ovirt-hosted-engine-setup.env.d/'
+ ])
+
+ # Add ovirt-hosted-engine-setup log files
+ self.add_copy_specs([
+ '/var/log/ovirt-hosted-engine-setup/'
+ ])
+
+ # Add ovirt-hosted-engine-ha logs, limiting the size
+ self.add_copy_spec_limit(
+ '/var/log/ovirt-hosted-engine-ha/*.log',
+ sizelimit=self.limit,
+ reverse_order=True
+ )
+
+ # Add run-time status
+ self.add_cmd_outputs([
+ 'hosted-engine --vm-status',
+ 'hosted-engine --check-liveliness'
+ ])
+
+
+# vim: expandtab tabstop=4 shiftwidth=4
--
1.8.3.1
More information about the sos-devel
mailing list