Ejemplo n.º 1
0
 def map_minions(self, get_only_alive=False):
     """
     Builds a recursive map of the minions currently assigned to this
     overlord
     """
     maphash = {}
     current_minions = []
     if get_only_alive:
         ping_results = fc.Overlord("*").test.ping()
         for minion in ping_results.keys():
             if ping_results[minion] == 1:  #if minion is alive
                 current_minions.append(minion)  #add it to the list
     else:
         cm = certmaster.CertMaster()
         current_minions = cm.get_signed_certs()
     for current_minion in current_minions:
         if current_minion in utils.get_hostname():
             maphash[current_minion] = {}  #prevent infinite recursion
         else:
             next_hop = fc.Overlord(current_minion)
             mapresults = next_hop.overlord.map_minions()[current_minion]
             if not utils.is_error(mapresults):
                 maphash[current_minion] = mapresults
             else:
                 maphash[current_minion] = {}
     return maphash
Ejemplo n.º 2
0
 def map_minions(self,get_only_alive=False):
     """
     Builds a recursive map of the minions currently assigned to this
     overlord
     """
     maphash = {}
     current_minions = []
     if get_only_alive:
         ping_results = fc.Overlord("*").test.ping()
         for minion in ping_results.keys():
             if ping_results[minion] == 1: #if minion is alive
                 current_minions.append(minion) #add it to the list
     else:
         cm = certmaster.CertMaster()
         current_minions = cm.get_signed_certs()
     for current_minion in current_minions:
         if current_minion in utils.get_hostname():
             maphash[current_minion] = {} #prevent infinite recursion
         else:
             next_hop = fc.Overlord(current_minion)
             mapresults = next_hop.overlord.map_minions()[current_minion]
             if not utils.is_error(mapresults):
                 maphash[current_minion] = mapresults
             else:
                 maphash[current_minion] = {}
     return maphash
Ejemplo n.º 3
0
    def do(self, args):

        if not self.check_certmaster and not self.check_minion:
            print "* specify --certmaster, --minion, or both"
            return
        else:
            print "SCAN RESULTS:"

        hostname = utils.get_hostname()
        print "* FQDN is detected as %s, verify that is correct" % hostname
        self.check_iptables()

        if not os.getuid() == 0:
            print "* root is required to run these setup tests"
            return

        if self.check_minion:

            # check that funcd is running
            self.check_service("funcd")

            # check that the configured certmaster is reachable
            self.check_talk_to_certmaster()

        if self.check_certmaster:

            # check that certmasterd is running
            self.check_service("certmasterd")

            # see if we have any waiting CSRs
            # FIXME: TODO

            # see if we have signed any certs
            # FIXME: TODO

            self.server_spec = self.parentCommand.server_spec
            self.getOverlord()

            results = self.overlord_obj.test.add(1, 2)
            hosts = results.keys()
            if len(hosts) == 0:
                print "* no systems have signed certs"
            else:
                failed = 0
                for x in hosts:
                    if results[x] != 3:
                        failed = failed + 1
                if failed != 0:
                    print "* unable to connect to %s registered minions from overlord" % failed
                    print "* run func '*' ping to check status"

            # see if any of our certs have expired

        # warn about iptables if running
        print "End of Report."
Ejemplo n.º 4
0
    def do(self, args):

        if not self.check_certmaster and not self.check_minion:
            print "* specify --certmaster, --minion, or both"
            return
        else:
            print "SCAN RESULTS:"

        hostname = utils.get_hostname()
        print "* FQDN is detected as %s, verify that is correct" % hostname
        self.check_iptables()

        if not os.getuid() == 0:
            print "* root is required to run these setup tests"
            return

        if self.check_minion:

            # check that funcd is running
            self.check_service("funcd")

            # check that the configured certmaster is reachable
            self.check_talk_to_certmaster()

        if self.check_certmaster:

            # check that certmasterd is running
            self.check_service("certmasterd")

            # see if we have any waiting CSRs
            # FIXME: TODO

            # see if we have signed any certs
            # FIXME: TODO

            self.server_spec = self.parentCommand.server_spec
            self.getOverlord()

            results = self.overlord_obj.test.add(1, 2)
            hosts = results.keys()
            if len(hosts) == 0:
                print "* no systems have signed certs"
            else:
                failed = 0
                for x in hosts:
                    if results[x] != 3:
                        failed = failed + 1
                if failed != 0:
                    print "* unable to connect to %s registered minions from overlord" % failed
                    print "* run func '*' ping to check status"

            # see if any of our certs have expired

        # warn about iptables if running
        print "End of Report."