Ejemplo n.º 1
0
    def _select_pools(pools, mons):
        """
        determine the pools this mon should scan based on it's name. We select
        pools from the an offset into the pool list, and then repeat at an
        interval set by # mons in the configuration. This splits up the pools
        we have, so each mon looks at a discrete set of pools instead of all
        mons performing all scans.
        :param pools: (list) rados pool names
        :param mons: (list) monitor names from ceph health
        :return: (list) of pools this monitor should scan. empty list if the
                 monitor name mismatches - so no scans done
        """

        pools_to_scan = []

        try:
            freq = mons.index(get_hostname())
        except ValueError:
            # this host's name is not in the monitor list?
            # twilight zone moment
            pass
        else:

            pools_to_scan = [pools[ptr]
                             for ptr in xrange(freq, len(pools), len(mons))]

        return pools_to_scan
Ejemplo n.º 2
0
    def __init__(self):
        self.cluster_name = None
        self.event_url = None
        self.host_name = get_hostname()

        self.mon = None
        self.rgw = None
        self.osd = None
        self.iscsi = None
Ejemplo n.º 3
0
    def __init__(self):
        self.cluster_name = None
        self.host_name = get_hostname()

        self.mon_socket = None
        self.rgw_socket = None

        self.mon = None
        self.rgw = None
        self.osd = None
Ejemplo n.º 4
0
    def __init__(self, *args, **kwargs):
        BaseCollector.__init__(self, *args, **kwargs)

        self.admin_socket = ('/var/run/ceph/{}-mon.'
                             '{}.asok'.format(self.cluster_name,
                                              get_hostname()))

        self.last_state = CephState()

        self.ip_names = get_names()

        if self.version < 12:
            self.get_mon_health = self._mon_health
        else:
            self.get_mon_health = self._mon_health_new

        if self._parent:
            self.logger.debug("Event URL is : "
                              "{}".format(self._parent.event_url))
Ejemplo n.º 5
0
    def __init__(self, *args, **kwargs):
        BaseCollector.__init__(self, *args, **kwargs)

        self.host_name = get_hostname()
Ejemplo n.º 6
0
 def __init__(self, cluster_name, admin_socket, **kwargs):
     BaseCollector.__init__(self, cluster_name, admin_socket, **kwargs)
     self.host_name = get_hostname()