diff options
-rwxr-xr-x | missing-maintainer-keys (renamed from hostinfo-checks) | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/hostinfo-checks b/missing-maintainer-keys index 9fb53ba..c3f5967 100755 --- a/hostinfo-checks +++ b/missing-maintainer-keys @@ -12,11 +12,15 @@ import argparse import logging import nagiosplugin -class MissingMaintainers(nagiosplugin.Resource): +class MissingMaintainerKeys(nagiosplugin.Resource): def __init__(self, hostinfo, repo): self.hostinfo = hostinfo self.repo = repo + @property + def name(self): + return "missing_maintainer_keys" + def _get_all_hosts(self): hosts = list() hosts_path = os.path.join(self.hostinfo, 'metadata', 'hosts') @@ -48,9 +52,11 @@ class MissingMaintainers(nagiosplugin.Resource): yield nagiosplugin.Metric('missing', errors, context='missing') -class MaintainersContext(nagiosplugin.Context): +class MissingMaintainerKeysContext(nagiosplugin.Context): def __init__(self, name, result_cls=nagiosplugin.Result): - super(MaintainersContext, self).__init__(name, result_cls=result_cls) + super(MissingMaintainerKeysContext, self).__init__( + name, + result_cls=result_cls) def describe(self, metric): if len(metric.value) > 0: @@ -109,8 +115,8 @@ def main(): raise Exception("bcfg2 repo not found in '%s'" % args.repo) check = nagiosplugin.Check( - MissingMaintainers(args.path, args.repo), - MaintainersContext('missing')) + MissingMaintainerKeys(args.path, args.repo), + MissingMaintainerKeysContext('missing')) check.main(verbose=args.verbose) if __name__ == '__main__': |