[Kimchi-devel] [RFC] Add an sos plugin for the kimchi platform
Christy Perez
christy at linux.vnet.ibm.com
Sat Dec 6 00:59:43 UTC 2014
This is the plugin as I submitted it to the sos-devel mailing list. If
you'd like to comment on it here, I'll gather up all feedback and rework
the patch there. We can always get the initial version accepted by RH
and then add more items later.
Regards,
- Christy
On 12/05/2014 06:51 PM, Christy Perez wrote:
> This plugin gathers kimchi logs as well as information
> about libvirt storage pools defined on the system.
>
> Kimchi is an HTML5-based virtualization-management platform
> For more information, please visit:
> https://github.com/kimchi-project/kimchi/wiki
>
> Signed-off-by: Christy Perez <christy at linux.vnet.ibm.com>
> ---
> sos/plugins/kimchi.py | 39 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
> create mode 100644 sos/plugins/kimchi.py
>
> diff --git a/sos/plugins/kimchi.py b/sos/plugins/kimchi.py
> new file mode 100644
> index 0000000..69f138e
> --- /dev/null
> +++ b/sos/plugins/kimchi.py
> @@ -0,0 +1,39 @@
> +### 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, UbuntuPlugin, DebianPlugin
> +
> +class Kimchi(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin):
> + """kimchi-related information
> + """
> +
> + plugin_name = 'kimchi'
> + packages = ('kimchi',)
> +
> + def setup(self):
> + self.add_copy_spec([
> + "/etc/kimchi/",
> + "/var/log/kimchi*"
> + ])
> +
> + file_name = self.get_cmd_output_now("virsh -r pool-list --details")
> + if file_name is not None:
> + with open(file_name, 'r') as pools:
> + for pool in list(pools)[2:]:
> + try:
> + pool_name = pool.lstrip().split()[0]
> + self.get_cmd_output_now("virsh -r vol-list --pool \
> + %s --details" % pool_name)
> + except:
> + pass
>
More information about the Kimchi-devel
mailing list