00
 º    # Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>

# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution for further information.

from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin


class ActiveMq(Plugin, DebianPlugin):
    """ActiveMQ message broker
    """

    plugin_name = 'activemq'
    profiles = ('openshift',)
    packages = ('activemq', 'activemq-core')
    files = ('/var/log/activemq',)

    def setup(self):
        if self.get_option("all_logs"):
            self.add_copy_spec(list(self.files))
        else:
            self.add_copy_spec([
                "/var/log/activemq/activemq.log",
                "/var/log/activemq/wrapper.log"
            ])

    def postproc(self):
        # activemq.xml contains credentials in this form:
        #   <authenticationUser ... password="changeme" ... />
        self.do_file_sub(
            '/etc/activemq/activemq.xml',
            r'(\s*password=")[^"]*(".*)',
            r"\1******\2"
        )


class RedHatActiveMq(ActiveMq, RedHatPlugin):

    def setup(self):
        super(RedHatActiveMq, self).setup()
        self.add_copy_spec([
            '/etc/sysconfig/activemq',
            '/etc/activemq/activemq.xml'
        ])


class UbuntuActiveMq(ActiveMq, UbuntuPlugin):
    def setup(self):
        super(UbuntuActiveMq, self).setup()
        self.add_copy_spec([
            '/etc/activemq',
            '/etc/default/activemq'
        ])
 ©    	ó
)rjc           @   s[   d  d l  m Z m Z m Z m Z d e e e f d „  ƒ  YZ d e e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   Plugint   RedHatPlugint   DebianPlugint   UbuntuPlugint   Ctdbc           B   s)   e  Z d  Z d Z d Z d Z d „  Z RS(   s   Samba Clustered TDB
    t   ctdbt   clustert   storagec      
   C   sN   |  j  d d d d d d d g ƒ |  j d d	 d
 d d d d d d g	 ƒ d  S(   Ns   /etc/ctdb/ctdb.confs   /etc/ctdb/*.optionss   /etc/ctdb/nodess   /etc/ctdb/public_addressess   /etc/ctdb/static-routess   /etc/ctdb/multipathds   /var/log/log.ctdbs   ctdb ips	   ctdb pings   ctdb statuss   ctdb ifacess   ctdb listnodess   ctdb listvarss   ctdb statisticss   ctdb getdbmaps   ctdb event script list legacy(   t   add_copy_spect   add_cmd_output(   t   self(    (    s4   /usr/lib/python2.7/site-packages/sos/plugins/ctdb.pyt   setup   s$    
(   R   (   R   R   (   t   __name__t
   __module__t   __doc__t   packagest   profilest   plugin_nameR   (    (    (    s4   /usr/lib/python2.7/site-packages/sos/plugins/ctdb.pyR      s
   t
   RedHatCtdbc           B   s   e  Z d  „  Z RS(   c         C   s$   t  t |  ƒ j ƒ  |  j d ƒ d  S(   Ns   /etc/sysconfig/ctdb(   t   superR   R   R   (   R
   (    (    s4   /usr/lib/python2.7/site-packages/sos/plugins/ctdb.pyR   .   s    (   R   R   R   (    (    (    s4   /usr/lib/python2.7/site-packages/sos/plugins/ctdb.pyR   -   s   N(   t   sos.pluginsR    R   R   R   R   R   (    (    (    s4   /usr/lib/python2.7/site-packages/sos/plugins/ctdb.pyt   <module>   s   "     ˆ¾Â961ÁÀ Á    ó
)rjc           @   sE   d  d l  m Z m Z m Z m Z d e e e e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   Plugint   RedHatPlugint   DebianPlugint   UbuntuPlugint   Pppc           B   s)   e  Z d  Z d Z d Z d Z d „  Z RS(   s   Point-to-point protocol
    t   pppt   systemt   networkc         C   s'   |  j  d d d g ƒ |  j d ƒ d  S(   Ns   /etc/wvdial.confs   /etc/ppps   /var/log/ppps   adsl-status(   t   add_copy_spect   add_cmd_output(   t   self(    (    s3   /usr/lib/python2.7/site-packages/sos/plugins/ppp.pyt   setup   s
    
(   s   systemR