Main entry point.

def run(self, error_on_warning=False, region=None, accounts=[]):
        """
        Main entry point.
        """
        all_warnings = []
        all_criticals = []
        if len(accounts) == 0:
            # if no accounts specified, run all of them
            accounts = self._conf.list_account_ids
        for acct_id in accounts:
            acct_conf = self._conf.get_account_config(acct_id)
            if region is None:
                regions = list(acct_conf['regions'].keys())
            elif region in acct_conf['regions']:
                regions = [region]
            else:
                print('\nAccount %s is not configured for region %s' % (
                    acct_id, region
                ))
                regions = []
            for rname in regions:
                print('\n%s (%s) %s' % (acct_id, acct_conf['name'], rname))
                warnings, criticals = self.check_limits(
                    acct_id, rname, role_name=acct_conf['role_name'],
                    limit_overrides=acct_conf[
                        'regions'][rname]['limit_overrides'],
                    threshold_overrides=acct_conf[
                        'regions'][rname]['threshold_overrides'],
                )
                # output
                for w in warnings:
                    print("\tWARNING: %s" % w)
                    all_warnings.append(w)
                for c in criticals:
                    print("\tCRITICAL: %s" % c)
                    all_criticals.append(c)
                if len(warnings) == 0 and len(criticals) == 0:
                    print("\tNo problems found.")

        # summary
        if len(all_warnings) > 0 or len(all_criticals) > 0:
            print(
                "\n{c} limit(s) above CRITICAL threshold; {w} limit(s) above "
                "WARNING threshold".format(
                    c=len(all_criticals), w=len(all_warnings)
                )
            )
        else:
            print("All limits are within thresholds.")
        if (
            (len(all_warnings) > 0 and error_on_warning) or
            len(all_criticals) > 0
        ):
            print('PROBLEMS FOUND. See above output for details.')
            raise SystemExit(1)